[PATCH] D152625: [clang-tidy] run-clang-tidy: forward warnings-as-errors argument

Piotr Zegar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 12 05:24:31 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG2499beeb5a3d: [clang-tidy] run-clang-tidy: forward warnings-as-errors argument (authored by indev29, committed by PiotrZSL).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152625/new/

https://reviews.llvm.org/D152625

Files:
  clang-tools-extra/clang-tidy/tool/run-clang-tidy.py


Index: clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
===================================================================
--- clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
+++ clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
@@ -105,6 +105,7 @@
     line_filter,
     use_color,
     plugins,
+    warnings_as_errors,
 ):
     """Gets a command line for clang-tidy."""
     start = [clang_tidy_binary]
@@ -141,6 +142,8 @@
         start.append("-config=" + config)
     for plugin in plugins:
         start.append("-load=" + plugin)
+    if warnings_as_errors:
+        start.append("--warnings-as-errors=" + warnings_as_errors)
     start.append(f)
     return start
 
@@ -224,6 +227,7 @@
             args.line_filter,
             args.use_color,
             args.plugins,
+            args.warnings_as_errors,
         )
 
         proc = subprocess.Popen(
@@ -363,6 +367,11 @@
         default=[],
         help="Load the specified plugin in clang-tidy.",
     )
+    parser.add_argument(
+        "-warnings-as-errors",
+        default=None,
+        help="Upgrades warnings to errors. Same format as " "'-checks'",
+    )
     args = parser.parse_args()
 
     db_path = "compile_commands.json"
@@ -399,6 +408,7 @@
             args.line_filter,
             args.use_color,
             args.plugins,
+            args.warnings_as_errors,
         )
         invocation.append("-list-checks")
         invocation.append("-")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152625.530471.patch
Type: text/x-patch
Size: 1450 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230612/bf21ebe1/attachment.bin>


More information about the cfe-commits mailing list