Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn on unknown keys in lint table entries #12917

Closed
Alexendoo opened this issue Nov 5, 2023 · 3 comments · Fixed by #13262
Closed

Warn on unknown keys in lint table entries #12917

Alexendoo opened this issue Nov 5, 2023 · 3 comments · Fixed by #13262
Labels
A-lints-table Area: [lints] table C-bug Category: bug S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review

Comments

@Alexendoo
Copy link
Member

Problem

In rust-lang/rust-clippy#11751 a user had

[lints.clippy]
doc_markdown = { level = "deny", doc_valid_idents = ["GHz", ".."] }

Expecting the doc_valid_idents to set the clippy configuration of the same name, however it is silently ignored by cargo

Steps

No response

Possible Solution(s)

No response

Notes

No response

Version

No response

@Alexendoo Alexendoo added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Nov 5, 2023
@epage
Copy link
Contributor

epage commented Nov 6, 2023

Yeah, we should add a unused_keys warning to these.

@epage epage added S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review A-lints-table Area: [lints] table and removed S-triage Status: This issue is waiting on initial triage. labels Nov 6, 2023
@epage
Copy link
Contributor

epage commented Nov 6, 2023

btw allowing configuration in there is a future possibility though previously a clippy team member said they wouldn't use it.

@Alexendoo
Copy link
Member Author

The tool-wide section from that link looks like it would be a better fit for us yeah

epage added a commit to epage/cargo that referenced this issue Jan 8, 2024
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 rust-lang#12917
bors added a commit that referenced this issue Jan 8, 2024
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
@bors bors closed this as completed in 6e86530 Jan 8, 2024
stupendoussuperpowers pushed a commit to stupendoussuperpowers/cargo that referenced this issue Feb 28, 2024
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 rust-lang#12917
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints-table Area: [lints] table C-bug Category: bug S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants