This revision was automatically updated to reflect the committed changes.
Closed by commit rG210b731c01b0: [clang-tidy] Fix minor bug in add_new_check.py
(authored by ccotter, committed by carlosgalvezp).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140772/new/
https://reviews.llvm.org/D140772
Files:
clang-tools-extra/clang-tidy/add_new_check.py
clang-tools-extra/docs/ReleaseNotes.rst
Index: clang-tools-extra/docs/ReleaseNotes.rst
===================================================================
--- clang-tools-extra/docs/ReleaseNotes.rst
+++ clang-tools-extra/docs/ReleaseNotes.rst
@@ -99,6 +99,9 @@
- Change to Python 3 in the shebang of `add_new_check.py` and
`rename_check.py`,
as the existing code is not compatible with Python 2.
+- Fix a minor bug in `add_new_check.py` to only traverse subdirectories
+ when updating the list of checks in the documentation.
+
New checks
^^^^^^^^^^
Index: clang-tools-extra/clang-tidy/add_new_check.py
===================================================================
--- clang-tools-extra/clang-tidy/add_new_check.py
+++ clang-tools-extra/clang-tidy/add_new_check.py
@@ -322,8 +322,7 @@
lines = f.readlines()
# Get all existing docs
doc_files = []
- for subdir in list(filter(lambda s: not s.endswith('.rst') and not
s.endswith('.py'),
- os.listdir(docs_dir))):
+ for subdir in filter(lambda s: os.path.isdir(os.path.join(docs_dir, s)),
os.listdir(docs_dir)):
for file in filter(lambda s: s.endswith('.rst'),
os.listdir(os.path.join(docs_dir, subdir))):
doc_files.append([subdir, file])
doc_files.sort()
Index: clang-tools-extra/docs/ReleaseNotes.rst
===================================================================
--- clang-tools-extra/docs/ReleaseNotes.rst
+++ clang-tools-extra/docs/ReleaseNotes.rst
@@ -99,6 +99,9 @@
- Change to Python 3 in the shebang of `add_new_check.py` and `rename_check.py`,
as the existing code is not compatible with Python 2.
+- Fix a minor bug in `add_new_check.py` to only traverse subdirectories
+ when updating the list of checks in the documentation.
+
New checks
^^^^^^^^^^
Index: clang-tools-extra/clang-tidy/add_new_check.py
===================================================================
--- clang-tools-extra/clang-tidy/add_new_check.py
+++ clang-tools-extra/clang-tidy/add_new_check.py
@@ -322,8 +322,7 @@
lines = f.readlines()
# Get all existing docs
doc_files = []
- for subdir in list(filter(lambda s: not s.endswith('.rst') and not s.endswith('.py'),
- os.listdir(docs_dir))):
+ for subdir in filter(lambda s: os.path.isdir(os.path.join(docs_dir, s)), os.listdir(docs_dir)):
for file in filter(lambda s: s.endswith('.rst'), os.listdir(os.path.join(docs_dir, subdir))):
doc_files.append([subdir, file])
doc_files.sort()
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits