rust-lang / rust-lang/rust-clippy
Per-path lint levels in `DisallowedPath`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
DisallowedPath could gain support for different lint levels for particular paths.
The use case is that a project may want to warn, deny or forbid depending on the method/macro/type/name/... in particular. For instance, a project may want to deny a custom panicking macro and warn about some debugging macros. Assuming -Wdisallowed_macros, they could write:
disallowed-macros = [
"x::dbg",
{ path = "x::panic", level = "deny" },
]
These could behave as their own lint for level purposes. However, someone may still want to be able to override them, e.g. to allow or deny all of them, or a few of them. Thus it may be nice to give the user the ability to do so with e.g. -Ddisallowed_macros=x::dbg_foo and -Ddisallowed_macros=* (all, i.e. including both the ones with an explicit level and those without it, since the usual -Ddisallowed_macros applies to the current ones, i.e. those without an explicit level).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the DisallowedPath implementation and the existing lint-level handling for disallowed macros. Compare how explicit per-path levels and command-line overrides would interact, then identify the relevant tests or entry points from that implementation. Done means the proposed path-specific levels and override behavior are specified and covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100