Skip to content

Commit f971578

Browse files
committed
rust: introduce .clippy.toml
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] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent e0fd043 commit f971578

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

.clippy.toml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# SPDX-License-Identifier: GPL-2.0

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ modules.order
102102
# We don't want to ignore the following even if they are dot-files
103103
#
104104
!.clang-format
105+
!.clippy.toml
105106
!.cocciconfig
106107
!.editorconfig
107108
!.get_maintainer.ignore

MAINTAINERS

+1
Original file line numberDiff line numberDiff line change
@@ -19922,6 +19922,7 @@ B: https://github.com/Rust-for-Linux/linux/issues
1992219922
C: zulip://rust-for-linux.zulipchat.com
1992319923
P: https://rust-for-linux.com/contributing
1992419924
T: git https://github.com/Rust-for-Linux/linux.git rust-next
19925+
F: .clippy.toml
1992519926
F: Documentation/rust/
1992619927
F: rust/
1992719928
F: samples/rust/

Makefile

+3
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)