Module clippy

Source
Expand description

Implementation of running clippy on the compiler, standard library and various tools.

This serves a double purpose:

  • The first is to run Clippy itself on in-tree code, in order to test and dogfood it.
  • The second is to actually lint the in-tree codebase on CI, with a hard-coded set of rules, which is performed by the x clippy ci command.

In order to prepare a build compiler for running clippy, use the prepare_compiler_for_check function. That prepares a compiler and a standard library for running Clippy. The second part (actually building Clippy) is performed inside Builder::cargo_clippy_cmd. It would be nice if this was more explicit, and we actually had to pass a prebuilt Clippy from the outside when running cargo clippy, but that would be (as usual) a massive undertaking/refactoring.

Macros§

lint_any 🔒

Structs§

Bootstrap
BuildHelper
BuildManifest
CI
Runs Clippy on in-tree sources of selected projects using in-tree CLippy.
CargoMiri
Clippy
CodegenGcc
CollectLicenseMetadata
Compiletest
CoverageDump
Jsondocck
Jsondoclint
LintConfig
LintDocs
LlvmBitcodeLinker
Miri
MiroptTestTools
OptDist
RemoteTestClient
RemoteTestServer
RustAnalyzer
RustInstaller
Rustc
Lints the compiler.
Rustdoc
Rustfmt
Std
TestFloatParse
Tidy

Constants§

IGNORED_RULES_FOR_STD_AND_RUSTC 🔒
Disable the most spammy clippy lints

Functions§

get_clippy_rules_in_order
We need to keep the order of the given clippy lint rules before passing them. Since clap doesn’t offer any useful interface for this purpose out of the box, we have to handle it manually.
lint_args 🔒