Skip to content

[Tracking issue] Rearrange location of some of the existing lints #6680

Open
@magurotuna

Description

@magurotuna

Currently, the lint rules grouped as "methods" reside in clippy_lints/src/methods as there are a number of rules belonging to the "methods" group.
However, although the other groups such as "loops", "types", "transmute" and "misc" also have many relavent rules, they reside not in clippy_lints/src/<group_name> but in clippy_lints/src.
It would be great to have these groups located under <group_name> directory just like "methods". So I open this issue to do this refactoring and to keep track of it.

How to rearrange is like the following, proposed by @flip1995 on zulip

I would keep the declare_clippy_lint! in the mod.rs Best case would be that mod.rs only contains the lint definitions and the LintPass impl. Utility functions of the module should probably go in methods/utils.rs and then reexported for the module in mod.rs.

proposed by @camsteffen:

For each lint, create a new module at clippy_lints/src/<group_name>/<lint_name>.rs. Within that module, add a function fn check(cx, ..) (with any needed arguments) and move the implementation there.

CC @nahuakang @camsteffen

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-an-interesting-projectCategory: Interesting projects, that usually are more involved design/code wise.C-tracking-issueCategory: Tracking IssueE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions