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

Can't configure vulture min_confidence in pyproject.toml #244

Open
syserr0r opened this issue May 22, 2023 · 1 comment
Open

Can't configure vulture min_confidence in pyproject.toml #244

syserr0r opened this issue May 22, 2023 · 1 comment

Comments

@syserr0r
Copy link

Vulture option under [tool.pylama.linter.vulture] as min_confidence

The following pyproject.toml that has the min-confidence configuration option specified with hyphens as underscores:

[tool.pylama.linter.vulture]
min_confidence = 80

causes the following output/error when pylama is run:

usage: vulture [options] [PATH ...]
vulture: error: unrecognized arguments: --min_confidence=80

Vulture option under [tool.pylama.linter.vulture] as min-confidence

Running instead with with min-confidence as-is appears to show the correct output but is not shown in VSCode (not sure why):

[tool.pylama.linter.vulture]
min-confidence = 80

output:

src/main/helpers.py:10:1 V104 unused import 'Min' (90% confidence) [vulture]
src/main/helpers.py:10:1 V104 unused import 'Q' (90% confidence) [vulture]
src/main/helpers.py:11:1 C0411 standard import "from typing import Union" should be placed before "from django.db.models import Q, Min" [pylint]
src/main/helpers.py:12:1 W0611 'datetime.date' imported but unused [pyflakes]
src/main/helpers.py:12:1 C0411 standard import "from datetime import date, datetime" should be placed before "from django.db.models import Q, Min" [pylint]
src/main/helpers.py:12:1 V104 unused import 'date' (90% confidence) [vulture]
src/main/helpers.py:12:1 V104 unused import 'datetime' (90% confidence) [vulture]
...

Vulture option specified under [tool.vulture] as min_confidence

Running under [tool.vulture] with underscores half works as above, producing output but not registering in VSCode

[tool.vulture]
min_confidence = 80

Vulture option specified under [tool.vulture] as min-confidence

Running under [tool.vulture] with hyphen produces an error

[tool.vulture]
min_confidence = 80

output:

Unknown configuration key: min-confidence

I'm not sure if I'm doing something wrong or have missed some trick, any advice appreciated.

@syserr0r
Copy link
Author

syserr0r commented May 22, 2023

Interestingly adjusting the Pylama args in VSCode to include --vulture-min-confidence 80 doesn't stop pylama from working correctly but also doesn't change the output (i.e. I still have warnings with confidence under 80%).

The full command that is run during this is: ~/.virtualenvs/<project-name>/bin/python ~/.vscode-server/extensions/ms-python.python-2023.8.0/pythonFiles/linter.py -m pylama "--vulture-min-confidence 80" ./src/main/helpers.py

Edit: Adding in 2 arguments, --vulture-min-confidence and 80 appears to have done the trick, although this is still a work-around I'd prefer to avoid as it makes keeping settings consistent between projects and team members more difficult. (Nope, I can't reproduce this sadly)

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

1 participant