diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2023-04-10 14:58:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-10 14:58:48 (GMT) |
commit | 40db5c65b7ca4e784613b6122106a92576aba2d6 (patch) | |
tree | fdc06c15e66d47634b30b61bd49785b249160744 /Tools/patchcheck | |
parent | dc604a8c58af748ce25aee1af36b6521a3592fa5 (diff) | |
download | cpython-40db5c65b7ca4e784613b6122106a92576aba2d6.zip cpython-40db5c65b7ca4e784613b6122106a92576aba2d6.tar.gz cpython-40db5c65b7ca4e784613b6122106a92576aba2d6.tar.bz2 |
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
Diffstat (limited to 'Tools/patchcheck')
-rwxr-xr-x | Tools/patchcheck/patchcheck.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Tools/patchcheck/patchcheck.py b/Tools/patchcheck/patchcheck.py index 44a6fb8..fa3a43a 100755 --- a/Tools/patchcheck/patchcheck.py +++ b/Tools/patchcheck/patchcheck.py @@ -170,12 +170,24 @@ def report_modified_files(file_paths): return "\n".join(lines) +#: Python files that have tabs by design: +_PYTHON_FILES_WITH_TABS = frozenset({ + 'Tools/c-analyzer/cpython/_parser.py', +}) + + @status("Fixing Python file whitespace", info=report_modified_files) def normalize_whitespace(file_paths): """Make sure that the whitespace for .py files have been normalized.""" reindent.makebackup = False # No need to create backups. - fixed = [path for path in file_paths if path.endswith('.py') and - reindent.check(os.path.join(SRCDIR, path))] + fixed = [ + path for path in file_paths + if ( + path.endswith('.py') + and path not in _PYTHON_FILES_WITH_TABS + and reindent.check(os.path.join(SRCDIR, path)) + ) + ] return fixed |