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

DOC: Add explanation on how to use pre-commit with config file #968

Merged
merged 1 commit into from
Jan 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions doc/source/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@ the file's path explicitly with `--ini` option, e.g.

bandit --ini tox.ini

If Bandit is used via `pre-commit`_ and a config file, you have to specify the config file
and optional additional dependencies in the `pre-commit`_ configuration:

.. code-block:: yaml

repos:
- repo: https://github.com/PyCQA/bandit
rev: '' # Update me!
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
additional_dependencies: ["bandit[toml]"]

Exclusions
----------

Expand Down Expand Up @@ -281,3 +294,4 @@ configuring each one.

.. _YAML: https://yaml.org/
.. _plugin test list: plugins/index.html
.. _pre-commit: https://pre-commit.com/