-
Notifications
You must be signed in to change notification settings - Fork 533
Sty/pepping #2371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sty/pepping #2371
Conversation
…rts: interfaces.freesurfer
…next logical line
…alse:' or 'if not cond:'
* upstream/master: [HOTFIX] Incorrect call to warnings.warn updating the auto test FIX: updates hash to accept newline in realign_json.json FIX: Reset change to make hash assertion happy Reset change to make hash assertion happy STY: adds newline to end of file STY: delets heading newline in textfiles STY: correct for newline at end of file STY: correct for tailing spaces and newline at end of file STY: correct for tailing spaces and newline at end of file [FIX] Fix surf_reg input trait Update dti.py
this is now concurrent with master and updates a few things that were added between when i ran things and commits to master. this changes too many files to review closely (i think). so my suggestion would be to check out (if on average) yapf did a reasonable job (it's not perfect). and if all our tests pass, we can merge this. |
Thanks @satra, that makes the whole thing much easier. And yapf makes a great job it seems. As much as I see, yapf corrects the PEP violations very well, but also does some style corrections. As an example: 98c6d11#diff-e0dc80c66ccc03d65d1d7dc071e2ba23L11. This is in general no problem, but changes the familiar structure in some examples like this: c1900d9#diff-ed5086db91b4e4082d5c2e18e6944553L203 Only saw now that style preferences can be specified with |
@miykael - yes there are a few things where our default style was cleaner and the newer style is less aesthetic. but for expediency i am fine with the new style. i'll let a few other folks comment on this before we merge. |
@satra - IMO, there are many lines that would look better if the limit is 99. do we have to be as strict? |
@djarecka - if we change the limit to 99 many lines will then exceed that point just given how yapf works for our user base and developers, it's very likely that a change to 99 will not have an effect (no dot matrix printers and no vt52 terminals). do you want to give it a try and see what that results in? |
@satra - oh, I just thought that it's enough to change It's not as important, I just like longer lines, but 79 is still better than 72..;-) |
@satra - I see what you mean with yapf. I was trying to use yapf with |
is it ok to people if we merge this? |
We should probably merge this while you're at the code rodeo, DYT? Given that you are all together, ready to hotfix any problems quickly. @satra? |
Tried to resolve the conflict, but the GitHub "Resolve conflicts" thing is buggy. Will leave this to @satra to actually fix. (Feel free to force push over my merge, given that it doesn't do anything useful.) |
It is very buggy indeed. But if you try again exactly the same it will work out. |
Ready? |
👍 |
@oesteban , @miykael - this uses yapf to clean up most of the code base with respect to pep8.
i did a few things on top of michael's PR #2358 :
yapf -pir -e "*test_auto*" --style='{based_on_style: pep8, column_limit: 79}' nipype
this results in (note the pep8 checking with 99 instead of 79 - yapf doesn't fix exactly, it uses a slop factor):