Skip to content

Commit

Permalink
Merge pull request #9231 from dalthviz/fixes_issue_9209
Browse files Browse the repository at this point in the history
PR: Handle empty options in pycodestyle and pydocstyle preferences
  • Loading branch information
ccordoba12 authored May 2, 2019
2 parents 7a8509b + f42e7bb commit 2c90e2a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
19 changes: 11 additions & 8 deletions spyder/plugins/editor/lsp/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,11 @@ def generate_python_config(self):

pycodestyle = {
'enabled': self.get_option('pycodestyle'),
'exclude': [exclude.strip() for exclude in cs_exclude],
'filename': [filename.strip() for filename in cs_filename],
'select': [select.strip() for select in cs_select],
'ignore': [ignore.strip() for ignore in cs_ignore],
'exclude': [exclude.strip() for exclude in cs_exclude if exclude],
'filename': [filename.strip()
for filename in cs_filename if filename],
'select': [select.strip() for select in cs_select if select],
'ignore': [ignore.strip() for ignore in cs_ignore if ignore],
'hangClosing': False,
'maxLineLength': cs_max_line_length
}
Expand All @@ -278,10 +279,12 @@ def generate_python_config(self):
pydocstyle = {
'enabled': self.get_option('pydocstyle'),
'convention': convention,
'addIgnore': [ignore.strip() for ignore in ds_add_ignore],
'addSelect': [select.strip() for select in ds_add_select],
'ignore': [ignore.strip() for ignore in ds_ignore],
'select': [select.strip() for select in ds_select],
'addIgnore': [ignore.strip()
for ignore in ds_add_ignore if ignore],
'addSelect': [select.strip()
for select in ds_add_select if select],
'ignore': [ignore.strip() for ignore in ds_ignore if ignore],
'select': [select.strip() for select in ds_select if select],
'match': self.get_option('pydocstyle/match'),
'matchDir': self.get_option('pydocstyle/match_dir')
}
Expand Down
1 change: 0 additions & 1 deletion spyder/plugins/editor/widgets/tests/test_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

@pytest.mark.slow
@pytest.mark.second
@pytest.mark.xfail
def test_ignore_warnings(qtbot, lsp_codeeditor):
"""Test that the editor is ignoring some warnings."""
editor, manager = lsp_codeeditor
Expand Down

0 comments on commit 2c90e2a

Please sign in to comment.