Skip to content

Commit de789d4

Browse files
ojedajfvogel
authored andcommitted
rust: introduce .clippy.toml
commit 7d56786 upstream. Some Clippy lints can be configured/tweaked. We will use these knobs to our advantage in later commits. This is done via a configuration file, `.clippy.toml` [1]. The file is currently unstable. This may be a problem in the future, but we can adapt as needed. In addition, we proposed adding Clippy to the Rust CI's RFL job [2], so we should be able to catch issues pre-merge. Thus introduce the file. Link: https://doc.rust-lang.org/clippy/configuration.html [1] Link: rust-lang/rust#128928 [2] Reviewed-by: Alice Ryhl <[email protected]> Reviewed-by: Trevor Gross <[email protected]> Tested-by: Gary Guo <[email protected]> Reviewed-by: Gary Guo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 503e18c448bff08281a5f7e955335892f144cd36) Signed-off-by: Jack Vogel <[email protected]>
1 parent 6cf3f55 commit de789d4

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

.clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# SPDX-License-Identifier: GPL-2.0

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ modules.order
105105
# We don't want to ignore the following even if they are dot-files
106106
#
107107
!.clang-format
108+
!.clippy.toml
108109
!.cocciconfig
109110
!.editorconfig
110111
!.get_maintainer.ignore

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20175,6 +20175,7 @@ B: https://github.com/Rust-for-Linux/linux/issues
2017520175
C: zulip://rust-for-linux.zulipchat.com
2017620176
P: https://rust-for-linux.com/contributing
2017720177
T: git https://github.com/Rust-for-Linux/linux.git rust-next
20178+
F: .clippy.toml
2017820179
F: Documentation/rust/
2017920180
F: rust/
2018020181
F: samples/rust/

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,9 @@ endif
590590
# Allows the usage of unstable features in stable compilers.
591591
export RUSTC_BOOTSTRAP := 1
592592

593+
# Allows finding `.clippy.toml` in out-of-srctree builds.
594+
export CLIPPY_CONF_DIR := $(srctree)
595+
593596
export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC HOSTPKG_CONFIG
594597
export RUSTC RUSTDOC RUSTFMT RUSTC_OR_CLIPPY_QUIET RUSTC_OR_CLIPPY BINDGEN
595598
export HOSTRUSTC KBUILD_HOSTRUSTFLAGS

0 commit comments

Comments
 (0)