Lines Matching defs:report
32 # -l | --sloppy-bodylen do not report function body length > 200
33 # -s | --sloppy-space do not report whitespace nits
34 # -c | --sloppy-comment do not report indentation of comments
42 # -h | --sloppy-hang when checking hanging indentation, do not report
47 # -e | --eol-comment report needless intermediate multiple consecutive spaces also before end-of-line comments
317 sub report {
374 report("indent = $count != $comment_indent within multi-line comment")
378 report("indent = ".($count + $tweak)." != $comment_indent at end of multi-line comment")
412 report("intra-line comment indent = $count != $ref_indent") if $in_comment == 0;
413 report("multi-line comment indent = $count != $ref_indent") if $in_comment < 0;
419 # do not report same indentation as on the line before (potentially due to same violations)
422 # do not report indentation at normal indentation level while hanging expression indent would be required
425 # do not report if contents have been shifted left of nested expr indent (but not as far as stmt indent)
431 report("indent = $count != $ref_indent for $ref_desc".
497 report("unexpected '$c' @ ".($in_paren_expr ? "(expr)" : "expr"));
503 report("unexpected '}'");
513 report("code after (expr)")
526 report("unclosed '$symbol' in $position");
551 report(($2 eq "\x09" ? "TAB" : $2 eq "\x0D" ? "CR " : $2 =~ m/[\x00-\x1F]/ ? "non-printable"
556 report("trailing whitespace at EOL") if m/\s\n$/;
575 report("multi-line string literal not terminated by '\"' and trailing '\' is missing")
600 report("missing space or '*' after leading '*' in multi-line comment") if $cmt_text =~ m|^[^*\s/$self_test_exception]|;
602 report("missing leading '*' in multi-line comment");
609 report("missing space or '*' before '*/'") if $head =~ m/[^*\s]$/;
610 report("missing space (or ',', ';', ')', '}', ']') after '*/'") if $tail =~ m/^[^\s,;)}\]]/; # no space or ,;)}] after '*/'
613 report("unexpected '*/' outside comment");
616 report("text before '*/' in multi-line comment") if ($head =~ m/[^*\s]/); # non-SPC before '*/'
633 report("missing space before '/*'")
635 report("missing space, '*', or '!' after '/*$opt_minus'") if $tail =~ m/^[^\s*!$self_test_exception]/;
638 report("unexpected '/*' inside multi-line comment");
640 report("unexpected '/*' inside intra-line comment") if $1 =~ /\/\*/;
647 report("text after '/*' in multi-line comment")
680 report("line length = $len > ".MAX_LINE_LENGTH);
685 report("'//' end-of-line comment"); # the '//' comment style is not allowed for C90
703 report("preprocessor directive within multi-line directive");
707 report("indent = $count != 0 for '#'") if $count != 0;
708 report("'#$preproc_directive' with constant condition")
713 report("unexpected '#$preproc_directive' according to '#if' nesting");
716 report("'#if' nesting indent = $space_count != $preproc_if_nesting") if $space_count != $preproc_if_nesting;
767 report(extra_SPC($intra_line)) if $intra_line =~ m/\s\s\S/ && eof
770 report(extra_SPC($intra_line)) if $intra_line =~ m/\s\s\S/;
774 report("missing space before '$2'")
800 $intra_line =~ s/(=\s*)\{ /"$1@ "/eg; # do not report {SPC in initializers such as ' = { 0, };'
801 $intra_line =~ s/, \};/, @;/g; # do not report SPC} in initializers such as ' = { 0, };'
802 report("space before '$1'") if $intra_line =~ m/[\w)\]]\s+(\+\+|--)/; # postfix ++/-- with preceding space
803 report("space after '$1'") if $intra_line =~ m/(\+\+|--)\s+[a-zA-Z_(]/; # prefix ++/-- with following space
805 report("space before '$1'") if $intra_line =~ m/\s(\.|->)/; # '.' or '->' with preceding space
806 report("space after '$1'") if $intra_line =~ m/(\.|->)\s/; # '.' or '->' with following space
808 report("space before '$1'") if $intra_line =~ m/[^:)]\s+(;)/; # space before ';' but not after ':' or ')' # note that
810 report("space before '$1'") if $intra_line =~ m/\s([,)\]])/; # space before ,)]
811 report("space after '$1'") if $intra_line =~ m/([(\[~!])\s/; # space after ([~!
812 report("space after '$1'") if $intra_line =~ m/(defined)\s/; # space after 'defined'
813 report("missing space before '$1'") if $intra_line =~ m/\S([|\/%<>^\?])/; # |/%<>^? without preceding space
815 report("missing space before binary '$2'") if $intra_line =~ m/([^\s{()\[e])([+\-])/; # '+'/'-' without preceding space or {()[e
817 report("missing space before binary '$1'") if $intra_line =~ m/[^\s{()\[*!]([*])/; # '*' without preceding space or {()[*!
818 report("missing space before binary '$1'") if $intra_line =~ m/[^\s{()\[]([&])/; # '&' without preceding space or {()[
819 report("missing space after ternary '$1'") if $intra_line =~ m/(:)[^\s\d]/; # ':' without following space or digit
820 report("missing space after '$1'") if $intra_line =~ m/([,;=|\/%<>^\?])\S/; # ,;=|/%<>^? without following space
821 report("missing space after binary '$1'") if $intra_line=~m/[^{(\[]([*])[^\sa-zA-Z_(),*]/;# '*' w/o space or \w(),* after
823 report("missing space after binary '$1'") if $intra_line=~m/([&])[^\sa-zA-Z_(]/; # '&' w/o following space or \w(
825 report("missing space after binary '$1'") if $intra_line=~m/[^{(\[]([+\-])[^\s\d(]/; # +/- w/o following space or \d(
827 report("missing space after '$2'") if $intra_line =~ m/(^|\W)(if|while|for|switch|case)[^\w\s]/; # kw w/o SPC
828 report("missing space after '$2'") if $intra_line =~ m/(^|\W)(return)[^\w\s;]/; # return w/o SPC or ';'
829 report("space after function/macro name")
833 report("missing space before '{'") if $intra_line =~ m/[^\s{(\[]\{/; # '{' without preceding space or {([
834 report("missing space after '}'") if $intra_line =~ m/\}[^\s,;\])}]/; # '}' without following space or ,;])}
861 report("code before '}'");
871 report("unexpected 'else'");
884 report("code after '}'") unless $tail eq "" || $tail =~ m/(else|while|OSSL_TRACE_END)(\W|$)/;
893 report("code before '}'");
914 report("code after $keyword: ") if $2 =~ /:.*[^\s@].*$/;
969 report("more than one stmt") if !m/(^|\W)for(\W.*|$)/ && # no 'for' - TODO improve matching
981 # TODO do not report cases where a further else branch
987 report("single-letter name '$2'") if (m/(^|.*\W)([IO])(\W.*|$)/); # single-letter name 'I' or 'O' # maybe re-add 'l'?
989 report("constant on LHS of '$3'")
993 # TODO report needless use of parentheses, while
1036 report("code before '$mid'") if $code_before;
1037 report("code after '$mid'" ) if $tail =~ m/[^\s\@{]/# trailing non-whitespace non-comment non-'{' (non-'\')
1131 report("'{' not at line start") if length($head) != $preproc_offset && $head =~ m/\)\s*/; # at end of function definition header
1143 report("code after '{'") if $tail=~ m/[^\s\@]/ && # trailing non-whitespace non-comment (non-'\')
1154 report("'{' not on same line as preceding '$mid'") if !$brace_after;
1162 report("missing '{' on same line after '} else'");
1176 report("'while' not on same line as preceding '}'");
1187 report("'else' not on same line as preceding '}'");
1189 report("missing '}' on same line before 'else ... {'") if $brace_after;
1192 report("missing '{' on same line after '} else'") if $brace_before && !$brace_after;
1223 report("leading ".($1 eq "" ? "blank" :"whitespace")." line") if $line == 1 && !$sloppy_SPC;
1227 report("$linediff blank lines before") if $linediff > 1 && !$sloppy_SPC;
1250 report(($1 eq "\n" ? "blank line" : $2 ne "" ? "'\\'" : "whitespace")." at EOF")
1253 # report unclosed expression-level nesting
1266 # final summary report @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@