Skip to content

Commit e8cfd62

Browse files
ojedasmb49
authored andcommitted
rust: introduce .clippy.toml
BugLink: https://bugs.launchpad.net/bugs/2107437 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]> Signed-off-by: Noah Wager <[email protected]> Signed-off-by: Stefan Bader <[email protected]>
1 parent 8a7ab9c commit e8cfd62

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
@@ -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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19978,6 +19978,7 @@ B: https://github.com/Rust-for-Linux/linux/issues
1997819978
C: zulip://rust-for-linux.zulipchat.com
1997919979
P: https://rust-for-linux.com/contributing
1998019980
T: git https://github.com/Rust-for-Linux/linux.git rust-next
19981+
F: .clippy.toml
1998119982
F: Documentation/rust/
1998219983
F: rust/
1998319984
F: samples/rust/

Makefile

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

597+
# Allows finding `.clippy.toml` in out-of-srctree builds.
598+
export CLIPPY_CONF_DIR := $(srctree)
599+
597600
export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC HOSTPKG_CONFIG
598601
export RUSTC RUSTDOC RUSTFMT RUSTC_OR_CLIPPY_QUIET RUSTC_OR_CLIPPY BINDGEN
599602
export HOSTRUSTC KBUILD_HOSTRUSTFLAGS

0 commit comments

Comments
 (0)