Skip to content

Commit

Permalink
DOC: Add explanation on how to use pre-commit with config file (#968)
Browse files Browse the repository at this point in the history
  • Loading branch information
phofl committed Jan 4, 2023
1 parent d9fe642 commit 91c4d97
Showing 1 changed file with 14 additions and 0 deletions.
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/

0 comments on commit 91c4d97

Please sign in to comment.