Skip to content

Commit 1383572

Browse files
committed
scripts: checkpatch: enable language-independent checks for Rust
Include Rust in the "source code files" category, so that the language-independent tests are checked for Rust too, and teach `checkpatch` about the comment style for Rust files. This enables the malformed SPDX check, the misplaced SPDX license tag check, the long line checks, the lines without a newline check and the embedded filename check. Co-developed-by: Alex Gaynor <[email protected]> Signed-off-by: Alex Gaynor <[email protected]> Co-developed-by: Wedson Almeida Filho <[email protected]> Signed-off-by: Wedson Almeida Filho <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]>
1 parent d2af241 commit 1383572

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/checkpatch.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3615,7 +3615,7 @@ sub process {
36153615
my $comment = "";
36163616
if ($realfile =~ /\.(h|s|S)$/) {
36173617
$comment = '/*';
3618-
} elsif ($realfile =~ /\.(c|dts|dtsi)$/) {
3618+
} elsif ($realfile =~ /\.(c|rs|dts|dtsi)$/) {
36193619
$comment = '//';
36203620
} elsif (($checklicenseline == 2) || $realfile =~ /\.(sh|pl|py|awk|tc|yaml)$/) {
36213621
$comment = '#';
@@ -3663,7 +3663,7 @@ sub process {
36633663
}
36643664

36653665
# check we are in a valid source file if not then ignore this hunk
3666-
next if ($realfile !~ /\.(h|c|s|S|sh|dtsi|dts)$/);
3666+
next if ($realfile !~ /\.(h|c|rs|s|S|sh|dtsi|dts)$/);
36673667

36683668
# check for using SPDX-License-Identifier on the wrong line number
36693669
if ($realline != $checklicenseline &&

0 commit comments

Comments
 (0)