Skip to content

Commit

Permalink
Merge pull request #1054 from sphinx-contrib/move-linting-into-its-ow…
Browse files Browse the repository at this point in the history
…n-workflow

.github: move linting jobs into their own workflow
  • Loading branch information
jdknight authored Oct 14, 2024
2 parents bb463b9 + d1c86d0 commit ffd9387
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 11 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ on:
- '.github/workflows/build.yml'
- 'sphinxcontrib/**'
- 'tests/**'
- '.pylintrc'
- 'MANIFEST.in'
- 'pyproject.toml'
- 'requirements_dev.txt'
- 'ruff.toml'
- 'tox.ini'
pull_request:
branches:
Expand All @@ -24,11 +22,9 @@ on:
- '.github/workflows/build.yml'
- 'sphinxcontrib/**'
- 'tests/**'
- '.pylintrc'
- 'MANIFEST.in'
- 'pyproject.toml'
- 'requirements_dev.txt'
- 'ruff.toml'
- 'tox.ini'

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

# linting/other
# - any OS, using most recent interpreter
- { os: ubuntu-latest, python: "3.12", toxenv: ruff, cache: ~/.cache/pip }
- { os: ubuntu-latest, python: "3.12", toxenv: pylint, cache: ~/.cache/pip }
- { os: ubuntu-latest, python: "3.12", toxenv: mypy, cache: ~/.cache/pip }

steps:
- uses: actions/checkout@v4

Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Action which lints the implementation of this extension.

name: Lint

on:
push:
branches:
- main
paths:
- '.github/workflows/lint.yml'
- 'doc/conf.py'
- 'sphinxcontrib/**'
- 'tests/**'
- '.pylintrc'
- 'requirements_dev.txt'
- 'ruff.toml'
- 'tox.ini'
pull_request:
branches:
- main
paths:
- '.github/workflows/lint.yml'
- 'sphinxcontrib/**'
- 'tests/**'
- '.pylintrc'
- 'requirements_dev.txt'
- 'ruff.toml'
- 'tox.ini'
workflow_dispatch:

jobs:
lint:
name: ${{ matrix.toxenv }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- { toxenv: ruff }
- { toxenv: pylint }
- { toxenv: mypy }

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: "3"

- name: Cache pip
uses: actions/cache@v4
id: cache-pip
with:
path: ~/.cache/pip
key: lint-pip-${{ matrix.toxenv }}

- name: Install dependencies
run: python -m pip install --upgrade tox

- name: tox
env:
TOXENV: ${{ matrix.toxenv }}
run: tox
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
# disable hyphenatation
# disable justified text
# remove italics from links
# new page for each section
# new page for each section
# minimize spacing between admonitions
'preamble': r'''
\usepackage{datetime2}
Expand Down

0 comments on commit ffd9387

Please sign in to comment.