]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-103334: Ignore `Tools/c-analyzer/cpython/_parser.py` from `patchcheck` (GH-103335)
authorNikita Sobolev <mail@sobolevn.me>
Mon, 10 Apr 2023 14:58:48 +0000 (17:58 +0300)
committerGitHub <noreply@github.com>
Mon, 10 Apr 2023 14:58:48 +0000 (07:58 -0700)
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
Tools/c-analyzer/cpython/_parser.py
Tools/patchcheck/patchcheck.py

index acf30e2c4020b3c3e0a036aabf72c15ff00dc7e6..d82fb967297cae8f3fb94041ae58686c63651d76 100644 (file)
@@ -47,6 +47,7 @@ def clean_lines(text):
 '''
 
 # XXX Handle these.
+# Tab separated:
 EXCLUDED = clean_lines('''
 # @begin=conf@
 
index 44a6fb8c660cd29c44fa415f729ae9ac9c55ad28..fa3a43af6e604826b6ea3c3b1afe9f4505865882 100755 (executable)
@@ -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