File: fast8.sh

package info (click to toggle)
python-os-brick 6.11.0-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 2,220 kB
  • sloc: python: 20,429; sh: 92; makefile: 23
file content (24 lines) | stat: -rwxr-xr-x 542 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

NUM_COMMITS=${FAST8_NUM_COMMITS:-1}

cd $(dirname "$0")/..
CHANGED=""
CHANGED+="$(git diff --name-only HEAD~${NUM_COMMITS} \*.py | tr '\n' ' ')"

while [[ -z $CHANGED ]]; do
    # Search back until we find a commit containing python files
    NUM_COMMITS=$((NUM_COMMITS + 1))
    CHANGED+="$(git diff --name-only HEAD~${NUM_COMMITS} \*.py | tr '\n' ' ')" ;
done

# Skip files that don't exist
# (have been git rm'd)
CHECK=""
for FILE in $CHANGED; do
    if [ -f "$FILE" ]; then
        CHECK+="$FILE "
    fi
done

flake8 $CHECK