From: Arnaud Lecomte <contact@arnaud-lcm.com>
To: joe@perches.com
Cc: a.hindborg@kernel.org, alex.gaynor@gmail.com,
aliceryhl@google.com, apw@canonical.com,
bjorn3_gh@protonmail.com, boqun.feng@gmail.com, dakr@kernel.org,
dwaipayanray1@gmail.com, gary@garyguo.net,
linux-kernel@vger.kernel.org, lossin@kernel.org,
lukas.bulwahn@gmail.com, ojeda@kernel.org,
rust-for-linux@vger.kernel.org, tmgross@umich.edu,
Arnaud Lecomte <contact@arnaud-lcm.com>
Subject: [PATCH 3/3] checkpatch.pl: --fix support for `//` comments rust private items
Date: Tue, 29 Jul 2025 21:04:02 +0100 [thread overview]
Message-ID: <20250729200402.35241-1-contact@arnaud-lcm.com> (raw)
In-Reply-To: <20250729200158.35050-1-contact@arnaud-lcm.com>
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@arnaud-lcm.com>
---
scripts/checkpatch.pl | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index ac403d270eb4..d01d993d8a9f 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3069,6 +3069,9 @@ sub process {
for (my $i = $start_l; $i <= $end_l; $i++) {
next unless $rawlines[$i - 1] =~ m@^\+//([^/].*)$@;
push @comment_lines, $rawlines[$i - 1];
+ if($fix) {
+ $fixed[$i - 1] =~ s/^\+(\/\/)/+$1\//;
+ }
}
my $formatted_comments = join("", map {
s/\n$//;
--
2.43.0
next prev parent reply other threads:[~2025-07-29 20:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-29 19:56 [PATCH 1/3] checkpatch.pl: Add warning for // comments on private Rust items Arnaud Lecomte
2025-07-29 20:01 ` [PATCH 2/3] checkpatch.pl: warn about " Arnaud Lecomte
2025-07-29 20:04 ` Arnaud Lecomte [this message]
2025-07-29 20:23 ` [PATCH 1/3] checkpatch.pl: Add warning for " Miguel Ojeda
2025-07-29 20:29 ` Lecomte, Arnaud
2025-08-13 15:32 ` Lecomte, Arnaud
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250729200402.35241-1-contact@arnaud-lcm.com \
--to=contact@arnaud-lcm.com \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=apw@canonical.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=dwaipayanray1@gmail.com \
--cc=gary@garyguo.net \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=lukas.bulwahn@gmail.com \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®