run-linters: add --errors-only mode

Add `--errors-only` that runs only linters that can detect real errors
and all other ignoring the result.
This commit is contained in:
Benjamin Drung 2025-12-03 14:10:11 +01:00
parent 7b9aee4c0c
commit 4a2f194860

View File

@ -23,10 +23,18 @@ run_flake8() {
run_pylint() { run_pylint() {
echo "Running pylint..." echo "Running pylint..."
pylint $(find * -name '*.py') $PYTHON_SCRIPTS pylint "$@" $(find * -name '*.py') $PYTHON_SCRIPTS
} }
run_black if test "${1-}" = "--errors-only"; then
run_isort # Run only linters that can detect real errors (ignore formatting)
run_flake8 run_black || true
run_pylint run_isort || true
run_flake8 || true
run_pylint --errors-only
else
run_black
run_isort
run_flake8
run_pylint
fi