1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +00:00

checkstyle9.pl: Differentiate errors and warnings

Use ::error and ::warning as appropriate to give better meaning to the
messages.

Sponsored by:		Netflix
This commit is contained in:
Warner Losh 2024-02-02 00:23:43 -07:00
parent ac9abe93e8
commit 22d12caad6

View File

@ -1177,6 +1177,8 @@ sub report {
my $output = '';
my $do_color = $color && !$github;
$output .= BOLD if $do_color;
$output .= "::error " if $github && $level eq 'ERROR';
$output .= "::warning " if $github && $level eq 'WARNING';
$output .= $prefix;
$output .= RED if $do_color && $level eq 'ERROR';
$output .= MAGENTA if $do_color && $level eq 'WARNING';
@ -1399,8 +1401,8 @@ sub process {
#make up the handle for any error we report on this line
$prefix = "$filename:$realline: " if ($emacs && $file);
$prefix = "$filename:$linenr: " if ($emacs && !$file);
$prefix = "::error file=$filename,line=$realline:\:" if ($github && $file);
$prefix = "::error file=$realfile,line=$linenr:\:" if ($github && !$file);
$prefix = "file=$filename,line=$realline:\:" if ($github && $file);
$prefix = "file=$realfile,line=$realline:\:" if ($github && !$file);
$here = "#$linenr: " if (!$file);
$here = "#$realline: " if ($file);