refactor(toml): Make it more obvious to update package-dependent fields
Inspired by my having forgotten to add `[lints]` to the if sequence. Previously, we added a comment to suggest this but the further the code is, the harder it is to track.
I considered a custom `Deserialize` impl, possibly through a new type, that would error.
This would be the more "pure" solution.
Unfortunately, this would also have worse errors because the errors would be reported to the `Deserializer` at the document-level, rather than directly on the individual fields.
Well, we don't do on individual fields now but it is something we will soon be exploring.
Inspired by my having forgotten to add `[lints]` to the if sequence.
Previously, we added a comment to suggest this but the further the code
is, the harder it is to track.
I considered a custom `Deserialize` impl, possibly through a new type,
that would error.
This would be the more "pure" solution.
Unfortunately, this would also have worse errors because the errors
would be reported to the `Deserializer` at the document-level, rather
than directly on the individual fields.
Well, we don't do on individual fields now but it is something we will
soon be exploring.
chore(ci): Shot-in-the-dark fix for MSRV updating
With #13254, we found MSRV updating is broken.
PR #12775 is the last MSRV we got.
That was merged before #12654 and #13106.
That makes #12654 the most likely culprit.
Looking at the logs:
```
DEBUG: Matched 24 file(s) for manager regex: Cargo.toml, benches/benchsuite/Cargo.toml, benches/capture/Cargo.toml, crates/cargo-platform/Cargo.toml, crates/cargo-test-macro/Cargo.toml, crates/cargo-test-support/Cargo.toml, crates/cargo-test-support/containers/apache/bar/Cargo.toml, crates/cargo-test-support/containers/sshd/bar/Cargo.toml, crates/cargo-util-schemas/Cargo.toml, crates/cargo-util/Cargo.toml, crates/crates-io/Cargo.toml, crates/home/Cargo.toml, crates/mdman/Cargo.toml, crates/resolver-tests/Cargo.toml, crates/rustfix/Cargo.toml, crates/semver-check/Cargo.toml, crates/xtask-build-man/Cargo.toml, crates/xtask-bump-check/Cargo.toml, crates/xtask-stale-label/Cargo.toml, credential/cargo-credential-1password/Cargo.toml, credential/cargo-credential-libsecret/Cargo.toml, credential/cargo-credential-macos-keychain/Cargo.toml, credential/cargo-credential-wincred/Cargo.toml, credential/cargo-credential/Cargo.toml
...
DEBUG: manager extract durations (ms)
{
"managers": {
"dockerfile": 30,
"github-actions": 38,
"regex": 386,
"cargo": 855
}
}
DEBUG: Found cargo package files
DEBUG: Found dockerfile package files
DEBUG: Found github-actions package files
DEBUG: Found 25 package file(s)
```
Our regex managers have the files matched
but no regex manager packages are found.
I think this means that the name association failed or the regex within the file content failed.
The differences between cargo and my other projects
- Use of `:`
- `depNameTemplate`
- Presence of `\b`
As a first attempt, I'm going to switch `\b` to `\\b` to be like the other escaped regex values.
With #13254, we found MSRV updating is broken.
PR #12775 is the last MSRV we got.
That was merged before #12654 and #13106.
That makes #12654 the most likely culprit.
Looking at the logs:
```
DEBUG: Matched 24 file(s) for manager regex: Cargo.toml, benches/benchsuite/Cargo.toml, benches/capture/Cargo.toml, crates/cargo-platform/Cargo.toml, crates/cargo-test-macro/Cargo.toml, crates/cargo-test-support/Cargo.toml, crates/cargo-test-support/containers/apache/bar/Cargo.toml, crates/cargo-test-support/containers/sshd/bar/Cargo.toml, crates/cargo-util-schemas/Cargo.toml, crates/cargo-util/Cargo.toml, crates/crates-io/Cargo.toml, crates/home/Cargo.toml, crates/mdman/Cargo.toml, crates/resolver-tests/Cargo.toml, crates/rustfix/Cargo.toml, crates/semver-check/Cargo.toml, crates/xtask-build-man/Cargo.toml, crates/xtask-bump-check/Cargo.toml, crates/xtask-stale-label/Cargo.toml, credential/cargo-credential-1password/Cargo.toml, credential/cargo-credential-libsecret/Cargo.toml, credential/cargo-credential-macos-keychain/Cargo.toml, credential/cargo-credential-wincred/Cargo.toml, credential/cargo-credential/Cargo.toml
...
DEBUG: manager extract durations (ms)
{
"managers": {
"dockerfile": 30,
"github-actions": 38,
"regex": 386,
"cargo": 855
}
}
DEBUG: Found cargo package files
DEBUG: Found dockerfile package files
DEBUG: Found github-actions package files
DEBUG: Found 25 package file(s)
```
Our regex managers have the files matched
but no regex manager packages are found.
I think this means that the name association failed or the regex within
the file content failed.
The differences between cargo and my other projects
- Use of `:`
- `depNameTemplate`
- Presence of `\b`
As a first attempt, I'm going to switch `\b` to `\\b` to be like the
other escaped regex values.
fix(manifest): Provide unused key warnings for lints table
### What does this PR try to resolve?
The use of `flatten` was getting in the way of `serde_ignored`.
A common workaround is to add our own `unused` tracking but that would
cause duplicates with `workspace.lints` (or we'd just ignore it).
Since the manual deserializer was relatively simple, I went that route.
Fixes#12917
### How should we test and review this PR?
Per commit
A test was added for the issue. I then was worried about regressions in `workspace = false` errors (and I was right) so I added a test for that. To get `workspace = false` to work nicely, I made it share code with other `workspace: bool` fields.
### Additional information
test(manifest): Verify we warn on unused workspace.package fields
I assumed from #13258 that we didn't warn but apparently we do. Figured it'd still be good to keep the test around.
docs(changelog): Call out cargo-new lockfile change
I was looking for what release this happened in but we didn't have it listed.
We do list the documentation change.
This was likely from the PR focusing on the entire policy change which made it easy to overlook each aspect of the policy change.
The use of `flatten` was getting in the way of `serde_ignored`.
A common workaround is to add our own `unused` tracking but that would
cause duplicates with `workspace.lints` (or we'd just ignore it).
Since the manual deserializer was relatively simple, I went that route.
Fixes#12917
I was looking for what release this happened in but we didn't have it
listed.
We do list the documentation change.
This was likely from the PR focusing on the entire policy change which
made it easy to overlook each aspect of the policy change.
chore: Add dependency dashboard
Example: https://github.com/clap-rs/clap/issues/4824
I'm hoping this will make it easier to see what is going on with problems with RenovateBot, like our MSRVs not updating atm (#13254).
`cargo update --precise` might pass in any arbitrary Git reference,
and `git2::Oid::from_str` would always zero-pad the given str if it is
not a full SHA hex string.
This introduces an enum `Revision` to represent `locked_rev`
that is either deferred or resolved to an actual object ID.
When `locked_rev` is a short ID or any other Git reference,
Cargo first performs a Git fetch to resolve it (without --offline),
and then locks it to an actual commit object ID.
feat(embedded): Add prefix-char frontmatter syntax support
This is a follow up to #13241 with another syntax being discussed. This one is a bit more polarizing but we're hoping first-hand experience with it can help people get a feel for how well it works in practice.
As the experiment is meant to be short-lived, this is implemented in a hacky way and docs aren't updated.
Update dependency handlebars to v5 for mdman.
### What does this PR try to resolve?
issue #13238
- update dependency handlebars 4.5.0 -> 5.0.0
- fix code to fit the changes of Handlebars API
- RenderError::new() is deprecated. Use RenderErrorReason instead
### How should we test and review this PR?
pass all tests in /crates/mdman/tests
This is a follow up to #13241 with another syntax being discussed.
This one is a bit more polarizing but we're hoping first-hand experience
with it can help people get a feel for how well it works in practice.
As the experiment is meant to be short-lived, this is implemented in a
hacky way and docs aren't updated.
feat(embedded): Add multiple experimental manifest syntaxes
### What does this PR try to resolve?
As syntax discussions for "cargo script" are on-going, this allows us to experiment with a couple of them so we can see how they work in practice.
This is missing the line-prefix syntax as we decide how we want to separate blocks for it.
While doing this, I removed the previous doc-comment syntax. This was left in for transition purposes. With where discussions are going, its unlikely we'll go back to that syntax.
### How should we test and review this PR?
### Additional information
rust-lang/rfcs#3503https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Syntax.20for.20embedded.20tooling.20metadata