Closed mihaic closed 7 years ago
I have no issue with the change but I didn't see anything about it in the docs and am not super knowledgeable on flake8. What exactly does this do?
My PR changes the name for the flake8-print
entry point such that flake8
automatically enables the flake8-print
codes. Without this PR, flake8-print
runs, but its results are not included in the report by default.
The example in the docs does name the entry point in a similar way to my proposal: http://flake8.pycqa.org/en/latest/plugin-development/registering-plugins.html
The X in checking plugins define what error codes it is going to report. So if the plugin reports only the error code X101 your entry-point would look like:
X101 = flake8_example.ExamplePlugin
Nod there are other flake8 plugins which use the T
prefix. I assume this change would create confusion and possibly bugs.
Is there another way to register only the exact codes that this plugin uses?
I am not sure about that. I asked in the flake8
issue tracker:
https://gitlab.com/pycqa/flake8/issues/149#note_15020371
Another option, to not block the compatibility with flake8 > 3.0.0, would be to rename the codes to be all in, say T90X where X is the specific code (so far only 3 different error codes are returned by flake8-print)
This way, other plugins that also use T in their codes will probably not clash, if that's actually a problem at all. My gut feeling is that it shouldn't be because then only as many characters as the alphabet would be allowed. And that's quite limiting...
Not a bad idea, just in the middle of my vacation, I'm back next week then I'll be active again.
likely fixed by https://gitlab.com/pycqa/flake8/issues/257
and is fixed in 3.2.1 of flake8
Thanks for the follow-up. Indeed, it is fixed.
In flake8 v3, plugin codes are enabled automatically based on the plugin entry point name. https://github.com/PyCQA/flake8/blob/master/src/flake8/plugins/manager.py#L188 https://github.com/PyCQA/flake8/commit/ec2e601cbf9a56c9bee2ee3cc22999c795c1c824