Skip to contentSkip to conversation

checkpatch: Check .m, .build, .hx, .json and .plist

PATCH Superseded Akihiko Odaki 2 participants 3 messages Jan 11, 2025 – Jan 18, 2025 Checkpatch

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 checkpatch: Check .m, .build, .hx, .json and .plist

Check more text files: Objective-C, Meson, "hx", JSON, and property list.

---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
index 06d07e6c225c..94ac5230b48f 100755
@@ -12,7 +12,7 @@ use Term::ANSIColor qw(:constants);
 my $P = $0;
 $P =~ s@.*/@@g;
 
-our $SrcFile    = qr{\.(?:(h|c)(\.inc)?|cpp|s|S|pl|py|sh)$};
+our $SrcFile = qr{\.(?:(h|c|m)(\.inc)?|cpp|s|S|pl|py|sh|build|hx|json|plist)$};
 
 my $V = '0.31';
 

---
base-commit: 38d0939b86e2eef6f6a622c6f1f7befda0146595
change-id: 20250111-checkpatch-26ea9d86c76a

Best regards,

Signature · 1 line
Akihiko Odaki <[email protected]>
#1 lore raw
Quoted 2 lines · Akihiko Odaki

Check more text files: Objective-C, Meson, "hx", JSON, and property list.

Objective-C looks sensible at least.

For the others though, I'm wondering if any of the current checks performed are liable to cause false positives for these files ?

Quoted 24 lines
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -2
index 06d07e6c225c..94ac5230b48f 100755
@@ -12,7 +12,7 @@ use Term::ANSIColor qw(:constants);
 my $P = $0;
 $P =~ s@.*/@@g;
 
-our $SrcFile    = qr{\.(?:(h|c)(\.inc)?|cpp|s|S|pl|py|sh)$};
+our $SrcFile = qr{\.(?:(h|c|m)(\.inc)?|cpp|s|S|pl|py|sh|build|hx|json|plist)$};
 
 my $V = '0.31';
 
 
---

base-commit: 38d0939b86e2eef6f6a622c6f1f7befda0146595
change-id: 20250111-checkpatch-26ea9d86c76a

Quoted 4 lines

Best regards,

Signature · 1 line
Akihiko Odaki <[email protected]>

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#2 lore raw
Quoted 8 lines · Daniel P. Berrangé
Quoted 2 lines · Akihiko Odaki

Check more text files: Objective-C, Meson, "hx", JSON, and property list.

Objective-C looks sensible at least.

For the others though, I'm wondering if any of the current checks performed are liable to cause false positives for these files ?

The process subroutine says $SrcFile will enable the following checks:
- 90 column limit; exempt URLs, if no other words on line
- check for spaces before a quoted newline
- check for adding lines without a newline.
- check for RCS/CVS revision markers
- tabs are only allowed in assembly source code, and in some scripts we imported from other projects.

They look valid for most text files, if not all.

Quoted 33 lines
Quoted 26 lines
---
  scripts/checkpatch.pl | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -2
index 06d07e6c225c..94ac5230b48f 100755
@@ -12,7 +12,7 @@ use Term::ANSIColor qw(:constants);
  my $P = $0;
  $P =~ s@.*/@@g;
 
-our $SrcFile    = qr{\.(?:(h|c)(\.inc)?|cpp|s|S|pl|py|sh)$};
+our $SrcFile = qr{\.(?:(h|c|m)(\.inc)?|cpp|s|S|pl|py|sh|build|hx|json|plist)$};
 
  my $V = '0.31';
 
 
---

base-commit: 38d0939b86e2eef6f6a622c6f1f7befda0146595
change-id: 20250111-checkpatch-26ea9d86c76a

Quoted 4 lines

Best regards,

Signature · 1 line
Akihiko Odaki <[email protected]>

With regards,
Daniel