[clang-tools-extra] 7c8a8bd - [clang-tidy] fix(clang-tools-extra/**.py): fix comparison to None (#94013)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 10 11:16:28 PDT 2024


Author: Eisuke Kawashima
Date: 2024-06-10T20:16:25+02:00
New Revision: 7c8a8bdc3a555e531e79af6ea9a60eb30c41475d

URL: https://github.com/llvm/llvm-project/commit/7c8a8bdc3a555e531e79af6ea9a60eb30c41475d
DIFF: https://github.com/llvm/llvm-project/commit/7c8a8bdc3a555e531e79af6ea9a60eb30c41475d.diff

LOG: [clang-tidy] fix(clang-tools-extra/**.py): fix comparison to None (#94013)

from PEP8
(https://peps.python.org/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be done with is or
is not, never the equality operators.

Added: 
    

Modified: 
    clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py b/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py
index 6545a3906fa50..53ecb60dec539 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py
+++ b/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py
@@ -47,7 +47,7 @@ def get_checkers(checkers_td, checkers_rst):
         parent_package_ = package["ParentPackage"]
         hidden = (checker["Hidden"] != 0) or (package["Hidden"] != 0)
 
-        while parent_package_ != None:
+        while parent_package_ is not None:
             parent_package = table_entries[parent_package_["def"]]
             checker_package_prefix = (
                 parent_package["PackageName"] + "." + checker_package_prefix


        


More information about the cfe-commits mailing list