style: use space after comment start and before comment end

/* like this */

/*not this*/

checksrc is updated accordingly

Closes #9828
This commit is contained in:
Daniel Stenberg 2022-10-30 17:38:16 +01:00
parent b8c302dcba
commit 52cc4a85fd
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
42 changed files with 152 additions and 147 deletions

View file

@ -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