Skip to content

Commit e80a576

Browse files
make lint fails if any linting step fails
1 parent 430b3d3 commit e80a576

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ check: doctest
2525
pytest -vv tests/test_*.py
2626

2727
lint:
28-
ruff check --exit-zero setup.py tests/*.py src/libsemigroups_pybind11/*.py docs/source/*.py
29-
pylint --exit-zero setup.py tests/*.py src/libsemigroups_pybind11/*.py src/libsemigroups_pybind11/**/*.py
30-
cpplint src/*.hpp src/*.cpp
28+
etc/make-lint.sh
3129

3230
coverage:
3331
@coverage run --source . --omit="tests/*" -m pytest tests/test_*.py

etc/make-lint.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
if [[ $# -ne 0 ]]; then
4+
bold "error expected 0 arguments, got $#!"
5+
exit 1
6+
fi
7+
8+
exit_code=0
9+
10+
echo "Linting with ruff . . ."
11+
ruff check setup.py tests/*.py src/libsemigroups_pybind11/*.py docs/source/*.py || ((exit_code = 1))
12+
13+
echo "Linting with pylint . . ."
14+
pylint setup.py tests/*.py src/libsemigroups_pybind11/*.py src/libsemigroups_pybind11/**/*.py || ((exit_code = 1))
15+
16+
echo "Linting with cpplint . . ."
17+
cpplint src/*.hpp src/*.cpp || ((exit_code = 1))
18+
19+
exit $exit_code

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ filterwarnings = ["error"]
8989
log_cli_level = "info"
9090
testpaths = ["tests"]
9191

92+
[tool.pylint.main]
93+
ignore-paths = "src/libsemigroups_pybind11/_version.py"
94+
jobs = 0
95+
9296
[tool.pylint.miscellaneous]
9397
# List of note tags to take in consideration, separated by a comma.
9498
# notes = ["TODO", "FIXME", "REVIEW"]

0 commit comments

Comments
 (0)