hayd / pep8radius

PEP8 clean only the parts of the files touched since the last commit, a previous commit or (the merge-base of) a branch.
MIT License
183 stars 9 forks source link

ENH color for diff #47

Closed hayd closed 10 years ago

hayd commented 10 years ago

fixes #43.

This works but screws up the tests... (I think it's not being caught by the captured_output context manager, not sure why or how to fix).

hayd commented 10 years ago

Could probably just stub with print in the tests (for now).

Also for trailing whitespace (print with pink/red background),

split_whitespace = re.split('(\s+)$', line)
if len(split_whitespace) > 1:  # claim it must be 3
    line, trailing, _ = split_whitespace
else:
    line, trailing = split_whitespace[0], ''

Perhaps this functionality (pretty diff printing) should be in separate module?

hayd commented 10 years ago

@schodge I think this should work on Windows, I'm going to fix a few things tonight (the version bump of autopep8 fixes a couple of bugs I'd not even posted yet as had been too busy). Would be great to know if this (the color diff printing) worked on Windows.

I'm looking forward to adding example usage gif on the homepage - with colour!

hayd commented 10 years ago

I think I'm just going to amend the author to you for the fix paths commit.

Let me know if this branch works (tests pass and in techicolor)! using latest autopep8. :) I've totally cheated with the stubbed tests, but not sure what to do here... I guess I could use mocks maybe

hayd commented 10 years ago

I suffer from lack of patience, pushing to master (with the one commit as yours).