mirror of
https://github.com/codespell-project/codespell.git
synced 2025-05-17 15:36:17 +08:00
Update README.rst
Update the README to elaborate on case-sensitivity in ignored words and dictionaries. Add an additional "Ignoring Words" section, with internal link from the "noteworthy flags" overview. Co-authored-by: Peter Newman <peternewman@users.noreply.github.com> Co-authored-by: Dimitri Papadopoulos Orfanos <3234522+DimitriPapadopoulos@users.noreply.github.com>
This commit is contained in:

committed by
Dimitri Papadopoulos Orfanos

parent
8f0e987cd8
commit
29a74789c3
25
README.rst
25
README.rst
@ -55,19 +55,19 @@ Some noteworthy flags:
|
||||
|
||||
codespell -w, --write-changes
|
||||
|
||||
The ``-w`` flag will actually implement the changes recommended by codespell. Running without the ``-w`` flag is the same as with doing a dry run. It is recommended to run this with the ``-i`` or ``--interactive`` flag.
|
||||
The ``-w`` flag will actually implement the changes recommended by codespell. Running without the ``-w`` flag is the same as doing a dry run. It is recommended to run this with the ``-i`` or ``--interactive`` flag.
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
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.
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
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.
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
@ -116,6 +116,25 @@ 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:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
codespell -I FILE, --ignore-words=FILE
|
||||
|
||||
2. ``-L``: A comma separated list of words to ignore on the command line:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
codespell -L word1,word2,word3,word4
|
||||
|
||||
Using a config file
|
||||
-------------------
|
||||
|
||||
|
Reference in New Issue
Block a user