pep8radius PEP8 clean only the parts of the files touched since the last commit, a previous commit or branch. Fixing the entire project of PEP8 infractions (“PEP8 storms”) can lead to merge conflicts, add noise to merges / pull requests and break (git) blame. pep8radius solves this problem by fixing only those PEP8 infractions incontained on the lines of the project which you’ve been working, leaving these sections “better than you found it” whilst keeping your commits focused on the areas of the codebase you were actually working on.

Installation From pip: $ pip install pep8radius

Usage Move to project directory

Make some changes to the project

Run pep8radius --diff # view a diff of proposed fixed

Run pep8radius --in-place # apply the fixes

Commit your changes Against a branch you can use the same syntax as with git diff: $ pep8radius master # branch name to compare against (compares against merge-base) $ pep8radius c12166f # commit hash $ pep8radius master --in-place # these work with other options too You can also fix docstrings (PEP257) using the docformatter option: $ pep8radius --docformatter --diff Note: can also use ``btyfi`` alias for ``pep8radius``. It can be nice to pipe the diff to cdiff (which makes diffs pretty and has lots of options): $ pep8radius --diff --no-color | cdiff $ pep8radius --diff --no-color | cdiff --side-by-side You can get strange results if you don’t use no-color. I actually use the following git alias (which allows git rad and git rad -i ): [ alias ] rad = !pep8radius master --diff --no-color $@ | cdiff --side-by-side

Requirements pep8radius uses autopep8, and in turn pep8. The docformatter option, to fix docstrings, uses docformatter.

VCS Support Git, Mecurial (hg), (tentatively) Bazaar. Please request support for other version control systems on github.