Skip to content

Commit

Permalink
docs: add the documentation of the new inline ignore comments (#3390)
Browse files Browse the repository at this point in the history
  • Loading branch information
12rambau authored Mar 26, 2024
1 parent 93d8c5a commit a6b4e1e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,27 @@ The words to ignore can be passed in two ways:
codespell -L word1,word2,word3,word4
Inline ignore
-------------

Some situation might require ignoring a specific word in a specific location. This can be achieved by adding a comment in the source code.
You can either ignore a single word or a list of words. The comment should be in the format of ``# codespell:ignore <words>``.
Words should be separated by a comma.

1. ignore specific word:

.. code-block:: python
def wrod() # codespell:ignore wrod
pass
2. ignore multiple words:

.. code-block:: python
def wrod(wrods) # codespell:ignore
pass
Using a config file
-------------------

Expand Down

0 comments on commit a6b4e1e

Please sign in to comment.