evandrocoan: @lgeiger, This should have been fixed by https://github.com/palantir/python-language-server/pull/234 
lgeiger: > This should have been fixed by #234

👍I rebased. Let's see what CI thinks.
lgeiger: Thanks @evandrocoan for pointing this out.

I had to revert #220 to fix #239. Now the tests should pass.
diff --git a/pyls/plugins/pycodestyle_lint.py b/pyls/plugins/pycodestyle_lint.py
index 8441281..96efafd 100644
--- a/pyls/plugins/pycodestyle_lint.py
+++ b/pyls/plugins/pycodestyle_lint.py
@@ -12,12 +12,12 @@ def pyls_lint(config, document):
     log.debug("Got pycodestyle settings: %s", settings)
 
     opts = {
-        'exclude': ','.join(settings.get('exclude') or []),
-        'filename': ','.join(settings.get('filename') or []),
+        'exclude': settings.get('exclude'),
+        'filename': settings.get('filename'),
         'hang_closing': settings.get('hangClosing'),
-        'ignore': ','.join(settings.get('ignore') or []),
+        'ignore': settings.get('ignore'),
         'max_line_length': settings.get('maxLineLength'),
-        'select': ','.join(settings.get('select') or []),
+        'select': settings.get('select'),
     }
     kwargs = {k: v for k, v in opts.items() if v}
     styleguide = pycodestyle.StyleGuide(kwargs)

Fix ignored and select settings interface with pycodestyle
On https://github.com/PyCQA/pycodestyle/pull/722 they refused to fix their interface. When passing the list arguments as `ignore` and `select` settings to `pycodestyle`, it is required to pass a python list as `["E201", "E501"]`, instead of a string `"E201,E501"`, otherwise they will cause the issue pointed on: https://github.com/tomv564/LSP/issues/244#issuecomment-358753274
diff --git a/test/plugins/test_pycodestyle_lint.py b/test/plugins/test_pycodestyle_lint.py
index 028997f..583da79 100644
--- a/test/plugins/test_pycodestyle_lint.py
+++ b/test/plugins/test_pycodestyle_lint.py
@@ -8,7 +8,7 @@ from pyls.plugins import pycodestyle_lint
 DOC_URI = uris.from_fs_path(__file__)
 DOC = """import sys
 
-def hello():
+def hello( ):
 \tpass
 
 import json
@@ -40,6 +40,14 @@ def test_pycodestyle(config):
     assert mod_import['range']['start'] == {'line': 7, 'character': 0}
     assert mod_import['range']['end'] == {'line': 7, 'character': 1}
 
+    msg = "E201 whitespace after '('"
+    mod_import = [d for d in diags if d['message'] == msg][0]
+
+    assert mod_import['code'] == 'E201'
+    assert mod_import['severity'] == lsp.DiagnosticSeverity.Warning
+    assert mod_import['range']['start'] == {'line': 2, 'character': 10}
+    assert mod_import['range']['end'] == {'line': 2, 'character': 14}
+
 
 def test_pycodestyle_config(workspace):
     """ Test that we load config files properly.
@@ -66,7 +74,7 @@ def test_pycodestyle_config(workspace):
     assert [d for d in diags if d['code'] == 'W191']
 
     content = {
-        'setup.cfg': ('[pycodestyle]\nignore = W191', True),
+        'setup.cfg': ('[pycodestyle]\nignore = W191, E201', True),
         'tox.ini': ('', False)
     }
 
@@ -77,18 +85,16 @@ def test_pycodestyle_config(workspace):
 
         # And make sure we don't get any warnings
         diags = pycodestyle_lint.pyls_lint(config, doc)
-        assert len([d for d in diags if d['code'] == 'W191']) == 0 if working else 1
+        assert len([d for d in diags if d['code'] == 'W191']) == (0 if working else 1)
+        assert len([d for d in diags if d['code'] == 'E201']) == (0 if working else 1)
+        assert [d for d in diags if d['code'] == 'W391']
 
         os.unlink(os.path.join(workspace.root_path, conf_file))
 
     # Make sure we can ignore via the PYLS config as well
-    config.update({'plugins': {'pycodestyle': {'ignore': ['W191']}}})
+    config.update({'plugins': {'pycodestyle': {'ignore': ['W191', 'E201']}}})
     # And make sure we only get one warning
     diags = pycodestyle_lint.pyls_lint(config, doc)
     assert not [d for d in diags if d['code'] == 'W191']
-
-    # Ignore both warnings
-    config.update({'plugins': {'pycodestyle': {'ignore': ['W191', 'W391']}}})
-    # And make sure we get neither
-    assert not [d for d in diags if d['code'] == 'W191']
-    assert not [d for d in diags if d['code'] == 'W391']
+    assert not [d for d in diags if d['code'] == 'E201']
+    assert [d for d in diags if d['code'] == 'W391']

pip install -e .[test]
parse_log_pytest
requirements.txt
pytest pytest-cov coverage
apt-get update apt-get install -y gcc
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
cachetools==5.5.2
chardet==5.2.0
colorama==0.4.6
configparser==7.2.0
coverage==7.8.0
distlib==0.3.9
exceptiongroup==1.2.2
filelock==3.18.0
future==1.0.0
iniconfig==2.1.0
jedi==0.19.2
json-rpc==1.15.0
mccabe==0.7.0
packaging==24.2
parso==0.8.4
platformdirs==4.3.7
pluggy==1.5.0
pycodestyle==2.13.0
pydocstyle==6.3.0
pyflakes==3.3.1
pyproject-api==1.9.0
pytest==8.3.5
pytest-cov==6.0.0
-e git+https://github.com/palantir/python-language-server.git@897980b7e2bd71811311cb49b18cf89ed3aa9cbe#egg=python_language_server
pytoolconfig==1.3.1
rope==1.13.0
snowballstemmer==2.2.0
tomli==2.2.1
tox==4.25.0
typing_extensions==4.13.0
versioneer==0.29
virtualenv==20.29.3
yapf==0.43.0

name: python-language-server
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - cachetools==5.5.2
      - chardet==5.2.0
      - colorama==0.4.6
      - configparser==7.2.0
      - coverage==7.8.0
      - distlib==0.3.9
      - exceptiongroup==1.2.2
      - filelock==3.18.0
      - future==1.0.0
      - iniconfig==2.1.0
      - jedi==0.19.2
      - json-rpc==1.15.0
      - mccabe==0.7.0
      - packaging==24.2
      - parso==0.8.4
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - pycodestyle==2.13.0
      - pydocstyle==6.3.0
      - pyflakes==3.3.1
      - pyproject-api==1.9.0
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - pytoolconfig==1.3.1
      - rope==1.13.0
      - snowballstemmer==2.2.0
      - tomli==2.2.1
      - tox==4.25.0
      - typing-extensions==4.13.0
      - versioneer==0.29
      - virtualenv==20.29.3
      - yapf==0.43.0
prefix: /opt/conda/envs/python-language-server

test/plugins/test_pycodestyle_lint.py::test_pycodestyle_config
test/plugins/test_pycodestyle_lint.py::test_pycodestyle
pyls/plugins/pycodestyle_lint.py
pyls/plugins/pycodestyle_lint.py