Skip to content

Commit

Permalink
Merge pull request #1036 from adamtheturtle/sphinx-lint
Browse files Browse the repository at this point in the history
Add sphinx-lint
  • Loading branch information
adamtheturtle authored Jan 5, 2025
2 parents 2b2e2c2 + 97ff9aa commit 217b631
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 53 deletions.
117 changes: 64 additions & 53 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,38 @@
---
fail_fast: true

# We use system Python, with required dependencies specified in pyproject.toml.
# We therefore cannot use those dependencies in pre-commit CI.
ci:
skip:
- actionlint
- sphinx-lint
- check-manifest
- deptry
- doc8
- interrogate
- interrogate-docs
- mypy
- mypy-docs
- pylint
- pyproject-fmt-fix
- pyright
- pyright-docs
- pyright-verifytypes
- pyroma
- ruff-check-fix
- ruff-check-fix-docs
- ruff-format-fix
- ruff-format-fix-docs
- docformatter
- shellcheck
- shellcheck-docs
- shfmt
- shfmt-docs
- vulture
- vulture-docs
- yamlfix

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_install_hook_types: [pre-commit, pre-push, commit-msg]
Expand Down Expand Up @@ -40,44 +74,44 @@ repos:
language: python
pass_filenames: false
types_or: [yaml]
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: docformatter
name: docformatter
entry: uv run --extra=dev -m docformatter --in-place
language: python
types_or: [python]
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: shellcheck
name: shellcheck
entry: uv run --extra=dev shellcheck --shell=bash
language: python
types_or: [shell]
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: shellcheck-docs
name: shellcheck-docs
entry: uv run --extra=dev doccmd --language=shell --language=console --command="shellcheck
--shell=bash"
language: python
types_or: [markdown, rst]
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: shfmt
name: shfmt
entry: shfmt --write --space-redirects --indent=4
language: python
types_or: [shell]
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: shfmt-docs
name: shfmt-docs
entry: uv run --extra=dev doccmd --language=shell --language=console --skip-marker=shfmt
--no-pad-file --command="shfmt --write --space-redirects --indent=4"
language: python
types_or: [markdown, rst]
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: mypy
name: mypy
Expand All @@ -86,7 +120,7 @@ repos:
language: python
types_or: [python, toml]
pass_filenames: false
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: mypy-docs
name: mypy-docs
Expand All @@ -101,7 +135,7 @@ repos:
entry: uv run --extra=dev -m check_manifest
language: python
pass_filenames: false
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: pyright
name: pyright
Expand All @@ -110,7 +144,7 @@ repos:
language: python
types_or: [python, toml]
pass_filenames: false
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: pyright-docs
name: pyright-docs
Expand All @@ -128,95 +162,95 @@ repos:
language: python
pass_filenames: false
types_or: [python]
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: vulture
name: vulture
entry: uv run --extra=dev -m vulture .
language: python
types_or: [python]
pass_filenames: false
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: vulture-docs
name: vulture docs
entry: uv run --extra=dev doccmd --language=python --command="vulture"
language: python
types_or: [markdown, rst]
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: pyroma
name: pyroma
entry: uv run --extra=dev -m pyroma --min 10 .
language: python
pass_filenames: false
types_or: [toml]
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: deptry
name: deptry
entry: uv run --extra=dev -m deptry src/
language: python
pass_filenames: false
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: pylint
name: pylint
entry: uv run --extra=dev -m pylint src/ tests/
language: python
stages: [manual]
pass_filenames: false
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: ruff-check-fix
name: Ruff check fix
entry: uv run --extra=dev -m ruff check --fix
language: python
types_or: [python]
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: ruff-check-fix-docs
name: Ruff check fix docs
entry: uv run --extra=dev doccmd --language=python --command="ruff check --fix"
language: python
types_or: [markdown, rst]
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: ruff-format-fix
name: Ruff format
entry: uv run --extra=dev -m ruff format
language: python
types_or: [python]
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: ruff-format-fix-docs
name: Ruff format docs
entry: uv run --extra=dev doccmd --language=python --no-pad-file --command="ruff
format"
language: python
types_or: [markdown, rst]
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: doc8
name: doc8
entry: uv run --extra=dev -m doc8
language: python
types_or: [rst]
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: interrogate
name: interrogate
entry: uv run --extra=dev -m interrogate
language: python
types_or: [python]
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: interrogate-docs
name: interrogate docs
entry: uv run --extra=dev doccmd --language=python --command="interrogate"
language: python
types_or: [markdown, rst]
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

- id: pyproject-fmt-fix
name: pyproject-fmt
Expand All @@ -230,35 +264,12 @@ repos:
entry: uv run --extra=dev yamlfix
language: python
types_or: [yaml]
additional_dependencies: [uv==0.4.25]
additional_dependencies: [uv==0.5.14]

# We use system Python, with required dependencies specified in pyproject.toml.
# We therefore cannot use those dependencies in pre-commit CI.
ci:
skip:
- actionlint
- check-manifest
- deptry
- doc8
- interrogate
- interrogate-docs
- mypy
- mypy-docs
- pylint
- pyproject-fmt-fix
- pyright
- pyright-docs
- pyright-verifytypes
- pyroma
- ruff-check-fix
- ruff-check-fix-docs
- ruff-format-fix
- ruff-format-fix-docs
- docformatter
- shellcheck
- shellcheck-docs
- shfmt
- shfmt-docs
- vulture
- vulture-docs
- yamlfix
- id: sphinx-lint
name: sphinx-lint
entry: uv run --extra=dev sphinx-lint --enable=all --disable=line-too-long
README.rst CHANGELOG.rst
language: python
types_or: [rst]
additional_dependencies: [uv==0.5.14]
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ optional-dependencies.dev = [
"shfmt-py==3.7.0.1",
# We use `sphinx.testing`.
"sphinx[test]==8.1.3",
"sphinx-lint==1.0.0",
"sphinx-toolbox==3.8.1",
"types-docutils==0.21.0.20241128",
"vulture==2.14",
Expand Down

0 comments on commit 217b631

Please sign in to comment.