New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ignore options are not respected #8
Comments
I think this might have changed with flake8 3.x -- can you verify whether this is still an issue? |
I can confirm that with flake8 3.2.1 and pytest-flake8 0.8.1 flake8-ignore directives are not applied. |
I've just discovered the issue is with pytest. It seems that in recent versions it changed the way it loads config resulting in it not loading the config it used to do (setup.cfg) instead loading pytest.ini and hence the config for pytest-flake8 wasn't being set at all. |
Is there a workaround? This is a killer when you rely on automated flake8 tests. |
Ignore options are properly loaded from ``setup.cfg`` but then overwritten. Here we simply extend this list.
I have added a simple potential fix to this, but don't know the logic behind the new option managing, so this needs review. |
@mforbes I tested your alteration and at least it seems to work. Now it respects whatever I have in |
@mjtorn I am looking into this a bit, but I need input from @tholo. I do not understand the purpose of the present options-parsing code which has several issues:
Is there a use-case where one needs to control these separately? If so, it would be good to at least use a consistent format. If not, I would suspect that it is best to let |
It looks like @andras-tim added some of these options. Perhaps he can explain why the additional options are needed instead of just relying on the |
Due to this bug I had to remove pytest-flake8 usage from all the modules that I maintain. While I do like the idea of being able to include flake8 as part of pytest execution, I do also find it unreliable. @mforbes is right, I see zero reasons why this module would need its own ignore flags when flake8 already has them. This only creates confusion and bugs. I should also mention that even with this bug I found impossible to replicate the flake8 ignore list to pytest-flake8 ignore list. Somehow it seems that is ignoring some of these ignores :( |
So is something happening with this? |
Funny thing, this bit me for the first time in a while again ;) Dealt with it, but it would be nice to see a resolution. Thanks! |
Nothing? Anything? |
@mforbes, I prefer a magic solution, like pass through all |
Potential fix for issue tholo#8
I am also seeing the issue that an "ignore" setting in the [flake8] section of setup.cfg is ignored. PR #21 solves this for me. |
Thank you! |
Here is what happens when someone is trying to add some ignore options:
Editing
setup.cfg
and addingAnd while running it we can observe that the ignore option was loaded due to the changed header but right below it we can also observe that it was clearly not working.
We even tried alternative separator (comma) and in this case it has the same (non-filtering) behaviour but it does not display the ignoring text in the header.
Just to increase the level of non-sense about the implementation we already have these ignores configured in the
setup.cfg
Flake8 is able to use these ignores but
pytest-flake8
not only that is expecting other options (why?!) but based on the documentation it does expect them with space separators instead of commas.I tried to add
pytest-flake8
to several projects that I maintain just because they were already using pytest and consolidating the build logic did make sense. Still, it seems that it never works.The text was updated successfully, but these errors were encountered: