Adafruit_Learning_System_Gu.../pylint_check.sh
Jeff Epler 541f533143
Use pylint-learn as the pylint version, if installed
.. this allows a user to install the specific version of pylint
required, under the specific name:
```
pipx install --suffix -learn pylint==2.7.1
```
and run pylint_check more easily locally.
2023-02-09 11:12:51 -06:00

16 lines
488 B
Bash
Executable file

#!/bin/bash
PYLINT="`type -p pylint-learn 2>/dev/null || type -p pylint3 2>/dev/null || type -p pylint`"
echo "Using pylint bin at $PYLINT"
# Use * as the default argument to avoid descending into hidden directories like .git
function find_pyfiles() {
if [ $# -eq 0 ]; then set -- *; fi
for f in $(find "$@" -type f -iname '*.py'); do
if [ ! -e "$(dirname $f)/.circuitpython.skip" ]; then
echo "$f"
fi
done
}
find_pyfiles "$@" | xargs "$PYLINT"