[PATCH] D141463: [clang-tidy] Improve rename_check.py

Carlos Galvez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 11 00:22:06 PST 2023


carlosgalvezp added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/rename_check.py:97
 def getListOfFiles(clang_tidy_path):
-  files = glob.glob(os.path.join(clang_tidy_path, '*'))
-  for dirname in files:
-    if os.path.isdir(dirname):
-      files += glob.glob(os.path.join(dirname, '*'))
+  files = glob.glob(os.path.join(clang_tidy_path, '**'), recursive=True)
   files += glob.glob(os.path.join(clang_tidy_path, '..', 'test',
----------------
ccotter wrote:
> carlosgalvezp wrote:
> > Why is this change needed? I'd expect only line 99 to be needed to fix moving the test.
> Ah, it's not needed, but I thought it was a bit cleaner to have both the globs take the same approach and be recursive, avoiding the for-loop over the subdirectories.
Ah yes I see it now, yes it's good to keep the consistency, thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141463/new/

https://reviews.llvm.org/D141463



More information about the cfe-commits mailing list