Skip to content

Commit

Permalink
ci: implement markdownlint pre-commit hook (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer authored Nov 24, 2020
1 parent 0797999 commit b05cb5e
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ root = true
[*]
end_of_line = lf
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
trim_trailing_whitespace = true

[Makefile]
indent_style = tab
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,11 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install .[precommit]
sudo npm install -g cspell markdownlint-cli pyright
sudo npm install -g cspell pyright
- name: Perform style checks
run: pre-commit run -a
- name: Check spelling
run: cspell $(git ls-files)
- name: Lint Markdown files
run: markdownlint .
- name: Run pyright
run: pyright

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install .[precommit]
sudo npm install -g cspell markdownlint-cli pyright
sudo npm install -g cspell pyright
- name: Perform style checks
run: pre-commit run -a
- name: Check spelling
run: cspell $(git ls-files)
- name: Lint Markdown files
run: markdownlint .
- name: Run pyright
run: pyright
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.25.0
hooks:
- id: markdownlint

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.2.0
hooks:
Expand Down
2 changes: 2 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
],
"ignorePaths": [
"*.bib",
"*.root",
"*.rst_t",
"*.svg",
"*particle*.*ml",
".gitignore",
".gitpod.*",
".pre-commit-config.yaml",
Expand Down
2 changes: 1 addition & 1 deletion docs/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ If you have Node.js (`npm`) on your system, you can run a few additional
checks. Install these packages as follows (possibly with administrator rights):

```bash
npm install -g cspell markdownlint-cli pyright
npm install -g cspell pyright
```

Note that [`pyright`](https://github.com/microsoft/pyright) requires Node.js
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ lint =
precommit =
%(format)s
%(lint)s
pre-commit==2.8.2
pre-commit==2.9.0
tox =
%(precommit)s
sphinx-autobuild==2020.9.1
Expand Down
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ commands =
--open-browser \
docs/ docs/_build/html


[testenv:linkcheck]
description =
Check external links in the documentation (requires internet connection)
Expand All @@ -54,7 +53,6 @@ commands =
mypy . # run separately because of potential caching problems
pre-commit run {posargs} -a
- bash -ec "cspell $(git ls-files)"
- bash -ec "markdownlint . --ignore docs/_build"

[flake8]
application-import-names =
Expand Down

0 comments on commit b05cb5e

Please sign in to comment.