config-clang-tidy: better handle wildcards
Some repositories had category wildcards; handle those better:
- Remove category disables since we already disable global.
- Allow category enables to act as a single check.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ibe320717331c0627439c54846465786b9316f186
diff --git a/tools/config-clang-tidy b/tools/config-clang-tidy
index dbb0b54..9f81c4e 100755
--- a/tools/config-clang-tidy
+++ b/tools/config-clang-tidy
@@ -145,7 +145,11 @@
return result
for item in s.split():
item = item.replace(",", "")
- if "-*" in item:
+ # Ignore global wildcard because we handle that specifically.
+ if item.startswith("-*"):
+ continue
+ # Drop category wildcard disables since we already use a global wildcard.
+ if item.startswith("-") and "*" in item:
continue
if item.startswith("-"):
result[item[1:]] = False