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
Update README around multi-dictionary changes (#1669)
* Update README around multi-dictionary changes
* Counting grammar fix
* Add back some removed information
* Improve the wording
* More attempts to cover multiple dictionaries in the readme
* Revert another edit about the trailing comma
* Apply suggestions from code review
Co-authored-by: Eric Larson <[email protected]>
Copy file name to clipboardExpand all lines: README.rst
+25-15Lines changed: 25 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,17 +67,19 @@ Display them without terminal colors and with a quiet level of 3. ::
67
67
68
68
Run interactive mode level 3 and write changes to file.
69
69
70
-
We ship a dictionary that is an improved version of the one available
70
+
We ship a collection of dictionaries that are an improved version of the one available
71
71
`on Wikipedia <https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines>`_
72
72
after applying them in projects like Linux Kernel, EFL, oFono among others.
73
73
You can provide your own version of the dictionary, but patches for
74
74
new/different entries are very welcome.
75
75
76
-
Want to know if a word you're proposing exists in codespell already? It is possible to test a word against the current dictionary that exists in ``codespell_lib/data/dictionary.txt`` via::
76
+
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::
77
77
78
78
echo "word" | codespell -
79
79
echo "1stword,2ndword" | codespell -
80
80
81
+
You can select the optional dictionaries with the ``--builtin`` option.
82
+
81
83
Using a config file
82
84
-------------------
83
85
@@ -103,10 +105,8 @@ config file.
103
105
Dictionary format
104
106
-----------------
105
107
106
-
The format of the dictionary was influenced by the one it originally came from,
107
-
i.e. from Wikipedia. The difference is how multiple options are treated and
108
-
that the last argument is the reason why a certain entry could not be applied
109
-
directly, but instead be manually inspected. E.g.:
108
+
The format of the dictionaries was influenced by the one they originally came from,
109
+
i.e. from Wikipedia. The difference is how multiple options are treated. E.g.:
110
110
111
111
1. Simple entry: one wrong word / one suggestion::
112
112
@@ -122,12 +122,17 @@ directly, but instead be manually inspected. E.g.:
122
122
to give the user the file and line where the error occurred as well as
123
123
the suggestions.
124
124
125
-
3. Entry with one word, but with automatically fix disabled::
125
+
3. Entry with one word, but with automatic fix disabled::
126
126
127
127
clas->class, disabled because of name clash in c++
128
128
129
-
Note that there isn't a comma in the end of the line. The last argument is
129
+
Note that there isn't a comma at the end of the line. The last argument is
130
130
treated as the reason why a suggestion cannot be automatically applied.
131
+
132
+
There can also be multiple suggestions but any automatic fix will again be
133
+
disabled::
134
+
135
+
clas->class, clash, disabled because of name clash in c++
131
136
132
137
Development Setup
133
138
-----------------
@@ -147,19 +152,21 @@ If you have a suggested typo that you'd like to see merged please follow these s
147
152
148
153
1. Make sure you read the instructions mentioned in the ``Dictionary format`` section above to submit correctly formatted entries.
149
154
150
-
2. Sort the dictionary. This is done by invoking (in the top level directory of ``codespell/``)::
155
+
2. Choose the correct dictionary file to add your typo too. See `codespell --help` for explanations of the different dictionaries.
156
+
157
+
3. Sort the dictionaries. This is done by invoking (in the top level directory of ``codespell/``)::
151
158
152
159
make check-dictionaries
153
160
154
-
If the make script finds that you need to sort the dictionary, please then run::
161
+
If the make script finds that you need to sort a dictionary, please then run::
155
162
156
163
make sort-dictionaries
157
164
158
-
3. Only after this process is complete do we recommend you submit the PR.
165
+
4. Only after this process is complete do we recommend you submit the PR.
159
166
160
167
**Important Notes:**
161
168
162
-
* If the dictionary is submitted without being pre-sorted the PR will fail via TravisCI.
169
+
* If the dictionaries are submitted without being pre-sorted the PR will fail via our various CI tools.
163
170
* Not all PRs will be merged. This is pending on the discretion of the devs, maintainers, and the community.
164
171
165
172
Updating
@@ -178,16 +185,19 @@ To stay current with codespell developments it is possible to build codespell fr
178
185
* 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.
179
186
* 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).
180
187
181
-
Updating the dictionary
182
-
-----------------------
188
+
Updating the dictionaries
189
+
-------------------------
183
190
184
-
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.txt` file, we recommend running a simple set of commands to achieve this ::
191
+
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 ::
The above simply downloads the latest ``dictionary.txt`` file and then by utilizing the ``-D`` flag allows the user to specify the freshly downloaded ``dictionary.txt`` as the custom dictionary instead of the default one.
190
197
198
+
You can also do the same thing for the other dictionaries listed here:
0 commit comments