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

Conversation

dalthviz
Copy link
Member

Description of Changes

  • Wrote at least one-line docstrings (for any new functions)
  • Added unit test(s) covering the changes (if testable)
  • Included a screenshot or animation (if affecting the UI, see Licecap)

Issue(s) Resolved

Fixes #9209

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct: dalthviz

@dalthviz
Copy link
Member Author

@ccordoba12 testing the behavior of the two options (select and ignore), what I see is that when you use the select option, only the warnings selected are shown (the other ones are ignore). Also, the select option takes precedence to the ignore option, so for example if you put for the select and ignore options the E202 code, only the warnings associted with an E202 warning will be shown

@dalthviz dalthviz marked this pull request as ready for review April 29, 2019 04:33
@ccordoba12 ccordoba12 changed the title PR: Handle empty strings in pycodestyle and pydocstyle preferences PR: Handle empty options in pycodestyle and pydocstyle preferences Apr 29, 2019
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

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

Thanks @dalthviz for testing how things work. If that's the case, then I think we should leave both select and ignore options active and let users decide what they want to do with them.

But perhaps an explanation should be added to our docs. @CAM-Gerlach, what do think?

'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! 👍

@ccordoba12
Copy link
Member

Merging because pycodestyle accepts both select and ignore, as @dalthviz pointed out.

The question about mentioning this in our docs is a separate issue.

@CAM-Gerlach
Copy link
Member

Thanks, @ccordoba12 . I created spyder-ide/spyder-docs#96 to cover this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting ignore rules for Pycodestyle is not working
3 participants