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

Documentation is a little scarce on how to run Prospector with additional dependencies in pre-commit hook. #566

Closed
morgan-pubnub opened this issue Dec 14, 2022 · 2 comments
Milestone

Comments

@morgan-pubnub
Copy link
Contributor

morgan-pubnub commented Dec 14, 2022

This isn't a bug per se but a deficiency in the way the documentation is written with regards to actually getting the additional dependencies to work properly through the pre-commit hook.

The documentation states:

This only installs base prospector - if you also use optional tools, for example bandit or mypy, then you can add them to the hook configuration like so:

repos:
-   repo: https://github.com/PyCQA/prospector
    rev: 1.7.5
    hooks:
    -   id: prospector
        additional_dependencies:
        - ".[with_mypy,with_bandit]"

it should also include:

repos:
-   repo: https://github.com/PyCQA/prospector
    rev: 1.7.5
    hooks:
    -   id: prospector
        additional_dependencies:
        - ".[with_mypy,with_bandit]"
       args: [
         '--with-tool=mypy',
         '--with-tool=bandit',
       ]

If you want to actually have mypy and bandit work properly.

It wouldn't hurt to have an example of their configurations in the prospector.yml file as well.

# https://bandit.readthedocs.io/en/latest/config.html
bandit: 
  options:
    skips:
      - B201
      - B601
      - B610
      - B611
      - B703
  
# https://mypy.readthedocs.io/en/stable/command_line.html
mypy:
  options:
    ignore-missing-imports: true

To Reproduce Steps to reproduce the behavior:

Nothing to reproduce

I'm happy to make a PR with the appropriate modifications

@Pierre-Sassoulas
Copy link
Collaborator

LGTM, I'll merge a PR with the proposed change.

@Pierre-Sassoulas
Copy link
Collaborator

Closed by #571

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

2 participants