Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Handle empty options in pycodestyle and pydocstyle preferences #9231

Merged
merged 2 commits into from
May 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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],
Copy link
Member

@ccordoba12 ccordoba12 Apr 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty nice usage of list comprehensions! 👍

'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