diff options
author | Daniel Stenberg <daniel@haxx.se> | 2022-10-30 17:38:16 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2022-10-30 22:31:29 +0100 |
commit | 52cc4a85fd7e5265ba8ff0f08adf4858f6773a11 (patch) | |
tree | 42840cae8269d796f753587dcd493d36f7384dab /scripts | |
parent | b8c302dcbae53a79a85b42b9acfabd392a8a530e (diff) | |
download | curl-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-x | scripts/checksrc.pl | 15 |
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 |