From 6f44a9e874f24cbfdf1bc3c2cddaa3773ce078d0 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Sun, 11 Dec 2022 21:25:05 -0500 Subject: [PATCH] Add section about `pre-commit` Add a section to the README about how to set up a pre-commit hook for codespell. --- README.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.rst b/README.rst index 69e9fee088..d3b49e06ec 100644 --- a/README.rst +++ b/README.rst @@ -154,6 +154,29 @@ config files. .. _tomli: https://pypi.org/project/tomli/ +`pre-commit `_ hook +-------------------------------------------- + +codespell also works with `pre-commit`, using + +.. code-block:: yaml + + - repo: https://github.com/codespell-project/codespell + rev: v2.2.2 + hooks: + - id: codespell + +If one configures codespell using the `pyproject.toml` file instead use: + +.. code-block:: yaml + + - repo: https://github.com/codespell-project/codespell + rev: v2.2.2 + hooks: + - id: codespell + additional_dependencies: + - tomli + Dictionary format -----------------