Lines Matching refs:file

11 # This software is licensed as described in the file COPYING, which
17 # furnished to do so, under the terms of the COPYING file.
37 my $file;
69 'COPYRIGHT' => 'file missing a copyright statement',
77 'INCLUDEDUP', => 'same file is included again',
85 'OPENCOMMENT' => 'file ended with a /* comment still "open"',
152 my ($name, $num, $col, $file, $line, $msg, $error) = @_;
172 enable_warn($name, $num, $file, $line);
195 print "$file:$num:$col: $w: $msg ($name)\n";
204 $file = shift @ARGV;
206 while(defined $file) {
208 if($file =~ /-D(.*)/) {
210 $file = shift @ARGV;
213 elsif($file =~ /-W(.*)/) {
215 $file = shift @ARGV;
218 elsif($file =~ /-A(.+)/) {
220 $file = shift @ARGV;
223 elsif($file =~ /-i([1-9])/) {
225 $file = shift @ARGV;
228 elsif($file =~ /-m([0-9]+)/) {
230 $file = shift @ARGV;
233 elsif($file =~ /^(-h|--help)/) {
234 undef $file;
241 if(!$file) {
245 print " -D[DIR] Directory to prepend file names\n";
247 print " -W[file] Skip the given file - ignore all its flaws\n";
269 if("$wlist" !~ / $file /) {
270 my $fullname = $file;
271 $fullname = "$dir/$file" if ($fullname !~ '^\.?\.?/');
274 $file = shift @ARGV;
276 } while($file);
296 my ($file) = @_;
300 length($_)+11, $file,
308 my ($what, $line, $file, $l) = @_;
313 $line, length($what) + 11, $file, $l,
321 my ($cmd, $line, $file, $l) = @_;
346 $line, 0, $file, $l,
351 $line, 0, $file, $l,
361 enable_warn($what, $line, $file, $l);
365 $line, 0, $file, $l,
378 my ($file) = @_;
386 open(my $R, '<', $file) || die "failed to open $file";
391 checksrc_clear(); # for file based ignores
403 checksrc($cmd, $line, $file, $l)
408 $file = $2;
438 checkwarn("LONGLINE", $line, length($l), $file, $l,
444 $line, length($1), $file, $l, "Contains TAB character", 1);
449 $line, length($1), $file, $l, "Trailing whitespace");
455 $line, length($1) + 2, $file, $l,
461 $line, length($1) + 1, $file, $l,
510 $line, length($1), $file, $l, "\/\/ comment");
517 $line, length($1), $file, $l, "duplicated include");
550 checkwarn("SPACEBEFOREPAREN", $line, length($leading)+length($word), $file, $l,
559 $file, $l, "we prefer !variable instead of \"== NULL\" comparisons");
567 $file, $l, "we prefer if(rc) instead of \"rc != 0\" comparisons");
572 checkwarn("DOBRACE", $line, length($1) + 2, $file, $l, "one space after do before brace");
576 checkwarn("BRACEWHILE", $line, length($1) + 2, $file, $l, "one space between brace and while");
584 $line, $pos+1, $file, $l,
602 $line, length($l)-length($postparen), $file, $l,
609 $line, length($1)+1, $file, $l,
617 $line, length($1)+1, $file, $l,
624 $line, length($1)+1, $file, $l,
634 checkwarn("RETURNNOSPACE", $line, length($1)+6, $file, $l,
645 checkwarn("SIZEOFNOPAREN", $line, length($1)+6, $file, $l,
677 checkwarn("COMMANOSPACE", $line, length($pref)+1, $file, $l,
685 $line, length($1), $file, $l, "else after closing brace on same line");
690 $line, length($1)+1, $file, $l, "missing space after close paren");
695 $line, 0, $file, $l, "empty line before open brace");
701 $line, length($1), $file, $ol, "no space before semicolon");
707 $line, length($1), $file, $ol, "no space before colon of switch label");
712 $line, length($1), $file, $ol, "no space before label");
726 $line, length($1), $file, $ol,
736 $line, length($1), $file, $ol,
748 $line, length($1), $file, $ol,
756 $line, length($1), $file, $ol,
765 $line, length($1), $file, $ol,
774 $line, length($1), $file, $ol, "badly placed open brace");
788 checkwarn("INDENTATION", $line, length($1), $file, $ol,
814 checkwarn("INDENTATION", $line, length($1), $file, $ol,
824 $line, length($1), $file, $ol,
830 $line, length($1)-1, $file, $ol,
842 $line, length($l)-1, $file, $ol,
850 $line, length($1)+1, $file, $ol,
856 $line, length($1)+1, $file, $ol,
863 $line, length($1)+1, $file, $ol,
869 $line, length($1)+1, $file, $ol,
876 $line, length($1)+1, $file, $ol,
883 $line, length($1)+1, $file, $ol,
889 $line, length($1)+1, $file, $ol,
899 $line, length($1)+1, $file, $ol,
910 $line, length($1), $file, $ol,
922 checkwarn("COPYRIGHT", 1, 0, $file, "", "Missing copyright statement", 1);
937 # (and it would fail every file on January 1st).
943 # the file was last committed (and thus edited to some degree).
947 # if the file is modified, assume commit year this year
948 if(`git status -s -- "$file"` =~ /^ [MARCU]/) {
953 my $grl = `git rev-list --max-count=1 --min-parents=1 --timestamp HEAD -- "$file"`;
963 $file, $copyright[0]{code},
970 checkwarn("OPENCOMMENT", 1, 0, $file, "", "Missing closing comment", 1);
973 checksrc_endoffile($file);