diff options
author | Warner Losh <imp@FreeBSD.org> | 2024-02-02 05:50:19 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2024-02-02 05:50:19 +0000 |
commit | 0949b237bb901255cc418498b91edfe497131579 (patch) | |
tree | c4dace8754dfcdb50ceb526a70f208e2695fef84 /tools | |
parent | 2723c7ffb7f729a1d3f7c59e7db48b0edf3d30a6 (diff) | |
download | src-0949b237bb901255cc418498b91edfe497131579.tar.gz src-0949b237bb901255cc418498b91edfe497131579.zip |
checkstyle9.pl: Add --github to output for github workflows
If you add "::error file=foo/bar.c:line=123:" before the error message,
it will appear inline.
Sponsored by: Netflix
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/build/checkstyle9.pl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/build/checkstyle9.pl b/tools/build/checkstyle9.pl index 8b30baa10fc9..8fe9b9f94da1 100755 --- a/tools/build/checkstyle9.pl +++ b/tools/build/checkstyle9.pl @@ -25,6 +25,7 @@ my $chk_patch = undef; my $chk_branch = undef; my $tst_only; my $emacs = 0; +my $github = 0; my $terse = 0; my $file = undef; my $color = "auto"; @@ -91,6 +92,7 @@ GetOptions( 'patch!' => \$chk_patch, 'branch!' => \$chk_branch, 'emacs!' => \$emacs, + 'github!' => \$github, 'terse!' => \$terse, 'f|file!' => \$file, 'strict!' => \$no_warnings, @@ -1395,6 +1397,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); $here = "#$linenr: " if (!$file); $here = "#$realline: " if ($file); |