-
Notifications
You must be signed in to change notification settings - Fork 12
75 lines (62 loc) · 2.41 KB
/
Copy pathlint.yml
File metadata and controls
75 lines (62 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Lint Check
on:
schedule:
- cron: '0 0 * * *'
push:
branches:
- '*'
pull_request:
branches:
- '*'
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout CPython docs
uses: actions/checkout@v4
with:
repository: python/cpython
ref: v3.14.7
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install sphinx-lint and polib
run: pip install sphinx-lint polib
- name: Install gettext tools
run: sudo apt-get install -y gettext
- name: Setup virtual environment
run: make venv
working-directory: ./Doc
- name: Pin Sphinx to 9.1.0
# make venv may resolve an older Sphinx via requirements.txt; pin
# explicitly so we get the reordered-ref / translated-display-text
# i18n fixes (sphinx-doc/sphinx#14144). Bump this once #14162 lands
# upstream and re-check whether the suppression below is still needed.
run: ./venv/bin/pip install "sphinx==9.1.0"
working-directory: ./Doc
- name: Checkout translation files
uses: actions/checkout@v4
with:
path: Doc/locales/fa/LC_MESSAGES
- name: Setup problem matcher
uses: rffontenelle/sphinx-lint-problem-matcher@v1.0.0
# we have to disable trailing-whitespace on sphinx-lint for now
# see github.com/sphinx-contrib/sphinx-lint/issues/120
- name: Run sphinx-lint
run: sphinx-lint --disable trailing-whitespace
working-directory: Doc/locales/fa/LC_MESSAGES
- name: Check PO file validity
run: find . -name '*.po' -exec msgfmt --check {} \;
working-directory: Doc/locales/fa/LC_MESSAGES
- name: Check markup preservation
run: python3 scripts/check_markup.py .
working-directory: Doc/locales/fa/LC_MESSAGES
- name: Build documentation
# suppress_warnings for i18n.inconsistent_references: confirmed
# upstream false positive for translated display text / custom
# pending_xref directives (e.g. CPython's `.. availability::`),
# tracked and still open at sphinx-doc/sphinx#14162.
run: make -e SPHINXOPTS="--color -D language='fa' -D gettext_allow_fuzzy_translations=1 -D suppress_warnings=i18n.inconsistent_references -W --keep-going" html
working-directory: ./Doc