ci(infra): fix

This commit is contained in:
Mason Daugherty
2025-10-09 17:18:53 -04:00
parent d5e76150fd
commit 08a1e48d46
2 changed files with 6 additions and 5 deletions

View File

@@ -13,9 +13,9 @@ from typing import List, Tuple
# RST patterns to detect (pattern, description)
RST_PATTERNS: List[Tuple[str, str]] = [
(r"\.\.\s+code-block::", "RST code-block directive (use ```language instead)"),
(r":func:`", "RST :func: role (use regular Markdown links)"),
(r":class:`", "RST :class: role (use regular Markdown links)"),
(r":meth:`", "RST :meth: role (use regular Markdown links)"),
(r":func:", "RST :func: role (use regular Markdown links)"),
(r":class:", "RST :class: role (use regular Markdown links)"),
(r":meth:", "RST :meth: role (use regular Markdown links)"),
(
r"\.\.\s+deprecated::",
"RST deprecated directive (use !!! deprecated admonition)",
@@ -29,7 +29,7 @@ RST_PATTERNS: List[Tuple[str, str]] = [
(r"\.\.\s+warning::", "RST warning directive (use !!! warning admonition)"),
(r"\.\.\s+important::", "RST important directive (use !!! important admonition)"),
(r"\.\.\s+note::", "RST note directive (use !!! note admonition)"),
(r":private:`", "RST :private: role (prefix name with underscore instead)"),
(r":private:", "RST :private: role (prefix name with underscore instead)"),
(r"`[^`]+<[^>]+>`__", "RST anonymous hyperlink (use [text](link) instead)"),
(r"`[^`]+<[^>]+>`_", "RST named hyperlink (use [text](link) instead)"),
]

View File

@@ -40,13 +40,14 @@ jobs:
uses: tj-actions/changed-files@v47
with:
files: "**/*.py"
files_ignore: ".github/scripts/check_rst_syntax.py"
- name: "🔍 Check for RST Syntax in Changed Files"
if: steps.changed-files.outputs.any_changed == 'true'
run: |
echo "Checking the following files for RST syntax:"
echo "${{ steps.changed-files.outputs.all_changed_files }}"
python scripts/check_rst_syntax.py ${{ steps.changed-files.outputs.all_changed_files }}
python .github/scripts/check_rst_syntax.py ${{ steps.changed-files.outputs.all_changed_files }}
- name: "✅ No RST Syntax Detected"
if: steps.changed-files.outputs.any_changed != 'true'