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] prospector should warn about unknown options #455

Closed
rnestler opened this issue Oct 25, 2021 · 4 comments
Closed

[BUG] prospector should warn about unknown options #455

rnestler opened this issue Oct 25, 2021 · 4 comments

Comments

@rnestler
Copy link
Contributor

rnestler commented Oct 25, 2021

Describe the bug
If I have a typo in my configuration options (or try to use an unexisting option), I'd expect that prospector raises a warning or an error.

To find out how to configure mypy I had to look at the source at https://github.com/PyCQA/prospector/blob/master/prospector/tools/mypy/__init__.py until I found out that I need to do

mypy:
  options:
    warn:
      - unreachable

Instead of

mypy:
  options:
    warn-unreachable: true

To Reproduce
Steps to reproduce the behavior:

  1. Add an unexisting option to .prospector.yaml
  2. Run prospector
  3. prospector just ignores it

Expected behavior
Prospector should warn or raise an error

Environment (please complete the following information):

  • OS: Linux
  • Tool mypy
  • Prospector version 1.5.1
  • Python version 3.8.10

Additional context
It would have helped me enormously if there was a verbose or debug mode, where I could see how exactly mypy gets called.

@adamcunnington-gdt
Copy link

(and the docs need to be more exhaustive)

@AtomScott
Copy link

I'm having a lot of trouble configuring mypy. I think warning about unknown options would be a good idea. The docs need to be more exhaustive too.

How would one go implement such warnings?

@carlio
Copy link
Contributor

carlio commented Mar 1, 2022

I'm not familiar with mypy nor did I write the prospector mypy integration so I'm not 100% sure what each of the options do. However, I have added an exception which is raised if an option is not recognised, along with a unit test to validate it: c163370

@AtomScott or others, if you would like to improve the documentation and add more robust testing for other value parsing issues in the mypy tool, please go ahead and raise a PR. The commit above should help point you at the right place to start, but if you have questions please ask!

@carlio carlio closed this as completed Mar 1, 2022
@sbrunner
Copy link
Member

sbrunner commented Mar 7, 2022

Are you sure that the list is exhaustive?
In the documentation I see many options starting with e.g. warn-* that's not in the list...
https://mypy.readthedocs.io/en/stable/command_line.html#configuring-warnings

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

5 participants