Skip to content

Un(der?)documented --tests option and requirement for it #16111

@AMDmi3

Description

@AMDmi3

Description

I've been struggling to make ignore_without_reason lint to work for my code, and it turned out that it won't work even for corresponding ui test from clippy repository:

#![warn(clippy::ignore_without_reason)]

fn main() {}

#[test]
fn unignored_test() {}

#[test]
#[ignore = "Some good reason"]
fn ignored_with_reason() {}

#[test]
#[ignore] //~ ignore_without_reason
fn ignored_without_reason() {}

It took some time to discover that no lints work for test code at all, and then to discover undocumented --tests option by pure chance.

Is it expected that the option and the fact that it's required to lint tests is not documented or mentioned anywhere? IMO it is not right that https://rust-lang.github.io/rust-clippy/master/index.html#ignore_without_reason mention example which does not work.

Version


Additional Labels

No response

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