Skip to content

Commit 16ef744

Browse files
committed
pylint_check: Let user specify a specific directory to check
For instance, while working on CircuitPython_RGBMatrix, I can just run ./pylint_check CircuitPython_RGBMatrix which gives a much faster turnaround time (a few seconds, rather than minutes on my laptop) and doesn't show extraneous messages about other code fragments. When no argument is specified, the script behaves as before, so it does not affect CI.
1 parent 2f2fd55 commit 16ef744

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pylint_check

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#!/bin/bash
22

3+
PYLINT="`type -p pylint3 2>/dev/null || type -p pylint`"
4+
35
function find_pyfiles() {
4-
for f in $(find . -type f -iname '*.py'); do
6+
if [ $# -eq 0 ]; then set -- .; fi
7+
for f in $(find "$@" -type f -iname '*.py'); do
58
if [ ! -e "$(dirname $f)/.circuitpython.skip" ]; then
69
echo "$f"
710
fi
811
done
912
}
1013

11-
find_pyfiles | xargs pylint
14+
find_pyfiles "$@" | xargs "$PYLINT"

0 commit comments

Comments
 (0)