[clang-tools-extra] [clang-tidy] Add type annotations to add_new_check.py, fix minor bug (PR #106801)

Nicolas van Kempen via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 31 10:40:47 PDT 2024


================
@@ -754,7 +765,7 @@ def main():
         language_restrict = (
             f"%(lang)s.{cpp_language_to_requirements.get(args.standard, 'CPlusPlus')}"
         )
-    elif language in ["objc", "objc++"]:
+    else:  # "objc" or "objc++"
         language_restrict = "%(lang)s.ObjC"
----------------
nicovank wrote:

Other languages technically can not get to this point because of `choices = language_to_extension.keys()` which only contains `["c", "c++", "objc", "objc++"]`, but I agree keeping the condition is more robust in case this lists change.

https://github.com/llvm/llvm-project/pull/106801


More information about the cfe-commits mailing list