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

syntax errors #56

Open hayd opened 10 years ago

hayd commented 10 years ago

Not sure what should happen with syntax errors, atm files with bad syntax are left unchanged, and no message is shown. Maybe check autopep8._find_logical doesn't raise (SyntaxError, tokenize.TokenError) if verbose?

hayd commented 10 years ago

I guess the question is, what do we want to happen if you are doing this inplace, and one file fails.

Two choices (suppose running inplace):

  1. just let everything work, BUT after fixing then exit(1) and give a message (if verbosity>=1).
  2. raise (before doing any copying) and exit(1) and report failure.

Personally I kinda prefer 1... though 2 is easier. I guess to do 1. you just bookkeep an files_with_syntax_errors list, and print/exit based on that. (There'll be a trivial tweak to the jobs branch.)