Skip to content

consider passing --cfg test by default #1436

Closed

Description

Posted by @durka in arcnmx/cargo-clippy#12

Regular cargo clippy doesn't check #[test] functions because it can't (the code is gone by the time the lints run). But if you do cargo clippy -- --cfg test it works. I wonder if there are any downsides to making this the default behavior.

I guess this breaks people who have #[cfg(not(test))] on things. But perhaps cargo-clippy can support a --test flag which would be a bit shorter than -- --cfg test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    S-needs-discussionStatus: Needs further discussion before merging or work can be started

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions