]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
clang-tidy: Add markdown summary
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 23 Oct 2023 12:46:16 +0000 (14:46 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 30 Oct 2023 08:15:01 +0000 (09:15 +0100)
.github/scripts/clang-tidy.py

index 4fafc03e168ce1e6d2ef7bd5794bc71ef59526ae..d7867c830154995bcb472966d484691ac3bea6b2 100755 (executable)
@@ -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