summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-10-30 17:38:16 +0100
committerDaniel Stenberg <daniel@haxx.se>2022-10-30 22:31:29 +0100
commit52cc4a85fd7e5265ba8ff0f08adf4858f6773a11 (patch)
tree42840cae8269d796f753587dcd493d36f7384dab /scripts
parentb8c302dcbae53a79a85b42b9acfabd392a8a530e (diff)
downloadcurl-52cc4a85fd7e5265ba8ff0f08adf4858f6773a11.tar.gz
style: use space after comment start and before comment end
/* like this */ /*not this*/ checksrc is updated accordingly Closes #9828
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checksrc.pl15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl
index 54cd30cd9..26634774e 100755
--- a/scripts/checksrc.pl
+++ b/scripts/checksrc.pl
@@ -91,6 +91,9 @@ my %warnings = (
'EMPTYLINEBRACE' => 'Empty line before the open brace',
'EQUALSNULL' => 'if/while comparison with == NULL',
'NOTEQUALSZERO', => 'if/while comparison with != 0',
+ 'INCLUDEDUP', => 'same file is included again',
+ 'COMMENTNOSPACESTART' => 'no space following /*',
+ 'COMMENTNOSPACEEND' => 'no space before */',
);
sub readskiplist {
@@ -424,6 +427,18 @@ sub scanfile {
$line, length($1), $file, $l, "Trailing whitespace");
}
+ # no space after comment start
+ if($l =~ /^(.*)\/\*\w/) {
+ checkwarn("COMMENTNOSPACESTART",
+ $line, length($1) + 2, $file, $l,
+ "Missing space after comment start");
+ }
+ # no space at comment end
+ if($l =~ /^(.*)\w\*\//) {
+ checkwarn("COMMENTNOSPACEEND",
+ $line, length($1) + 1, $file, $l,
+ "Missing space end comment end");
+ }
# ------------------------------------------------------------
# Above this marker, the checks were done on lines *including*
# comments