Skip to content

STY: PEP8 style correction for all warnings, and almost all errors. Except E402, E501 and E731 #1264

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

Merged
merged 20 commits into from
Nov 16, 2015

Conversation

miykael
Copy link
Collaborator

@miykael miykael commented Nov 1, 2015

This PR covers the rest of PEP8 violations mentioned in #597, that were not already covered by #1255. Only exceptions are:

  • E402 module level import not at top of file (N=402)
  • E501 line too long (80 > 79 characters) (N=8631)
  • E731 do not assign a lambda expression, use a def (N=40)

In my opinion, E402 cannot be corrected and E731 would be a mess to correct.
E501 can be corrected, but just needs a lot of manual correction. Therefore, I think it makes sense to correct them with another PR.

Also, there are the following PEP8 violations that I haven't corrected and I would be happy to have a feedback if they should or shouldn't be changed:

E712 comparison to False should be 'if cond is False:' or 'if not cond:'
The four errors are all in file nipype/pipeline/plugins/base.py, on line 235 + 236, 331 and 341. Because they compare the values of a numpy array to a boolean, we cannot replace '==' with is.

W191 indentation contains tabs and E101 indentation contains mixed spaces and tabs
The six W191 and two E101 violations exist because of nipype/utils/tests/test_cmd.py on line 84-89, because of the tab character in file nipype/utils/nipype_cmd.py on line 17.

E116 unexpected indentation (comment)
The 5 E116 violations are caused by nipype/interfaces/fsl/preprocess.py on line 243-247 and I don't dare to delete this.

E265 block comment should start with '# '
The 28 E265 violations are caused by multiple lines in file doc/conf.py, for example line 53, 73, 77, etc. I didn't add the space after # so that it's still clear what is a comment and what is commented code.

something about an outline
fun :
fun :
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change is affecting a test. the test should be updated.

@satra
Copy link
Member

satra commented Nov 16, 2015

@miykael - can you merge this with master now?

@miykael
Copy link
Collaborator Author

miykael commented Nov 16, 2015

Yes, but how do I do this? Do I merge my pep8StyleCorrections branch with master and than just correct any given conflict with a new commit?

@satra
Copy link
Member

satra commented Nov 16, 2015

yes

blakedewey added a commit that referenced this pull request Nov 16, 2015
STY: PEP8 style correction for all warnings, and almost all errors. Except E402, E501 and E731
@blakedewey blakedewey merged commit 6d88cba into nipy:master Nov 16, 2015
@miykael miykael mentioned this pull request Nov 17, 2015
@miykael miykael deleted the pep8StyleCorrections branch January 6, 2018 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants