Skip to content

Commit

Permalink
Update README.rst
Browse files Browse the repository at this point in the history
Add an additional "Ignoring Words" section, with internal link from the
"notworthy flags" overview.
  • Loading branch information
andyholmes committed Sep 1, 2022
1 parent e40162e commit a63e622
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,15 @@ Some noteworthy flags::

codespell -w, --write-changes

The ``-w`` flag will actually implement the changes recommended by codespell. Not running with ``-w`` flag is the same as with doing a dry run. It is recommended to run this with the ``-i`` or ``--interactive`` flag.

When ignoring false positives, note that spelling errors are *case-insensitive* but words to ignore are *case-sensitive*. For example, the dictionary entry ``wrod`` will also match the typo ``Wrod``, but to ignore it you must pass ``wrod``.

::
The ``-w`` flag will actually implement the changes recommended by codespell. Not running with ``-w`` flag is the same as with doing a dry run. It is recommended to run this with the ``-i`` or ``--interactive`` flag. ::

codespell -I FILE, --ignore-words=FILE

The ``-I`` flag can be used for a list of certain words to allow that are in the codespell dictionaries. The format of the file is one word per line. Invoke using: ``codespell -I path/to/file.txt`` to execute codespell referencing said list of allowed words. **Important note:** The list passed to ``-I`` is case-sensitive based on how it is listed in the codespell dictionaries. ::
The ``-I`` flag can be used for a list of certain words to allow that are in the codespell dictionaries. The format of the file is one word per line. Invoke using: ``codespell -I path/to/file.txt`` to execute codespell referencing said list of allowed words. See `Ignoring Words`_ for more details. ::

codespell -L word1,word2,word3,word4

The ``-L`` flag can be used to allow certain words that are comma-separated placed immediately after it. **Important note:** The list passed to ``-L`` is case-sensitive based on how it is listed in the codespell dictionaries. ::
The ``-L`` flag can be used to allow certain words that are comma-separated placed immediately after it. See `Ignoring Words`_ for more details. ::

codespell -x FILE, --exclude-file=FILE

Expand Down Expand Up @@ -92,6 +88,21 @@ Want to know if a word you're proposing exists in codespell already? It is possi

You can select the optional dictionaries with the ``--builtin`` option.

Ignoring Words
--------------

When ignoring false positives, note that spelling errors are *case-insensitive* but words to ignore are *case-sensitive*. For example, the dictionary entry ``wrod`` will also match the typo ``Wrod``, but to ignore it you must pass ``wrod``.

The words to ignore can be passed in two ways:

1. ``-I``: A file with a word per line to ignore::

codespell -I FILE, --ignore-words=FILE

2. ``-L``: A comma separated list of words to ignore on the command line::

codespell -L word1,word2,word3,word4

Using a config file
-------------------

Expand Down

0 comments on commit a63e622

Please sign in to comment.