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

should be quiet if not making changes #14

Closed hayd closed 10 years ago

hayd commented 10 years ago

related to #13, if there are no pep8 violations maybe it should say so / print less. Or say the number of changes made in each / over all line range:

Not sure.

hayd commented 10 years ago

autopep8 has a diff argument. We could print the sum of that in a nice way... noting that we already have a parser.

hayd commented 10 years ago

Perhaps should say:

1/3 file.py: 0 lines fixed.
2/3 file2.py: 1 lines fixed.
@@ -2919,7 +2919,7 @@
-    if not  logical[0]:
+    if not logical[0]:
3/3 file3.py: 0 lines fixed.

pep8radius fixed 2 lines in 3 files.

This is significantly better than the line ranges backwards (which is an implementation detail).

Not sure if should show entire diff or not (removing the 3 lines above and before seems less noisy) ?

hayd commented 10 years ago

Strangely autopep8.fix_file(f, self.options) isn't returning the diff (it seems to in the interpreter, when options.diff=True).

For the moment it's showing dots for each pass, until I can extract the diff.

hayd commented 10 years ago

fixed

hayd commented 10 years ago

passes options to autopep8 now, much better