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

Missing support for flake8 --extend-ignore #941

Closed
cippaciong opened this issue Aug 31, 2021 · 4 comments
Closed

Missing support for flake8 --extend-ignore #941

cippaciong opened this issue Aug 31, 2021 · 4 comments

Comments

@cippaciong
Copy link

Hello, I'm using pyls on neovim with the LanguageClient-neovim plugin.
I'm formatting my code using black and have the following settings configured in setup.cfg, as suggested by the Black documentation:

[flake8]
max-line-length = 88
select = C,E,F,W,B,B950
extend-ignore = E203, E501, W503

My problem is that the extend-ignore line is ignored by pyls and I have warnings in my editor that I shouldn't have.

Looking at flake8_lint.py#L25 and flake8_conf.py#L26 I think that the problem might be that pyls is looking only for the ingore option.

@ccordoba12
Copy link
Contributor

Hey @cippaciong, thanks for reporting. You're welcome to submit a pull request to fix this.

@cippaciong
Copy link
Author

Hi @ccordoba12, I gave it a try (I moved from python-language-server to python-lsp-server in the meantime) but I'm stuck with an error that I'm having a hard time to understand.

You can see my changes here: https://github.com/cippaciong/python-lsp-server/commit/e4f84e515cd1bbd92bf8a02dd54628a0c038b42d

From the logs it looks like flake8 is invoked correctly:

2021-09-01 00:39:39,717 CEST - DEBUG - pylsp.plugins.flake8_lint - Got flake8 settings: {'select': ['C', 'E', 'F', 'W', 'B', 'B950'], 'enabled': True, 'extendIgnore': ['E203', 'E501', 'W503'], 'maxLineLength': 88}
2021-09-01 00:39:39,717 CEST - DEBUG - pylsp.plugins.flake8_lint - Calling flake8 with args: '['-', '--extend-ignore=E203,E501,W503', '--max-line-length=88', '--select=C,E,F,W,B,B950']'

But than I have this weird log line where it mixes a proper warning for E303 with a flake8 error unrecognized arguments: --extendIgnore=E203,E501,W503\n

2021-09-01 00:39:39,897 CEST - DEBUG - pylsp.config.config -   finish pylsp_lint --> [[{'source': 'flake8', 'range': {'start': {'line': 0, 'character': 0}, 'end': {'line': 0, 'character': 1}}, 'code': 'ERR', 'message': 'usage: flake8 [optio
ns] file file ...\nflake8: error: unrecognized arguments: --extendIgnore=E203,E501,W503\n', 'severity': 1}], [{'source': 'flake8', 'code': 'E303', 'range': {'start': {'line': 34, 'character': 4}, 'end': {'line': 34, 'character': 40}}, 'mess
age': 'E303 too many blank lines (2)', 'severity': 2}]] [hook]

Do you have any idea of what's happening here?

P.S. Let me know if you want me to move the discussion to the python-lsp-server repo

@ccordoba12
Copy link
Contributor

Yes, please open an issue in python-lsp-server because this project is abandoned.

@cippaciong
Copy link
Author

Moved to python-lsp/python-lsp-server#76

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