[PATCH] D152625: run-clang-tidy: forward warnings-as-errors argument
Maxim Kolesnikov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Jun 10 10:40:19 PDT 2023
indev29 created this revision.
indev29 added reviewers: cfe-commits, njames93.
Herald added subscribers: PiotrZSL, carlosgalvezp.
Herald added a project: All.
indev29 requested review of this revision.
Herald added a project: clang-tools-extra.
Forward `warnings-as-errors` argument to clang-tidy.
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.530229.patch
Type: text/x-patch
Size: 1450 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230610/24a7775d/attachment.bin>
More information about the cfe-commits
mailing list