prospector icon indicating copy to clipboard operation
prospector copied to clipboard

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

Open rpatterson opened this issue 2 years ago • 2 comments

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 avatar Feb 26 '23 16:02 rpatterson

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 avatar Feb 26 '23 16:02 rpatterson

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

menathan avatar Oct 27 '23 08:10 menathan

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 ".

sbrunner avatar Oct 11 '24 10:10 sbrunner

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.

rpatterson avatar Oct 13 '24 04:10 rpatterson