Crates.io | cargo-lints |
lib.rs | cargo-lints |
version | 0.1.0 |
source | src |
created_at | 2021-05-11 08:31:04.576563 |
updated_at | 2021-05-11 08:31:04.576563 |
description | Utility for running lints specified from files |
homepage | |
repository | https://github.com/soramitsu/iroha2-cargo_lints |
max_upload_size | |
id | 395960 |
size | 15,068 |
cargo-lints
is a utility for running lints specified from files.
It is hard to share lint configuration in cargo workspace. Even more so as lint configuration in the form of:
$ cat src/lib.rs
#![warn(clippy::all)]
...
will not affect tests and benchmark binaries in ./benches/
and ./tests
directories.
For now cargo
and clippy
don't provide convinient way to specify lints enabled for workspace and that is
why it is handy to have a utility such as this one.
Install with:
$ cargo install --git https://github.com/soramitsu/iroha2-cargo_lints
You should set some lints in lints.toml
file:
$ cat lints.toml
#
# For all clippy lints please visit: https://rust-lang.github.io/rust-clippy/master/
#
deny = [
'clippy::all',
'clippy::cargo',
'clippy::nursery',
'clippy::pedantic',
]
allow = [
'clippy::enum_glob_use',
]
After that you can run:
$ cargo lint fmt
to format the toml file.
$ cargo lint clippy
to run clippy (you don't have to have lints.toml
file - in that case it will simply run cargo clippy
).
On the top level you can supply -f
option:
$ cargo lints -f custom_lints.toml clippy
Also all options after cargo lints clippy
are forwarded to clippy:
$ cargo lints clippy --tests --benches --all-features --all