Skip to content

extend lint interface with more _post methods #31512

Closed
@llogiq

Description

@llogiq

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions