Skip to content

Commit 40db5c6

Browse files
authored
gh-103334: Ignore Tools/c-analyzer/cpython/_parser.py from patchcheck (GH-103335)
I've also added a small comment to `Tools/c-analyzer/cpython/_parser.py` to trigger the `patchcheck` CI. It must pass now. Automerge-Triggered-By: GH:ericsnowcurrently
1 parent dc604a8 commit 40db5c6

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

Tools/c-analyzer/cpython/_parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def clean_lines(text):
4747
'''
4848

4949
# XXX Handle these.
50+
# Tab separated:
5051
EXCLUDED = clean_lines('''
5152
# @begin=conf@
5253

Tools/patchcheck/patchcheck.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,24 @@ def report_modified_files(file_paths):
170170
return "\n".join(lines)
171171

172172

173+
#: Python files that have tabs by design:
174+
_PYTHON_FILES_WITH_TABS = frozenset({
175+
'Tools/c-analyzer/cpython/_parser.py',
176+
})
177+
178+
173179
@status("Fixing Python file whitespace", info=report_modified_files)
174180
def normalize_whitespace(file_paths):
175181
"""Make sure that the whitespace for .py files have been normalized."""
176182
reindent.makebackup = False # No need to create backups.
177-
fixed = [path for path in file_paths if path.endswith('.py') and
178-
reindent.check(os.path.join(SRCDIR, path))]
183+
fixed = [
184+
path for path in file_paths
185+
if (
186+
path.endswith('.py')
187+
and path not in _PYTHON_FILES_WITH_TABS
188+
and reindent.check(os.path.join(SRCDIR, path))
189+
)
190+
]
179191
return fixed
180192

181193

0 commit comments

Comments
 (0)