Specify the right pylintrc file no matter where pylint_check is run
This commit is contained in:
parent
e804e29cab
commit
a10eb63057
1 changed files with 5 additions and 1 deletions
|
|
@ -1,9 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
SOURCE_LOCATION="$(dirname "$0")"
|
||||
PYLINT="`type -p pylint-learn 2>/dev/null || type -p pylint3 2>/dev/null || type -p pylint`"
|
||||
echo "Using pylint bin at $PYLINT"
|
||||
PYLINTRC=$SOURCE_LOCATION/.pylintrc
|
||||
|
||||
# Use * as the default argument to avoid descending into hidden directories like .git
|
||||
# don't use advanced functions of find without verifying they are present in
|
||||
# the archaic default version on macos
|
||||
function find_pyfiles() {
|
||||
if [ $# -eq 0 ]; then set -- *; fi
|
||||
for f in $(find "$@" -type f -iname '*.py'); do
|
||||
|
|
@ -13,4 +17,4 @@ function find_pyfiles() {
|
|||
done
|
||||
}
|
||||
|
||||
find_pyfiles "$@" | xargs "$PYLINT"
|
||||
find_pyfiles "$@" | xargs "$PYLINT" --rcfile "$PYLINTRC"
|
||||
|
|
|
|||
Loading…
Reference in a new issue