diff --git a/docs/usage.rst b/docs/usage.rst index 1d74c32f..955a0860 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -158,5 +158,19 @@ Running this will check that your project adheres to the contracts you've define lint-imports --verbose +Running using pre-commit +------------------------ + +``import-linter`` can run as a `pre-commit`_ hook by adding this section to your `.pre-commit-config.yaml` file: + +.. code-block:: yaml + + repos: + - repo: https://github.com/seddonym/import-linter + rev: v2.0 + hooks: + - id: import-linter + .. _namespace packages: https://docs.python.org/3/glossary.html#term-namespace-package -.. _portion: https://docs.python.org/3/glossary.html#term-portion \ No newline at end of file +.. _portion: https://docs.python.org/3/glossary.html#term-portion +.. _pre-commit: https://pre-commit.com/index.html