This was mostly to prove to myself that we could possibly reach that
return more than actually covering that return. This just shows how
gnarly this logic actually is. I wish there were a better way to write
it.
Also, this further highlights why naming methods is so hard. I can't
think of a better name for 'more_specific_decision_for' that isn't
wildly long and unnecessarily verbose.
In dealing with the decision logic in the StyleGuide recently I
recognized that the logic really doesn't belong strictly on the
StyleGuide. A separate object makes perfect sense especially from the
perspective of testability. This is a minor refactor intended solely to
facilitate further testing and perhaps making the logic easier to
understand for others.
There was a *very* subtle bug in how we handle blanket select statements
with error codes that are in our DEFAULT_IGNORE. In the specific case,
users were specifying ``--select E`` and E126 was not being properly
reported. This unveiled further logic bugs as we refined this.
Closes#318
They are equivalent for iterating so remove the additional function
call.
Pattern identified as outdated by Lennart Regebro's PyCon 2017 talk
"Prehistoric Patterns in Python"
https://www.youtube.com/watch?v=V5-JH23Vk0I
The GitLab interface links to the CONTRIBUTING.rst file
(e.g. next to the green submit button under the text box
for filing a new issue), but does not follow the symlink.
Removing the symlink in order to replace it with a file
pointing at the rendered version of the guidelines:
http://flake8.pycqa.org/en/latest/internal/contributing.html
See GitLab issue #327.
By splitting out the logic to retrieve and return the formatting class
for an application, we can test it more easily and increase our test
coverage of this critical logic.
Refs #320
When we read in a file on Python 3, we use the tokenize module to detect
the coding pragma at the top of the file. We then use that to decode the
rest of the file. However, when we were receiving stdin, we would not do
that.
This updates ``stdin_get_value`` in a backwards compatible way to check
for that coding pragma and then fall back to UTF-8 if necessary.
Closes#306
Apparently there are some cases where the git hook will not find files
to run the checks against (e.g., when amending a commit message). In
those cases, it's best not to attempt to run any checks and to allow the
hook to exit successfully.
Closes#303