[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250419222505.9009-1-contact@arnaud-lcm.com>
Date: Sun, 20 Apr 2025 00:25:05 +0200
From: Arnaud Lecomte <contact@...aud-lcm.com>
To: Andy Whitcroft <apw@...onical.com>,
Joe Perches <joe@...ches.com>,
Dwaipayan Ray <dwaipayanray1@...il.com>,
Lukas Bulwahn <lukas.bulwahn@...il.com>,
Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>
Cc: linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org,
llvm@...ts.linux.dev,
contact@...aud-lcm.com,
skhan@...uxfoundation.org
Subject: [PATCH 2/2] checkpatch.pl: add `--fix` support for `//` comments on
private Rust items
Extend the Rust private item documentation checker (added in the previous
patch) to support automatic fixes when the `--fix` option is enabled.
Signed-off-by: Arnaud Lecomte <contact@...aud-lcm.com>
---
scripts/checkpatch.pl | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 7ef658a70bfc..ce3ba9af6da7 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2992,9 +2992,11 @@ sub process {
next if $comment =~ m@^\s*[[:punct:]]{2,}@;
my $line_issue = $i - 3;
- WARN("POSSIBLE_MISSING_RUST_DOC",
+ if(WARN("POSSIBLE_MISSING_RUST_DOC",
"Consider using `///` for private item documentation (line $line_issue)\n" .
- "$here\n$comment_line");
+ "$here\n$comment_line") && $fix) {
+ $fixed[$i - 1] =~ s/^\+(\/\/)/+$1\//;
+ }
}
}
}
--
2.43.0
Powered by blists - more mailing lists