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] PyLint doesn't report duplicate-code under Prospector #599

Closed
rpatterson opened this issue Feb 26, 2023 · 4 comments
Closed

[BUG] PyLint doesn't report duplicate-code under Prospector #599

rpatterson opened this issue Feb 26, 2023 · 4 comments

Comments

@rpatterson
Copy link

rpatterson commented Feb 26, 2023

Describe the bug

Running PyLint with jobs = 1 directly reports duplicate-code:

$ pylint ./src/foo/
src/foo/tests/test_bar.py:1:0: R0801: Similar lines in 2 files
==foo.bar:[##:##]
==foo.qux:[##:##]
...

------------------------------------------------------------------
Your code has been rated at 9.93/10 (previous run: 0.00/10, +9.93)

But running it under Prospector reports nothing:

$ prospector ./src/foo/
Check Information
=================
         Started: ####-##-## ##:##:##.######
        Finished: ####-##-## ##:##:##.######
      Time Taken: #.## seconds
       Formatter: grouped
        Profiles: .prospector.yaml, full_pep8, doc_warnings, strictness_veryhigh, member_warnings
      Strictness: from profile
  Libraries Used: 
       Tools Run: bandit, dodgy, mccabe, mypy, profile-validator, pycodestyle, pydocstyle, pyflakes, pylint, vulture
  Messages Found: 0
 External Config: pylint: ./pyproject.toml

Environment:

  • OS: Docker python:3.11 image
  • Tool: PyLint
  • Prospector version: v1.9.0
  • Python version: v3.11.2

Additional context

Note that PyLint doesn't report duplicate-code when running in parallel jobs, whether under Prospector or directly. Hence this requires jobs = 1 or equivalent CLI option.

@rpatterson
Copy link
Author

rpatterson commented Feb 26, 2023

FWIW, I just did a test running directly and independently all the tools that Prospector integrates against a real-world code base and this and the other PyLint and Vulture issues I've opened are the only cases I've found where Prospector fails to report what the tools report when run directly.

rpatterson added a commit to rpatterson/project-structure that referenced this issue Feb 26, 2023
Run Vulture directly and independently because [Prospector misses unused
methods](prospector-dev/prospector#599 (comment)).

This reverts commit 99e58fd.
@menathan
Copy link

Also found that next to duplicate-code pylint doesn't report fixme under Prospector.

https://pylint.pycqa.org/en/latest/user_guide/messages/warning/fixme.html

@sbrunner
Copy link
Member

Issue closed because there are no resent messages, if you are still impacted please,
test with the latest version of Prospector (>= 1.12.1)
and reopen it with a message like "still valid, tested with the version ".

@rpatterson
Copy link
Author

Issue closed because there are no resent messages, if you are still impacted please,
test with the latest version of Prospector (>= 1.12.1)
and reopen it with a message like "still valid, tested with the version ".

In case it helps as real user feedback, when I reported this I moved my use of tools with missing support in prospector out of prospector and used the tools directly. Since then I've run into more issues specific to prospector and moved more out of prospector to the point where I need to know just as much about the gotchas in prospector as I would have to know to use the tools individually and directly. So when I next have time to revisit these issues, I'll be moving away from prospector entirely, not retesting with the most recent version.

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

3 participants