3 Runs clippy on a fixed set of crates read from
4 `lintcheck/lintcheck_crates.toml` and saves logs of the lint warnings into the
5 repo. We can then check the diff and spot new or disappearing warnings.
7 From the repo root, run:
10 cargo run --target-dir lintcheck/target --manifest-path lintcheck/Cargo.toml
19 By default the logs will be saved into
20 `lintcheck-logs/lintcheck_crates_logs.txt`.
22 You can set a custom sources.toml by adding `--crates-toml custom.toml` or using
23 `LINTCHECK_TOML="custom.toml"` where `custom.toml` must be a relative path from
26 The results will then be saved to `lintcheck-logs/custom_logs.toml`.
28 ### Configuring the Crate Sources
30 The sources to check are saved in a `toml` file. There are three types of
36 bitflags = {name = "bitflags", versions = ['1.2.1']}
38 Requires a "name" and one or multiple "versions" to be checked.
42 puffin = {name = "puffin", git_url = "https://github.com/EmbarkStudios/puffin", git_hash = "02dd4a3"}
44 Requires a name, the url to the repo and unique identifier of a commit,
45 branch or tag which is checked out before linting. There is no way to always
46 check `HEAD` because that would lead to changing lint-results as the repo
47 would get updated. If `git_url` or `git_hash` is missing, an error will be
52 clippy = {name = "clippy", path = "/home/user/clippy"}
54 For when you want to add a repository that is not published yet.
56 #### Command Line Options (optional)
59 bitflags = {name = "bitflags", versions = ['1.2.1'], options = ['-Wclippy::pedantic', '-Wclippy::cargo']}
62 It is possible to specify command line options for each crate. This makes it
63 possible to only check a crate for certain lint groups. If no options are
64 specified, the lint groups `clippy::all`, `clippy::pedantic`, and
65 `clippy::cargo` are checked. If an empty array is specified only `clippy::all`
68 **Note:** `-Wclippy::all` is always enabled by default, unless `-Aclippy::all`
69 is explicitly specified in the options.
72 You can run `cargo lintcheck --fix` which will run Clippy with `--fix` and
73 print a warning if Clippy's suggestions fail to apply (if the resulting code does not build).
74 This lets us spot bad suggestions or false positives automatically in some cases.
76 Please note that the target dir should be cleaned afterwards since clippy will modify
77 the downloaded sources which can lead to unexpected results when running lintcheck again afterwards.
80 You can run `cargo lintcheck --recursive` to also run Clippy on the dependencies
81 of the crates listed in the crates source `.toml`. e.g. adding `rand 0.8.5`
82 would also lint `rand_core`, `rand_chacha`, etc.
84 Particularly slow crates in the dependency graph can be ignored using
89 cargo = {name = "cargo", versions = ['0.64.0']}
93 "unicode-normalization",