-
Notifications
You must be signed in to change notification settings - Fork 7
Conversation
Add a simple testenv which runs flake8 on our source
I hadn't noticed that I have some squashed flake8 errors set globally to reduce noise with our other projects. The project should now be flake8 clean. |
.editorconfig
Outdated
indent_style=space | ||
indent_size=2 | ||
[*.py] | ||
max_line_length=79 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would have to add configuration to flake8 to ignore line length since it enforces PEP8: https://www.python.org/dev/peps/pep-0008/#maximum-line-length
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I don't know off the top of my head if flake8 supports a configurable line length as opposed to just ignoring line length errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And even if we make use of PEP8's wiggle room, to paraphrase Monty Python and the Holy Grail "99 is the maximum line length and the length of the maximum line shall be 99. 119 is right out!"
Some teams strongly prefer a longer line length. For code maintained exclusively or primarily by a team that can reach agreement on this issue, it is okay to increase the nominal line length from 80 to 100 characters (effectively increasing the maximum length to 99 characters), provided that comments and docstrings are still wrapped at 72 characters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The consensus appears to be "99".
PEP 8 has the following to say about the subject of line length: "Some teams strongly prefer a longer line length. For code maintained exclusively or primarily by a team that can reach agreement on this issue, it is okay to increase the nominal line length from 80 to 100 characters (effectively increasing the maximum length to 99 characters), provided that comments and docstrings are still wrapped at 72 characters." As discussed in uisautomation#13, we've settled on 99 as a compromise between sticking to PEP8 and making use of modern screen widths. Update the editorconfig and add a flake8 configuration file to the root of the repo.
The line length silencing is now no-longer required because we allow a longer line length.
Add flake8 as a code-style check to tox test runner. Since CircleCI runs the default tox envs, this means that code-style should be enforced for each pull request.
Closes #12