Skip to content

modularize Rust lints and add RUST_UNWRAP check

Jason Hall lkml rust-for-linux 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v9 Latest2 patches 7 repliesIn review
  2. v82 patches 1 replySuperseded
  3. v71 patch 1 replySuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v61 patch1 replySuperseded
v51 patch3 repliesSuperseded

Patches in v9 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2scripts: checkpatch: move Rust-specific lints to separate fileMAINTAINERS scripts/checkpatch.pl scripts/rust_checkpatch.pl+36 -00 replies
2/2scripts: checkpatch: add RUST_UNWRAP lintscripts/rust_checkpatch.pl+15 -13 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v9 yet.

Read the v9 thread

Cover letter [PATCH v9 0/2] modularize Rust lints and add RUST_UNWRAP check

This series moves Rust-specific linting logic into a separate file to prevent further growth of the main scripts/checkpatch.pl script and introduces a new lint to enforce safety standards.

The first patch creates the infrastructure for scripts/rust_checkpatch.pl and adds a conditional loading hook in the main checkpatch script. It also updates the MAINTAINERS file to track this new file.

The second patch introduces the RUST_UNWRAP lint, which warns against the use of .unwrap() and .expect() unless they are accompanied by a '// PANIC:' justification comment.

Jason Hall (2):
scripts: checkpatch: move Rust-specific lints to separate file
scripts: checkpatch: add RUST_UNWRAP lint

 MAINTAINERS                |  6 ++++++
 scripts/checkpatch.pl      | 14 ++++++++++++++
 scripts/rust_checkpatch.pl | 30 ++++++++++++++++++++++++++++++
 3 files changed, 50 insertions(+)
 create mode 100644 scripts/rust_checkpatch.pl
Signature · 1 line
2.43.0