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

Add support for flake8 per-file-ignores #28

Merged
merged 3 commits into from
May 20, 2021

Conversation

brandonwillard
Copy link
Contributor

This PR implements quick and dirty support for flake8's per-file-ignores option.

Changes to the list-type config parsing were necessary. Specifically, the parsing for multiline config settings, e.g.

[flake8]
ignores =
    E101,
    E102

needed to be altered to allow for multiple commas on a single line, because per-file-ignores takes a multiline list containing file names and comma separated lists of errors to be ignored:

[flake8]
per-file-ignores =
    foo.py: E101, E102
    bar.py: E101

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for you contribution @brandonwillard! Looks good to me, except for some minor comments.

pylsp/plugins/flake8_lint.py Outdated Show resolved Hide resolved
pylsp/config/source.py Outdated Show resolved Hide resolved
@brandonwillard
Copy link
Contributor Author

What is this test_debounce that's failing?

@andfoy
Copy link
Contributor

andfoy commented May 18, 2021

That is a flaky test that is unrelated to this PR, I've just re ran the CIs

@andfoy andfoy added this to the v1.1.0 milestone May 18, 2021
@andfoy
Copy link
Contributor

andfoy commented May 20, 2021

Thanks @brandonwillard!

@andfoy andfoy merged commit cf4eaad into python-lsp:develop May 20, 2021
@reagle
Copy link

reagle commented Jun 23, 2021

When might this be released? I'm looking forward to using it in my editor. 😄

@brandonwillard brandonwillard deleted the flake8-per-file-ignores branch June 24, 2021 03:04
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

Successfully merging this pull request may close these issues.

None yet

4 participants