palantir / python-language-server

An implementation of the Language Server Protocol for Python
MIT License
2.6k stars 282 forks source link

Add support for flake8 per-file-ignores #902

Closed brandonwillard closed 3 years ago

brandonwillard commented 3 years ago

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
palantirtech commented 3 years ago

Thanks for your interest in palantir/python-language-server, @brandonwillard! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

brandonwillard commented 3 years ago

Moved to https://github.com/python-lsp/python-lsp-server/pull/28.