rust-lang / rust-clippy

A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/
https://rust-lang.github.io/rust-clippy/
Other
11.44k stars 1.54k forks source link

Should //run-rustfix tests apply HasPlaceholders suggestions? #4557

Open Manishearth opened 5 years ago

Manishearth commented 5 years ago

Applying // run-rustfix to tests/ui/float_cmp_const.rs causes the HasPlaceholders suggestions contained within that lint to be applied.

Do we actually want this behavior? HasPlaceholders suggestions are things that should be applied manually imo.

sinkuu commented 5 years ago

// run-rustfix seems to apply even MaybeIncorrect ones, unless there is rustfix-only-machine-applicable directive. 😞

flip1995 commented 5 years ago

There is // rustfix-only-machine-applicable, which we could add to those lints. If we run cargo fix --clippy only the MachineApplicable lints get applied? In that case we could run rustfix tests only for MachineApplicable lints.

Manishearth commented 5 years ago

Maybe we should invert those? But that sounds annoying too, maybe we should just close this.