File: flake8wrap.sh

package info (click to toggle)
nova 2%3A32.1.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 51,500 kB
  • sloc: python: 418,899; pascal: 1,848; sh: 991; makefile: 163; xml: 83
file content (22 lines) | stat: -rwxr-xr-x 472 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
#
# A simple wrapper around flake8 which makes it possible
# to ask it to only verify files changed in the current
# git HEAD patch.
#
# Intended to be invoked via tox:
#
#   tox -epep8 -- -HEAD
#

if test "x$1" = "x-HEAD" ; then
    shift
    files=$(git diff --name-only HEAD~1 | grep '.py$' | tr '\n' ' ')
    echo "Running flake8 on ${files}"
    echo ""
    flake8 "$@" $files
else
    echo "Running flake8 on all files"
    echo ""
    exec flake8 "$@"
fi