From 18da0a15072f48f7b7197c566ff16bf92608a9eb Mon Sep 17 00:00:00 2001 From: Jon Leech Date: Thu, 27 Jun 2024 22:46:34 -0700 Subject: [PATCH] Update "Using a config file" README entry to document behavior with '-' in value fields See https://github.com/codespell-project/codespell/issues/3474#issuecomment-2193878382 --- README.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.rst b/README.rst index 9d50a33a2c..c138dc1eef 100644 --- a/README.rst +++ b/README.rst @@ -178,6 +178,23 @@ which is read using Python's `configparser `_. For example, comments are possible using ``;`` or ``#`` as the first character. +Values in an INI file entry cannot start with a ``-`` character, so if you need to do this, +structure your entries like this: + +.. code-block:: ini + + [codespell] + dictionary = mydict,- + ignore-words = bar,-foo + +instead of these invalid entries: + +.. code-block:: ini + + [codespell] + dictionary = -,mydict + ignore-words = -foo,bar + Codespell will also check in the current directory for a ``pyproject.toml`` (or a path can be specified via ``--toml ``) file, and the ``[tool.codespell]`` entry will be used, but only if the tomli_ package