Skip to content

Commit 86e5b7d

Browse files
committed
Add sphinx-lint and run it in CI
1 parent 52cf741 commit 86e5b7d

File tree

4 files changed

+348
-24
lines changed

4 files changed

+348
-24
lines changed

.github/sphinx-problem-matcher.json

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
11
{
22
"problemMatcher": [
33
{
4-
"owner": "sphinx",
4+
"owner": "sphinx-build",
55
"pattern": [
66
{
7-
"regexp": "^([^:]+):(\\d+): (WARNING: )?(.+)$",
7+
"regexp": "^([^:]+):\\s(.+)$",
8+
"file": 1,
9+
"message": 2
10+
},
11+
{
12+
"regexp": "^([^:]+):(\\d+):\\s(.+)$",
13+
"file": 1,
14+
"line": 2,
15+
"message": 3
16+
}
17+
]
18+
},
19+
{
20+
"owner": "sphinx-lint",
21+
"pattern": [
22+
{
23+
"regexp": "^([^:]+):(\\d+):\\s+(.*)\\s\\(([a-z-]+)\\)$",
824
"file": 1,
925
"line": 2,
10-
"message": 4
26+
"message": 3,
27+
"code": 4
1128
}
1229
]
1330
}

.github/workflows/lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ jobs:
130130
run: echo "::add-matcher::.github/sphinx-problem-matcher.json"
131131

132132
- name: Build docs
133-
run: |-
134-
poe docs |& tee /tmp/output
135-
# fail the job if there are issues
136-
grep -q " WARNING:" /tmp/output && exit 1 || exit 0
133+
run: poe docs -e SPHINXOPTS=--fail-on-warning
134+
135+
- name: Lint docs
136+
run: poetry run sphinx-lint --enable all $(git ls-files docs)

0 commit comments

Comments
 (0)