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

strictness_medium needs to exclude C0325 from PyLint's output #11

Closed
ssokolow opened this issue Jan 26, 2014 · 5 comments
Closed

strictness_medium needs to exclude C0325 from PyLint's output #11

ssokolow opened this issue Jan 26, 2014 · 5 comments

Comments

@ssokolow
Copy link

Currently, in code written to work in both Python 2.x and Python 3.x, the default strictness_medium profile for prospector causes PyLint to return this error when run under Python 2.x:

run_tests (run_tests.py):
    L41:0 : pylint - C0325
    Unnecessary parens after 'print' keyword
@carlio
Copy link
Member

carlio commented Jan 26, 2014

I've tried this on a (very small) test case and cannot reproduce it. Could you create a test case, or point me at the code you're running prospector against?

@carlio
Copy link
Member

carlio commented Jan 26, 2014

Sorry, ignore me, I was running under Python 3

@ssokolow
Copy link
Author

I just did some testing. You'll have to filter on print as well as C0325 since that code is too generic and is also used for legitimate messes like Unnecessary parens after u'if' keyword

@carlio
Copy link
Member

carlio commented Feb 9, 2014

I've been agonising about this one for a little bit. I think that the problem is a pylint one rather than a prospector one. My own feeling is that print(blah) is a bit suspect in Python 2, and since pylint will not warn if from __future__ import print_statement is used, then the warning is valid.

Having said that, a separate warning for print statements vs other statements would be useful, as there are valid reasons to supress the former without supressing the latter.

Check out the discussion on the code-quality mailing list about this very issue : https://www.mail-archive.com/code-quality@python.org/msg00202.html

I will create a pull request on pylint itself about this to create a new error message, which will make it a lot easier for prospector to ignore. It's not particularly easy to ignore messages based on context right now.

@yarko
Copy link

yarko commented Mar 29, 2014

... just to log it correctly, for the record: it's from __future__ import print_function

@carlio carlio closed this as completed Jul 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants