Skip to content

Instantly share code, notes, and snippets.

@MustCodeAl
Last active September 13, 2023 20:45
Show Gist options
  • Save MustCodeAl/d58bed786885315b16824849d851f2aa to your computer and use it in GitHub Desktop.
Save MustCodeAl/d58bed786885315b16824849d851f2aa to your computer and use it in GitHub Desktop.
Synced via Snip
ymy sni
// https://github.com/rust-lang/rust-clippy
// https://rust-lang.github.io/rust-clippy/stable/index.html
make sure you put it on complexity and pendantic
cargo clippy --all-features --all-targets --message-format=json -- --warn clippy::pedantic > report.json
working command for linter :)
cargo clippy --all-features --all-targets -- --warn clippy::pedantic --warn clippy::complexity
// cargo clippy --all-features --all-targets -- --warn clippy::style
then also use either complexity or
//correctness garbage
// nursery is new stuff
// perf is built in
// style is built in
// suspicious built in
the best are
pedantic,
and complexity (on by default)
retsticts good for produc lint
// restrictions are good for corporate
// USE STYLE FOR DESIGN PATTERNS
-D IS FOR DENY
or your type --deny
//USE THIS COMMAND TO LINT YOUR CODE TO DESIGN YOUR RUST BETTER
--all-features --all-targets -- --warn clippy::pedantic --warn clippy::complexity --warn clippy::restrictions
clippy -- --warn clippy::pedantic --warn clippy::nursery --warn clipy::restriction --allow clippy::implicit_return --allow clippy::needless_return
or
clippy -- --deny clippy::pedantic --warn clippy::nursery
#![warn(clippy::all, clippy::pedantic, clippy::restriction)]
#![allow(clippy::float_arithmetic, clippy::implicit_return, clippy::needless_return)]
#![allow(clippy::blanket_clippy_restriction_lints)]
https://www.reddit.com/r/rust/comments/ol6qil/state_of_linting_in_rust/
#![deny(clippy::all)]
#![warn(clippy::pedantic)]
#![warn(clippy::cargo)]
#![warn(clippy::nursery)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment