OpenStack IRC meetings schedule
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

flake8wrap.sh 477B

1234567891011121314151617181920
  1. #!/bin/bash
  2. #
  3. # A simple wrapper around flake8 which makes it possible
  4. # to ask it to only verify files changed in the current
  5. # git HEAD patch.
  6. #
  7. # Intended to be invoked via tox:
  8. #
  9. # tox -epep8 -- -HEAD
  10. #
  11. if test "x$1" = "x-HEAD" ; then
  12. shift
  13. files=$(git diff --name-only HEAD~1 | tr '\n' ' ')
  14. echo "Running flake8 on ${files}"
  15. diff -u --from-file /dev/null ${files} | flake8 --diff "$@"
  16. else
  17. echo "Running flake8 on all files"
  18. exec flake8 "$@"
  19. fi