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

only one error of each type per line #30

Closed
techdragon opened this issue Jun 30, 2014 · 2 comments
Closed

only one error of each type per line #30

techdragon opened this issue Jun 30, 2014 · 2 comments

Comments

@techdragon
Copy link

just noticed that the linter appears to not display multiple instances of an error on the same page.

if i have

import json, pprint, 

a = 1
b = 1
print a + b

I will get 2 errors, one E401, and one W0611 for pprint.
However I should have 3, E401, W0611 for json, and W0611 for pprint.

Prospector seems to be swallowing multiple instances of errors on the same line.

@carlio
Copy link
Member

carlio commented Jul 7, 2014

There's a special case for pylint to collapse multiple unused imports into one message. This came about because of from foo import * could cause 100 unused import warnings. However, from your example, I agree there should be one per unused import when multiple imports are explicitly specified. I'll change the logic to only collapse if a * import is used.

@techdragon
Copy link
Author

Wouldn't it be best to throw the warning that import * is wrong and silence further errors from the import statement instead of actually checking for all the unused imported results of an import * statement? It's pretty much universally accepted that import * is bad code! is it actually necessary to check what it imports and use those results? It should either be replaced with explicit imports or a library/module import and use of the module/library prefix. 

Sent from Molto for iPad

From: carlio
Sent: Tuesday, July 08, 2014 01:08 am
To: landscapeio/prospector
Cc: Samuel Bishop
Subject: Re: [prospector] only one error of each type per line (#30)

There's a special case for pylint to collapse multiple unused imports into one message. This came about because of from foo import * could cause 100 unused import warnings. However, from your example, I agree there should be one per unused import when multiple imports are explicitly specified. I'll change the logic to only collapse if a * import is used.


Reply to this email directly or view it on GitHub.

@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

2 participants