Skip to content

Commit 30dd7f8

Browse files
authored
Merge pull request #2442 from jepler/improve-pylint-script
Specify the right pylintrc file no matter where pylint_check is run
2 parents a2a2916 + a10eb63 commit 30dd7f8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pylint_check.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
#!/bin/bash
22

3+
SOURCE_LOCATION="$(dirname "$0")"
34
PYLINT="`type -p pylint-learn 2>/dev/null || type -p pylint3 2>/dev/null || type -p pylint`"
45
echo "Using pylint bin at $PYLINT"
6+
PYLINTRC=$SOURCE_LOCATION/.pylintrc
57

68
# Use * as the default argument to avoid descending into hidden directories like .git
9+
# don't use advanced functions of find without verifying they are present in
10+
# the archaic default version on macos
711
function find_pyfiles() {
812
if [ $# -eq 0 ]; then set -- *; fi
913
for f in $(find "$@" -type f -iname '*.py'); do
@@ -13,4 +17,4 @@ function find_pyfiles() {
1317
done
1418
}
1519

16-
find_pyfiles "$@" | xargs "$PYLINT"
20+
find_pyfiles "$@" | xargs "$PYLINT" --rcfile "$PYLINTRC"

0 commit comments

Comments
 (0)