git: 22d12caad69e - main - checkstyle9.pl: Differentiate errors and warnings

From: Warner Losh <imp_at_FreeBSD.org>
Date: Fri, 02 Feb 2024 07:25:18 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=22d12caad69ef2d8e1c76671b44fd5493490acb7

commit 22d12caad69ef2d8e1c76671b44fd5493490acb7
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-02-02 07:23:43 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-02-02 07:24:32 +0000

    checkstyle9.pl: Differentiate errors and warnings
    
    Use ::error and ::warning as appropriate to give better meaning to the
    messages.
    
    Sponsored by:           Netflix
---
 tools/build/checkstyle9.pl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/build/checkstyle9.pl b/tools/build/checkstyle9.pl
index dd6eb624e0b4..df9ec2bbd7c1 100755
--- a/tools/build/checkstyle9.pl
+++ b/tools/build/checkstyle9.pl
@@ -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);