Fix some flake8 coding style issues#10
Fix some flake8 coding style issues#10gerardroche wants to merge 1 commit intopackagecontrol:masterfrom gerardroche:flake-fixes
Conversation
This adds ignore rules for several specific docstring warnings in the form of D*. Those warnings tend to create a lot of flake8 noise. Several other warnings have been fixed.
There was a problem hiding this comment.
I'm generally not against linting for docstrings, but that only makes sense if you actually took the effort to write some. I didn't, or only for a select few functions, which is why don't consider docstring linting worth it for this project.
As such, I'm going to reject this pull request. I'll apply a few of your whitespace changes manually, though. Thanks for your efforts regardless.
|
|
||
| def main(): | ||
| """\ | ||
| """Main. |
There was a problem hiding this comment.
This docstring is later used to generate the help message, which is sub-optimal but works. Your change introduced a random "Main." in the help message.
| assert_none = not (failure_asserts or all_failure_asserts | ||
| or warning_asserts or all_warning_asserts) | ||
| assert_none = not ( | ||
| failure_asserts or |
There was a problem hiding this comment.
I prefer having the binary operator on the new line to more clearly show its relation to the above line. I believe there is an error code for this that goes both ways, so I'll see if I can enable this check for the future.
| # D103 Missing docstring in public function | ||
| # D104 Missing docstring in public package | ||
| # D105 Missing docstring in magic method | ||
| ignore = D100, D101, D102, D103, D104, D105 |
There was a problem hiding this comment.
Flake8, by default, doesn't check docstrings. You must have a flake8 plugin installed in your system/environment.
Also refer to the list of default errors: http://flake8.pycqa.org/en/latest/user/error-codes.html
|
After experimenting with flake8-docstrings for a bit, this turned out to be not that bad of an idea, so I added it in c96f1f2. Also quite unfortunately the error code for not having a line break before binary operators rather than after is still WIP: PyCQA/pycodestyle#502. |
|
Adding the ignore rules for the docstrings doesn't hurt, in fact it tends to hurt not to, unless I'm doing something wrong. I use SublimeLinter and it automatically shows lots of docstring errors without those ignore rules. I'm sure there's a way to disable the docstring checks per project or enable them per project but I find it easier to add the ignore rules and fix the issues. Code usually conforms for the most part, at least without those few high noise rules. |
This adds ignore rules for several specific docstring warnings in the
form of D*. Those warnings tend to create a lot of flake8 noise.
Several other warnings have been fixed.