prospector icon indicating copy to clipboard operation
prospector copied to clipboard

Vulture configuration in pyproject.toml ignored

Open noctuid opened this issue 3 years ago • 6 comments

Describe the bug Similar to #485 (which was not fixed for me on 1.7.6), vulture configuration in the pyproject.toml file is ignored.

To Reproduce Run poetry run prospector in a project with a pyproject.toml that has vulture configuration (e.g. ignore-decorators configuration for @app.get, @app.post, etc.). I get vulture warnings about unused functions from prospector even though poetry run vulture <file> gives no warnings.

Expected behavior Prospector should use any vulture configuration in the pyproject.toml.

Environment

  • OS: Windows
  • Tool: vulture
  • Prospector version: 1.7.6
  • Python version: 3.10.2

noctuid avatar Mar 30 '22 23:03 noctuid

Similar issue encountered with pydocstyle.

e.g.

[tool.pydocstyle]
# http://www.pydocstyle.org/en/stable/error_codes.html
ignore = [
    'D104', # Missing docstring in public package
    'D200', # One-line docstring should fit on one line with quotes
    'D212', # Multi-line docstring summary should start at the first line
]

Isn't picked-up...

songololo avatar May 01 '22 20:05 songololo

hi guys, any news on this? At the moment i can't use vulture with prospector because i need to ignore some decorators, anyway there are any workaround?

gasbasd avatar Feb 14 '23 12:02 gasbasd

Similar issue encountered with pydocstyle.

e.g.

[tool.pydocstyle]
# http://www.pydocstyle.org/en/stable/error_codes.html
ignore = [
    'D104', # Missing docstring in public package
    'D200', # One-line docstring should fit on one line with quotes
    'D212', # Multi-line docstring summary should start at the first line
]

Isn't picked-up...

Same here on Python 3.10, prospector==1.9.0 and pydocstyle==6.3.0.

nicoloverardo avatar Mar 16 '23 04:03 nicoloverardo

This is a "did you try to restart?" comment, so please don't be offended.

I was troubleshooting the same error the OP has for an hour or so when I realized, that there was a stray .pylintrc in the working tree. I don't know how it got there since I haven't used that config style in ages, however, removing it fixed the problem for me. So, maybe double check your file listing.

Teagum avatar Dec 15 '23 08:12 Teagum

But this ticket isn't about pylint?

noctuid avatar Dec 15 '23 14:12 noctuid

@noctuid I think the point Teagum is making is that if prospector is picking up vulture-specific config first somewhere else, it'll ignore the pyproject.toml stuff, so check in case you have any leftovers from previous configuration in case that will fix it.

Regarding this bug I'm sorry that it escaped my notice, I'll try to get around to dealing with it properly, been a bit busy with life...

If you want to have a go yourself and create a PR that'd be great, have a look here to start : https://github.com/landscapeio/prospector/blob/master/prospector/tools/vulture/init.py#L68

carlio avatar Dec 15 '23 14:12 carlio