Skip to content

Commit

Permalink
fix(clang-tools-extra/**.py): fix comparison to None
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
e-kwsm committed May 31, 2024
1 parent 435e5c1 commit 0f57e39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ bool IdentifierNamingCheck::isParamInMainLikeFunction(
if (!IsIntType(FDecl->parameters()[0]->getType()))
return false;
MainType Type = IsCharPtrPtr(FDecl->parameters()[1]->getType());
if (Type == None)
if (Type is None)
return false;
if (FDecl->getNumParams() == 3 &&
IsCharPtrPtr(FDecl->parameters()[2]->getType()) != Type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0f57e39

Please sign in to comment.