mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-12-11 18:13:26 +00:00
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:
parent
7b9aee4c0c
commit
4a2f194860
18
run-linters
18
run-linters
@ -23,10 +23,18 @@ run_flake8() {
|
||||
|
||||
run_pylint() {
|
||||
echo "Running pylint..."
|
||||
pylint $(find * -name '*.py') $PYTHON_SCRIPTS
|
||||
pylint "$@" $(find * -name '*.py') $PYTHON_SCRIPTS
|
||||
}
|
||||
|
||||
run_black
|
||||
run_isort
|
||||
run_flake8
|
||||
run_pylint
|
||||
if test "${1-}" = "--errors-only"; then
|
||||
# Run only linters that can detect real errors (ignore formatting)
|
||||
run_black || true
|
||||
run_isort || true
|
||||
run_flake8 || true
|
||||
run_pylint --errors-only
|
||||
else
|
||||
run_black
|
||||
run_isort
|
||||
run_flake8
|
||||
run_pylint
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user