From: Remi Gacogne Date: Mon, 23 Oct 2023 12:46:16 +0000 (+0200) Subject: clang-tidy: Add markdown summary X-Git-Tag: rec-5.0.0-beta1~23^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=522415b1223dd46b8466b3aa86e2dac63ff99473;p=thirdparty%2Fpdns.git clang-tidy: Add markdown summary --- diff --git a/.github/scripts/clang-tidy.py b/.github/scripts/clang-tidy.py index 4fafc03e16..d7867c8301 100755 --- a/.github/scripts/clang-tidy.py +++ b/.github/scripts/clang-tidy.py @@ -45,6 +45,12 @@ def main(): print("No diagnostics or warnings produced by clang-tidy") return 0 + gh_step_summary = os.getenv('GITHUB_STEP_SUMMARY') + if gh_step_summary: + # Print Markdown summary + summaryFp = open(gh_step_summary, 'a', encoding='utf-8') + print('### clang-tidy summary', file=summaryFp) + fixes = fixes["Diagnostics"] have_warnings = False for fix in fixes: @@ -90,6 +96,9 @@ def main(): # User-friendly printout print(f"{level}: {relative_filename}:{line}: {message} ({name})") + if gh_step_summary: + print(f'- **{relative_filename}:{line}** {message} (`{name}`)', file=summaryFp) + have_warnings = True return 1 if have_warnings else 0