Skip to content

Commit a664c70

Browse files
Copilotchrisjsewell
andcommitted
🔧 MAINTAIN: Add pre-commit and mypy tox envs, fix docs builder command
Co-authored-by: chrisjsewell <2997570+chrisjsewell@users.noreply.github.com>
1 parent e180b69 commit a664c70

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

‎AGENTS.md‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,23 @@ tox -e docs-clean
102102
# Build docs (incremental)
103103
tox -e docs-update
104104

105-
# Build with a specific builder (e.g., linkcheck)
106-
BUILDER=linkcheck tox -e docs-update
105+
# Build with a specific builder (e.g., linkcheck to validate external links)
106+
tox -e docs-update -- linkcheck
107107
```
108108

109109
### Code Quality
110110

111111
```bash
112-
# Run pre-commit hooks on all files
112+
# Run all pre-commit hooks (ruff, mypy, trailing whitespace, etc.)
113+
tox -e pre-commit
114+
115+
# Run pre-commit with specific hook
116+
tox -e pre-commit -- --all-files ruff
117+
118+
# Run mypy type checking
119+
tox -e mypy
120+
121+
# Run pre-commit hooks directly (if pre-commit is installed)
113122
pre-commit run --all-files
114123
```
115124

‎tox.ini‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,11 @@ allowlist_externals = rm
1919
commands =
2020
clean: rm -rf docs/_build
2121
sphinx-build -nW --keep-going -b {posargs:html} docs/ docs/_build/{posargs:html}
22+
23+
[testenv:pre-commit]
24+
deps = pre-commit
25+
commands = pre-commit run {posargs:--all-files}
26+
27+
[testenv:mypy]
28+
deps = mypy
29+
commands = mypy mdit_py_plugins {posargs}

0 commit comments

Comments
 (0)