Run fast script linters before heavier analysis
Includes two small scripts: verify-bash.sh for running shellcheck, and verify-python.sh for running pylint. .pylint rc files is a default configuration file generated by pylint 2.3.1, with one change (min-similarity-lines changed from 4 to 10).
This commit is contained in:
parent
c6167533bf
commit
2bfae63f1f
4 changed files with 633 additions and 0 deletions
20
scripts/verify-python.sh
Executable file
20
scripts/verify-python.sh
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (c) 2019 Patryk Obara <patryk.obara@gmail.com>
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# This script exists only to easily run python static checker on all files in
|
||||
# the repo. You can pass additional parameters to this script itself, e.g.:
|
||||
#
|
||||
# $ ./verify-python.sh --disable=<msg_ids>
|
||||
|
||||
run_pylint () {
|
||||
git ls-files \
|
||||
| xargs file \
|
||||
| grep "Python script" \
|
||||
| cut -d ':' -f 1 \
|
||||
| xargs -L 1000 pylint "$@"
|
||||
}
|
||||
|
||||
pylint --version
|
||||
run_pylint --rcfile="$(git rev-parse --show-toplevel)/.pylint" "$@"
|
Loading…
Add table
Add a link
Reference in a new issue