STY: PEP8 style correction for all warnings, and almost all errors. Except E402, E501 and E731 #1264
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
This PR covers the rest of PEP8 violations mentioned in #597, that were not already covered by #1255. Only exceptions are:
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 filenipype/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.