Skip to content

Clean consecutive empty /// lines and implement a checkpatch.pl check for it #1109

Open

Description

@ojeda

Clean up consecutive empty /// lines and implement a checkpatch.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 and rust/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 a Link: 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.

Activity

  1. added
    • docsRelated to `Documentation/rust/`, `samples/`, generated docs, doctests, typos...
    on Aug 31, 2024
  2. hrideshmg commented on Sep 8, 2024

    @hrideshmg

    Hi there! Would love to give this a go. Thanks for creating these for us beginners :)

  3. ojeda commented on Sep 10, 2024

    @ojeda
    MemberAuthor
  4. leonardotomascostadasilva commented on Sep 15, 2024

    @leonardotomascostadasilva

    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);
        }
    }
    ```
  5. hrideshmg commented on Sep 16, 2024

    @hrideshmg

    This is already included in the regex that matches $rawline; it will only match lines in the diff that begin with a '+', implying that a line was added.

  6. leonardotomascostadasilva commented on Sep 20, 2024

    @leonardotomascostadasilva

    This is already included in the regex that matches $rawline; it will only match lines in the diff that begin with a '+', implying that a line was added.

    Thanks for your feedback!

  7. added
    easyExpected to be an easy issue to resolve.
    on Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    easyExpected to be an easy issue to resolve.good first issueGood for newcomers• docsRelated to `Documentation/rust/`, `samples/`, generated docs, doctests, typos...

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions