You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For clippy's regex_macro lint, I made use of a Visitor so I could stop clippy from linting the same macro multiple times while being reasonably fast. However, this unfortunately means the lint ignores #[allow(_)] .. #[deny(_)] attributes below the crate level.
To solve this and other related problems, I propose any of
allow a lint to check anything from anywhere in the analysis by moving up the parent chain to check the level
allow a lint to opt out of check_* calls for the duration of a specific node including its child nodes
add after_* methods to the {Early, Late}LintPass trait, so lints can decide themselves
The third option is probably the easiest to implement, yet the most flexible. This would bring the trait closer to other stream parser implementations like SAX.
The text was updated successfully, but these errors were encountered:
llogiq
changed the title
extend lint interface
extend lint interface with more _post methods
Feb 10, 2016
This fixes#31512 for me.
A bit of explanation: I want to have `check_block_post(&mut self, &Context, &Block)` and `check_crate_post(&mut self, &Context, &Crate)` methods in both early and late lint passes. Ideally we'd have _post methods for all operations that walk, but this'll do for now.
@Manishearth r?
For clippy's
regex_macro
lint, I made use of aVisitor
so I could stop clippy from linting the same macro multiple times while being reasonably fast. However, this unfortunately means the lint ignores#[allow(_)]
..#[deny(_)]
attributes below the crate level.To solve this and other related problems, I propose any of
check_*
calls for the duration of a specific node including its child nodesafter_*
methods to the {Early, Late}LintPass trait, so lints can decide themselvesThe third option is probably the easiest to implement, yet the most flexible. This would bring the trait closer to other stream parser implementations like SAX.
The text was updated successfully, but these errors were encountered: