Open IamGianluca opened 6 years ago
Hmm same here, my setup.cfg is picked up by pycodestyle on the command line, but not by pycodestyle as ran by python-language-server.
In vim, putting a pycodestyle in setup.cfg works for me (.pycodestyle does not :( )
Had a similar problem when trying to set a maximum line length of 120 globally. Configured ~/.config/flake8
and ~/.config/pycodestyle
accordingly, but pyls with ALE would still show warnings in lines that exceeded only a length of 100 instead of 120 characters.
Turnes out pip install 'python-language-server[all]'
additionally comes with pylint, so generating a global pylint coniguration by pylint --generate-rcfile > ~/.pylintrc
and setting max-line-length = 120
there finally solved the issue.
The pycodestyle and pylint plugins are automatically activated when they are found in the virutalenv. In case of using flake8 you do not want this. The easiest way to enforce proper flake8 behaviour is by using pyls-flake8. Since my latest commit got merged by the maintainer it disables the other plugins to make sure that everything is done through flake8.
From my experience this is easier than disabling the plugins through the editor configuration.
pyls now support flake8, you will just need to enable the appropriate plugin.
I have a
.flake8
file in my project which defines some choices my team made about code style, including max line length of 100 characters.Unfortunately,
python-language-server
doesn't seem to read such file by default. I've read that the default linter ispycodestyle
, so I've tried to set the max line length argument in asetup.cfg
. However, in this case, the linter doesn't flag any line, even if longer that 120 characters.