You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+47-21Lines changed: 47 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,9 @@ Python 3.7 or above.
25
25
Installation
26
26
------------
27
27
28
-
You can use ``pip`` to install codespell with e.g.::
28
+
You can use ``pip`` to install codespell with e.g.:
29
+
30
+
.. code-block:: sh
29
31
30
32
pip install codespell
31
33
@@ -36,31 +38,31 @@ For more in depth info please check usage with ``codespell -h``.
36
38
37
39
Some noteworthy flags:
38
40
39
-
::
41
+
.. code-block:: sh
40
42
41
43
codespell -w, --write-changes
42
44
43
45
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.
44
46
45
-
::
47
+
.. code-block:: sh
46
48
47
49
codespell -I FILE, --ignore-words=FILE
48
50
49
51
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.
50
52
51
-
::
53
+
.. code-block:: sh
52
54
53
55
codespell -L word1,word2,word3,word4
54
56
55
57
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.
56
58
57
-
::
59
+
.. code-block:: sh
58
60
59
61
codespell -x FILE, --exclude-file=FILE
60
62
61
63
Ignore whole lines that match those in ``FILE``. The lines in ``FILE`` should match the to-be-excluded lines exactly.
62
64
63
-
::
65
+
.. code-block:: sh
64
66
65
67
codespell -S, --skip=
66
68
@@ -73,14 +75,14 @@ Comma-separated list of files to skip. It accepts globs as well. Examples:
List all typos found except translation files and some directories.
81
83
Display them without terminal colors and with a quiet level of 3.
82
84
83
-
::
85
+
.. code-block:: sh
84
86
85
87
codespell -i 3 -w
86
88
@@ -92,7 +94,9 @@ after applying them in projects like Linux Kernel, EFL, oFono among others.
92
94
You can provide your own version of the dictionary, but patches for
93
95
new/different entries are very welcome.
94
96
95
-
Want to know if a word you're proposing exists in codespell already? It is possible to test a word against the current set dictionaries that exist in ``codespell_lib/data/dictionary*.txt`` via::
97
+
Want to know if a word you're proposing exists in codespell already? It is possible to test a word against the current set dictionaries that exist in ``codespell_lib/data/dictionary*.txt`` via:
98
+
99
+
.. code-block:: sh
96
100
97
101
echo"word"| codespell -
98
102
echo"1stword,2ndword"| codespell -
@@ -107,7 +111,9 @@ Command line options can also be specified in a config file.
107
111
When running ``codespell``, it will check in the current directory for a file
108
112
named ``setup.cfg`` or ``.codespellrc`` (or a file specified via ``--config``),
109
113
containing an entry named ``[codespell]``. Each command line argument can
110
-
be specified in this file (without the preceding dashes), for example::
114
+
be specified in this file (without the preceding dashes), for example:
115
+
116
+
.. code-block:: ini
111
117
112
118
[codespell]
113
119
skip = *.po,*.ts,./src/3rdParty,./src/Test
@@ -117,14 +123,18 @@ be specified in this file (without the preceding dashes), for example::
117
123
Codespell will also check in the current directory for a ``pyproject.toml``
118
124
(or a path can be specified via ``--toml <filename>``) file, and the
119
125
``[tool.codespell]`` entry will be used as long as the tomli_ package
@@ -181,15 +191,21 @@ applied directly, but should instead be manually inspected. E.g.:
181
191
Development Setup
182
192
-----------------
183
193
184
-
As suggested in the `Python Packaging User Guide`_, ensure ``pip``, ``setuptools``, and ``wheel`` are up to date before installing from source. Specifically you will need recent versions of ``setuptools`` and ``setuptools_scm``::
194
+
As suggested in the `Python Packaging User Guide`_, ensure ``pip``, ``setuptools``, and ``wheel`` are up to date before installing from source. Specifically you will need recent versions of ``setuptools`` and ``setuptools_scm``:
* It has been reported that after installing from ``pip``, codespell can't be located. Please check the $PATH variable to see if ``~/.local/bin`` is present. If it isn't then add it to your path.
236
260
* If you decide to install via ``pip`` then be sure to remove any previously installed versions of codespell (via your platform's preferred app manager).
237
261
238
262
Updating the dictionaries
239
263
-------------------------
240
264
241
-
In the scenario where the user prefers not to follow the development version of codespell yet still opts to benefit from the frequently updated dictionary files, we recommend running a simple set of commands to achieve this::
265
+
In the scenario where the user prefers not to follow the development version of codespell yet still opts to benefit from the frequently updated dictionary files, we recommend running a simple set of commands to achieve this:
0 commit comments