8000 Fix pycodestyle iterable options (#220) · python-lsp/python-lsp-server@166967b · GitHub
[go: up one dir, main page]

Skip to content

Commit 166967b

Browse files
authored
Fix pycodestyle iterable options (#220)
* Fix pycodestyle iterable options * Typo * Typo
1 parent 85907d6 commit 166967b

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

pyls/language_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def initialize(self, root_uri, init_opts, process_id):
6565
pass
6666

6767
def m_initialize(self, **kwargs):
68-
log.debug("Language server intialized with %s", kwargs)
68+
log.debug("Language server initialized with %s", kwargs)
6969
if 'rootUri' in kwargs:
7070
self.root_uri = kwargs['rootUri']
7171
elif 'rootPath' in kwargs:

pyls/plugins/pycodestyle_lint.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ def pyls_lint(config, document):
1212
log.debug("Got pycodestyle settings: %s", settings)
1313

1414
opts = {
15-
'exclude': settings.get('exclude'),
16-
'filename': settings.get('filename'),
15+
'exclude': ','.join(settings.get('exclude') or []),
16+
'filename': ','.join(settings.get('filename') or []),
1717
'hang_closing': settings.get('hangClosing'),
18-
'ignore': settings.get('ignore'),
18+
'ignore': ','.join(settings.get('ignore') or []),
1919
'max_line_length': settings.get('maxLineLength'),
20-
'select': settings.get('select'),
20+
'select': ','.join(settings.get('select') or []),
2121
}
2222

2323
styleguide = pycodestyle.StyleGuide({k: v for k, v in opts.items() if v is not None})
@@ -27,6 +27,7 @@ def pyls_lint(config, document):
2727
)
2828
c.check_all()
2929
diagnostics = c.report.diagnostics
30+
3031
return diagnostics
3132

3233

test/plugins/test_pycodestyle_lint.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,9 @@ def test_pycodestyle_config(workspace):
8686
# And make sure we only get one warning
8787
diags = pycodestyle_lint.pyls_lint(config, doc)
8888
assert not [d for d in diags if d['code'] == 'W191']
89-
assert [d for d in diags if d['code'] == 'W391']
89+
90+
# Ignore both warnings
91+
config.update({'plugins': {'pycodestyle': {'ignore': ['W191', 'W391']}}})
92+
# And make sure we get neither
93+
assert not [d for d in diags if d['code'] == 'W191']
94+
assert not [d for d in diags if d['code'] == 'W391']

0 commit comments

Comments
 (0)
0