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

[BUG] Supressing pylint errors does not seem to have effect #416

Closed
bechtold opened this issue Apr 30, 2021 · 2 comments
Closed

[BUG] Supressing pylint errors does not seem to have effect #416

bechtold opened this issue Apr 30, 2021 · 2 comments

Comments

@bechtold
Copy link

Describe the bug
I was following this guide to suppress line-too-long errors on a file with loads of lines that have to be too long.
So I added # pylint: disable=line-too-long to the beginning of the file. But the prospector still throws these errors. When I manually run pylint file.py I can confirm that my disabling rule does work as expected.

To Reproduce
Steps to reproduce the behavior:

  1. Create a file (example.py) with a very long line
  2. Add # pylint: disable=line-too-long to the beginning of the file
  3. Call prospector example.py to see the errors
  4. Call pylint example.py to not see the error

Expected behavior
No error should be thrown.

Environment (please complete the following information):

  • OS: macOS Big Sur on M1
  • Tool: pylint
  • Prospector version 1.3.1
  • Python version 3.9.4
DavidMChan added a commit to DavidMChan/prospector that referenced this issue Jun 9, 2021
@DavidMChan
Copy link

Hmm, I'm taking a look at this and #417, and it doesn't seem like I can reproduce the problem (either #416 or #417). I used the file in the gist here: https://gist.github.com/DavidMChan/fcdd696cc8631380a812ebd8a83bb4df, in a folder which is empty except for that folder.

I get the following output:

$ prospector 
Messages
========

module.py
  Line: 3
    pylint: import-error / Unable to import 'this_package_doesnt_exist'
    pylint: unused-import / Unused import this_package_doesnt_exist
  Line: 4
    pep8: E501 / line too long (872 > 159 characters) (col 160)

This does show that pylint silenced the error, however the issue is that pep8 is ignoring the pylint disable definition.

Which tools are you using/what is the exact output of your commands?

I believe that this is expected behavior (Though I have to admit, it would be cool to add the functionality of pylint specific disables to pep8), but to get all of the errors to be suppressed by file, you need to add an additional behavior (adding --ignore=E501 to the prospector/flake8 config, or a #noqa, see: https://stackoverflow.com/questions/18444840/how-to-disable-a-pep8-error-in-a-specific-file).

My debugging folder is here: https://github.com/DavidMChan/prospector/tree/davidmchan/fix-416/tests/finder/testdata/test_single_file_directory

Python: 3.9.4
OS: MacOS Big Sur (11.4, M1)
Prospector Version: 1.3.1

@DanielNoord
Copy link

I think this issue has become stale and the investigation above shows that there might not be an actual bug here. I'd say this can be closed and re-openend if OP (or anybody else) returns with a similar issue.

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

No branches or pull requests

4 participants