Closes #22663: patchcheck: only modify text files under Doc/
diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py
index 418dd26..eda21b9 100755
--- a/Tools/scripts/patchcheck.py
+++ b/Tools/scripts/patchcheck.py
@@ -157,7 +157,8 @@
     file_paths = changed_files()
     python_files = [fn for fn in file_paths if fn.endswith('.py')]
     c_files = [fn for fn in file_paths if fn.endswith(('.c', '.h'))]
-    doc_files = [fn for fn in file_paths if fn.startswith('Doc')]
+    doc_files = [fn for fn in file_paths if fn.startswith('Doc') and
+                 fn.endswith(('.rst', '.inc'))]
     misc_files = {os.path.join('Misc', 'ACKS'), os.path.join('Misc', 'NEWS')}\
             & set(file_paths)
     # PEP 8 whitespace rules enforcement.