hyperspy/hyperspy — pull request #181 by francisco-dlp (2014-02-18 10:08:43+00:00)
Title: Automatic style corrections, courtesy of autopep8

These are automatic style corrections to the code to make it PEP8 compliant. The job was done by [autopep8](https://github.com/hhatto/autopep8).

Probably the easiest way to warranty that the code remains PEP8 compliant after merging this branch is to use a git hook to automatically correct the files that have changed. The following is the one that I'm using, that is a variation on the one [here](http://victorlin.me/posts/2014/02/05/auto-post-commit-pep8-correction)

```sh

#!/bin/sh
FILES=$(git diff HEAD^ HEAD --name-only --diff-filter=ACM | grep -e '\.py$')

for f in $FILES
do
# auto pep8 correction
autopep8 --in-place -v --aggressive $f
git add $f
done

git commit -m "Automatic style corrections courtesy of autopep8"

```

To use it you just have to copy it to a file called `post-commit`` in the `.git/hooks/` folder of the project. Don't forget to make the file executable. Note that after