[clang] fix(clang/**.py): fix comparison to True/False (PR #94038)
via cfe-commits
cfe-commits at lists.llvm.org
Fri May 31 13:08:40 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Eisuke Kawashima (e-kwsm)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/94038.diff
2 Files Affected:
- (modified) clang/tools/scan-build/bin/set-xcode-analyzer (+1-1)
- (modified) clang/utils/check_cfc/check_cfc.py (+2-2)
``````````diff
diff --git a/clang/tools/scan-build/bin/set-xcode-analyzer b/clang/tools/scan-build/bin/set-xcode-analyzer
index f8c3f775ef7de..8e4a5794594a6 100755
--- a/clang/tools/scan-build/bin/set-xcode-analyzer
+++ b/clang/tools/scan-build/bin/set-xcode-analyzer
@@ -107,7 +107,7 @@ def main():
foundSpec = True
ModifySpec(x, isBuiltinAnalyzer, path)
- if foundSpec == False:
+ if not foundSpec:
print "(-) No compiler configuration file was found. Xcode's analyzer has not been updated."
if __name__ == '__main__':
diff --git a/clang/utils/check_cfc/check_cfc.py b/clang/utils/check_cfc/check_cfc.py
index 27d732d91030c..8d42ec532bbb7 100755
--- a/clang/utils/check_cfc/check_cfc.py
+++ b/clang/utils/check_cfc/check_cfc.py
@@ -156,7 +156,7 @@ def get_output_file(args):
elif arg.startswith("-o"):
# Specified conjoined with -o
return arg[2:]
- assert grabnext == False
+ assert not grabnext
return None
@@ -182,7 +182,7 @@ def replace_output_file(args, new_name):
if replaceidx is None:
raise Exception
replacement = new_name
- if attached == True:
+ if attached:
replacement = "-o" + new_name
args[replaceidx] = replacement
return args
``````````
</details>
https://github.com/llvm/llvm-project/pull/94038
More information about the cfe-commits
mailing list