#!/bin/bash

set -eu

# E501: I like 132-column lines, which pylint is checking for
# W391: I see nothing wrong with a blank line at the end of a file.  In fact, I prefer it.
# E201: I often prefer to have whitespace inside []'s, for readability
# E241: Sometimes I greatly prefer having a number of assignment statements line up, when they're similar to one another
# E221: "
# E303: Sometimes I want a bunch of blank lines - specifically when I m4 a file to create .py and .pyx.
if type pep8 > /dev/null 2>&1
then
	if pep8 --ignore=E501,W391,E201,E241,E221,E303 "$@" | egrep .
	then
		exit 1
	fi
else
	echo "$0: pep8 not found" 1>&2
fi