Skip to content
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

No error outputted in flake8 >= 3.1.0 #18

Closed
cas-- opened this issue Nov 17, 2016 · 11 comments
Closed

No error outputted in flake8 >= 3.1.0 #18

cas-- opened this issue Nov 17, 2016 · 11 comments

Comments

@cas--
Copy link
Contributor

cas-- commented Nov 17, 2016

I just installed this extension but there is no error output for any of the files that fail isort. I added a print statement before the yield so the config is fine and it is getting the error from isort but seems to not be passed along or displayed by flake8.

$ flake8 --version
3.2.0 (pyflakes: 1.3.0, flake8_isort: 2.0, mccabe: 0.5.2, pycodestyle: 2.2.0) CPython 2.7.12 on Linux
@gforcada
Copy link
Owner

@cas-- thanks for reporting the issue!

flake8-isort is about sorting imports, the example you provide is about mixing print and yield in a function/method, that has nothing to do with sorting imports... or did I got it wrong?

Regards,
Gil

@cas--
Copy link
Contributor Author

cas-- commented Nov 17, 2016

I added a print to make it work for me as a workaround, it doesn't work otherwise...

@gforcada
Copy link
Owner

@cas-- sorry maybe I'm too busy but I still don't get your problem... do you have a config file where you tell isort how you want imports to be sorted? And if so, can you provide a snippet of the imports you used that should be warned by flake8-isort that do not follow your configuration?

Which version of flake8-isort and isort are you using?

@cas--
Copy link
Contributor Author

cas-- commented Nov 18, 2016

It is not an issue with isort or the config.

Name: flake8-isort Version: 2.0.1

Debugging the code it will get to this line because sort_result.incorrectly_sorted is True as isort has flagged an import sort problem. The problem is that yield information about that error vanishes and flake8 reports no issues. So there is a communication issue between flake8-isort and flake8.

@gforcada
Copy link
Owner

@cas-- which version of flake8 are you using?

@cas--
Copy link
Contributor Author

cas-- commented Nov 18, 2016

All versions in my original post...

@cas--
Copy link
Contributor Author

cas-- commented Nov 18, 2016

A side issue is that the actual version in code for flake8-isort needs bumped to 2.0.1 as it's misreported in flake8: https://github.com/gforcada/flake8-isort/blob/master/flake8_isort.py#L20

@gforcada
Copy link
Owner

I finally could reproduce it myself.

I noticed as well that any version between 3.0.0 and 3.0.4 (both included) did work as expected, there has to be some changes starting from 3.1.0 that prevent flake8-isort to show its messages.

@cas-- cas-- changed the title No error outputted in flake8 No error outputted in flake8 >= 3.1.0 Nov 21, 2016
@cas--
Copy link
Contributor Author

cas-- commented Nov 21, 2016

So looking at the verbose output of Flake8 reveals the issue:

flake8.style_guide        MainProcess   3023 DEBUG    Deciding if "I001" should be reported
flake8.style_guide        MainProcess   3023 DEBUG    The user configured "I001" to be "Ignored.Implicitly", "Selected.Implicitly"
flake8.style_guide        MainProcess   3023 DEBUG    "I001" will be "Decision.Ignored"
flake8.style_guide        MainProcess   3023 DEBUG    Error(code='I001', filename='test.py', line_number=1, column_number=1, text='isort found deviations to configured sorting rules, run it on the file to fix this.', physical_line='# -*- coding: utf-8 -*-\n') is not inline ignored
flake8.main.application   MainProcess   3024 INFO     Found a total of 1 violations and reported 0

I changed the code from I001 to E001 and worked as expected...

There have been quite a few changes to the selected code so no idea if should be fixed in the plugin or reported as a bug in flake8?

@gforcada
Copy link
Owner

gforcada commented Nov 22, 2016

@cas-- seems that they already fixed it on 3.2.1 I was testing it and seems that it works. Seems that this was the issue https://gitlab.com/pycqa/flake8/issues/257

@gforcada
Copy link
Owner

I'm releasing 2.0.2 shortly pinning flake8 3.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants