Skip to content

Commit ffd9387

Browse files
authored
Merge pull request #1054 from sphinx-contrib/move-linting-into-its-own-workflow
.github: move linting jobs into their own workflow
2 parents bb463b9 + d1c86d0 commit ffd9387

File tree

3 files changed

+64
-11
lines changed

3 files changed

+64
-11
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ on:
1111
- '.github/workflows/build.yml'
1212
- 'sphinxcontrib/**'
1313
- 'tests/**'
14-
- '.pylintrc'
1514
- 'MANIFEST.in'
1615
- 'pyproject.toml'
1716
- 'requirements_dev.txt'
18-
- 'ruff.toml'
1917
- 'tox.ini'
2018
pull_request:
2119
branches:
@@ -24,11 +22,9 @@ on:
2422
- '.github/workflows/build.yml'
2523
- 'sphinxcontrib/**'
2624
- 'tests/**'
27-
- '.pylintrc'
2825
- 'MANIFEST.in'
2926
- 'pyproject.toml'
3027
- 'requirements_dev.txt'
31-
- 'ruff.toml'
3228
- 'tox.ini'
3329

3430
jobs:
@@ -63,12 +59,6 @@ jobs:
6359
- { os: macos-latest, python: "3.12", toxenv: py312-sphinx81, cache: ~/Library/Caches/pip }
6460
- { os: windows-latest, python: "3.12", toxenv: py312-sphinx81, cache: ~\AppData\Local\pip\Cache }
6561

66-
# linting/other
67-
# - any OS, using most recent interpreter
68-
- { os: ubuntu-latest, python: "3.12", toxenv: ruff, cache: ~/.cache/pip }
69-
- { os: ubuntu-latest, python: "3.12", toxenv: pylint, cache: ~/.cache/pip }
70-
- { os: ubuntu-latest, python: "3.12", toxenv: mypy, cache: ~/.cache/pip }
71-
7262
steps:
7363
- uses: actions/checkout@v4
7464

.github/workflows/lint.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Action which lints the implementation of this extension.
2+
3+
name: Lint
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
paths:
10+
- '.github/workflows/lint.yml'
11+
- 'doc/conf.py'
12+
- 'sphinxcontrib/**'
13+
- 'tests/**'
14+
- '.pylintrc'
15+
- 'requirements_dev.txt'
16+
- 'ruff.toml'
17+
- 'tox.ini'
18+
pull_request:
19+
branches:
20+
- main
21+
paths:
22+
- '.github/workflows/lint.yml'
23+
- 'sphinxcontrib/**'
24+
- 'tests/**'
25+
- '.pylintrc'
26+
- 'requirements_dev.txt'
27+
- 'ruff.toml'
28+
- 'tox.ini'
29+
workflow_dispatch:
30+
31+
jobs:
32+
lint:
33+
name: ${{ matrix.toxenv }}
34+
runs-on: ubuntu-latest
35+
strategy:
36+
matrix:
37+
include:
38+
- { toxenv: ruff }
39+
- { toxenv: pylint }
40+
- { toxenv: mypy }
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- name: Set up Python ${{ matrix.python }}
46+
uses: actions/setup-python@v5
47+
with:
48+
python-version: "3"
49+
50+
- name: Cache pip
51+
uses: actions/cache@v4
52+
id: cache-pip
53+
with:
54+
path: ~/.cache/pip
55+
key: lint-pip-${{ matrix.toxenv }}
56+
57+
- name: Install dependencies
58+
run: python -m pip install --upgrade tox
59+
60+
- name: tox
61+
env:
62+
TOXENV: ${{ matrix.toxenv }}
63+
run: tox

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
# disable hyphenatation
109109
# disable justified text
110110
# remove italics from links
111-
# new page for each section
111+
# new page for each section
112112
# minimize spacing between admonitions
113113
'preamble': r'''
114114
\usepackage{datetime2}

0 commit comments

Comments
 (0)