From: Hridesh MG <hridesh699@gmail.com>
To: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org
Cc: "Hridesh MG" <hridesh699@gmail.com>,
"Andy Whitcroft" <apw@canonical.com>,
"Joe Perches" <joe@perches.com>,
"Dwaipayan Ray" <dwaipayanray1@gmail.com>,
"Lukas Bulwahn" <lukas.bulwahn@gmail.com>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Wedson Almeida Filho" <wedsonaf@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <benno.lossin@proton.me>,
"Andreas Hindborg" <a.hindborg@samsung.com>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>
Subject: [PATCH v3 2/2 RESEND] checkpatch: warn on empty rust doc comments
Date: Sun, 29 Sep 2024 16:45:24 +0530 [thread overview]
Message-ID: <bf6544faba2b53ce901b2e031f3d944babcc7018.1727606659.git.hridesh699@gmail.com> (raw)
In-Reply-To: <dbb63b5698aa507bbe3dec54b4458a3f151899d3.1727606659.git.hridesh699@gmail.com>
Add a check to warn if there are consecutive empty `///` lines in rust
files.
Suggested-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/1109
Signed-off-by: Hridesh MG <hridesh699@gmail.com>
---
No changes in v2, this is a new patch
No changes in v3
---
scripts/checkpatch.pl | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 39032224d504..c75bc3927bf6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3884,6 +3884,13 @@ sub process {
}
}
+# check for consecutive empty /// lines in .rs files
+ if ($realfile =~ /\.rs$/ &&
+ $rawline =~ /^\+\s*\/\/\/$/ && $prevrawline =~ /^\+\s*\/\/\/$/) {
+ WARN("RUST_DOC_EMPTY",
+ "avoid using consecutive empty rustdoc comments\n" . $herecurr);
+ }
+
# check for adding lines without a newline.
if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) {
if (WARN("MISSING_EOF_NEWLINE",
--
2.46.1
next prev parent reply other threads:[~2024-09-29 11:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-29 11:15 [PATCH v3 1/2 RESEND] rust: kernel: clean up empty `///` lines Hridesh MG
2024-09-29 11:15 ` Hridesh MG [this message]
2024-09-29 22:15 ` [PATCH v3 2/2 RESEND] checkpatch: warn on empty rust doc comments Trevor Gross
2024-09-30 2:41 ` Patrick Miller
2024-09-30 10:34 ` Hridesh MG
2024-09-30 10:44 ` Miguel Ojeda
2024-09-30 12:30 ` Hridesh MG
2024-10-02 2:17 ` Patrick Miller
2024-09-29 22:01 ` [PATCH v3 1/2 RESEND] rust: kernel: clean up empty `///` lines Trevor Gross
2024-09-30 7:44 ` Alice Ryhl
2024-09-30 8:49 ` Miguel Ojeda
2024-09-30 10:35 ` Hridesh MG
2024-09-30 11:47 ` Miguel Ojeda
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=bf6544faba2b53ce901b2e031f3d944babcc7018.1727606659.git.hridesh699@gmail.com \
--to=hridesh699@gmail.com \
--cc=a.hindborg@samsung.com \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=apw@canonical.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dwaipayanray1@gmail.com \
--cc=gary@garyguo.net \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
--cc=wedsonaf@gmail.com \
/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®