[PATCH] D126134: [clang-tidy] Improve add_new_check.py to recognize more checks
Richard via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 23 08:17:04 PDT 2022
LegalizeAdulthood added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/add_new_check.py:335-336
+ module_file = get_module_filename(module_path, module_name)
+ if not os.path.isfile(module_file):
+ return ''
+ with io.open(module_file, 'r') as f:
----------------
LegalizeAdulthood wrote:
> aaron.ballman wrote:
> > Do we have to check this or can we rely on open failing because it's not a file? (It tripped my psychic TOCTOU sensor.)
> If we don't check here, then it throws an exception when attempting to open the file.
Also, I was following the existing pattern in this file `:)`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126134/new/
https://reviews.llvm.org/D126134
More information about the cfe-commits
mailing list