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

Handle priority in the lints table #932

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

suaviloquence
Copy link
Contributor

Like the cargo [lints] table, the priority key in a lint entry is optional (defaults to 0), and a lower (more negative) priority overrides a higher (more positive) entry that configures the same lint (which lets us define how to handle a lint group containing a lint, and a lint group). Changing OverrideStack from holding Arc<OverrideMap>s to just OverrideMaps is setting up for the upcoming lint group PR where each OverrideMap will be compiled based on lower items in the OverrideStack, so shared ownership doesn't make sense to use anymore.

Copy link
Owner

@obi1kenobi obi1kenobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great.

In a subsequent PR, could you think about a way to warn users if a lint could hit multiple configs that affect it with the same priority level? That's analogous to this clippy lint for regular cargo lints.

If you can't think of an easy and elegant way to do it, it's fine to just open an issue about it and move on — we shouldn't let it block other work if it's more than a 15min thing to build.

@obi1kenobi obi1kenobi merged commit 68ee754 into obi1kenobi:main Sep 18, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants