From 35e95f49351be0dda2c2f6613a08c6cc50cd321a Mon Sep 17 00:00:00 2001 From: dalthviz Date: Sun, 28 Apr 2019 23:08:48 -0500 Subject: [PATCH 1/2] Preferences: Handle empty strings in pycodestyle and pydocstyle --- spyder/plugins/editor/lsp/manager.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/spyder/plugins/editor/lsp/manager.py b/spyder/plugins/editor/lsp/manager.py index 32bf87bb9c8..81d840741c5 100644 --- a/spyder/plugins/editor/lsp/manager.py +++ b/spyder/plugins/editor/lsp/manager.py @@ -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 } @@ -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') } From f42e7bbb48ebaab97e747fd84a62e2f7eb5f246f Mon Sep 17 00:00:00 2001 From: dalthviz Date: Sun, 28 Apr 2019 23:50:53 -0500 Subject: [PATCH 2/2] Editor: Remove xfail from test to ignore warnings --- spyder/plugins/editor/widgets/tests/test_warnings.py | 1 - 1 file changed, 1 deletion(-) diff --git a/spyder/plugins/editor/widgets/tests/test_warnings.py b/spyder/plugins/editor/widgets/tests/test_warnings.py index 305dcfff0a9..9d1053e97bc 100644 --- a/spyder/plugins/editor/widgets/tests/test_warnings.py +++ b/spyder/plugins/editor/widgets/tests/test_warnings.py @@ -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