-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean consecutive empty ///
lines and implement a checkpatch.pl
check for it
#1109
Comments
Hi there! Would love to give this a go. Thanks for creating these for us beginners :) |
Remove unnecessary empty `\\\` lines in the rust docs. Also add linebreaks in kernel::block::mq::Request to fix formatting Suggested-by: Miguel Ojeda <ojeda@kernel.org> Link: Rust-for-Linux#1109 Signed-off-by: hridesh <hridesh699@gmail.com>
You're welcome Hridesh! https://lore.kernel.org/rust-for-linux/20240909161749.147076-1-hridesh699@gmail.com/ |
Remove unnecessary empty `///` lines in the rust docs. Suggested-by: Miguel Ojeda <ojeda@kernel.org> Link: Rust-for-Linux#1109 Signed-off-by: Hridesh MG <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: Rust-for-Linux#1109 Signed-off-by: Hridesh MG <hridesh699@gmail.com>
Wouldn't it be interesting to add a check whether a line has actually been added or modified? This would reduce checking for non-relevant lines Something like that? if ($realfile =~ /\.rs$/ && $line_type eq 'added') {
if ($rawline =~ /^\+\s*\/\/\/$/ && $prevrawline =~ /^\+\s*\/\/\/$/) {
WARN("RUST_DOC_EMPTY",
"avoid using consecutive empty rustdoc comments\n" . $herecurr);
}
}
``` |
This is already included in the regex that matches |
Remove unnecessary empty `///` lines in the rust docs. Suggested-by: Miguel Ojeda <ojeda@kernel.org> Link: Rust-for-Linux#1109 Signed-off-by: Hridesh MG <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: Rust-for-Linux#1109 Signed-off-by: Hridesh MG <hridesh699@gmail.com>
Thanks for your feedback! |
Remove unnecessary empty `///` lines in the rust docs. Suggested-by: Miguel Ojeda <ojeda@kernel.org> Link: Rust-for-Linux#1109 Signed-off-by: Hridesh MG <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: Rust-for-Linux#1109 Signed-off-by: Hridesh MG <hridesh699@gmail.com>
Clean up consecutive empty
///
lines and implement acheckpatch.pl
check for it. These should be two different patches.At the time of writing, there are a couple instances at
rust/kernel/rbtree.rs
andrust/kernel/block/mq/request.rs
.Please note that the
checkpatch.pl
maintainers will need to agree to the change.This requires submitting a proper patch to the LKML and the Rust for Linux mailing list. Please recall to test your changes (including generating the documentation if changed, running the Rust doctests if changed, etc.), to use a proper title for the commit, to sign your commit under the Developer's Certificate of Origin and to add a
Suggested-by:
tag and aLink:
tag to this issue. Please see https://rust-for-linux.com/contributing for details.Please take this issue only if you are new to the kernel development process and you would like to use it as a test to submit your first patch to the kernel. Please do not take it if you do not plan to make other contributions to the kernel.
The text was updated successfully, but these errors were encountered: