#!/bin/bash -e
flake8 .

cd examples
GIT_ARG="--git-dir ../.git --work-tree .."

# find out modified python files
MOD=$(git $GIT_ARG status -s | grep -E '\.py$'  | grep -E '^\b+M\b+' | cut -c 4-)
flake8 $MOD
