Fix as many spelling mistakes as possible#572
Conversation
|
As a reader of the docs, I noticed a few misspellings, but there ended up being more than I could fix by hand, so I went looking for tools to help. I started out using Vale, but decided on sphinxcontrib-spelling in the end, since the format of the config file ( If you, the maintainers, are not happy with my use of sphinxcontrib-spelling's It seemed inadvisable to do so with words that seemed likely to be actual misspellings or mis-capitalizations elsewhere, like |
6ed2d60 to
f6f0458
Compare
|
Thank you for your contribution. That approach is much appreciated. We will take a closer look soon and come back here. |
|
I am impressed how many typos and spelling errors we've generated - thanks for the effort ... this really looks pretty good - could you please separate the implementation from the actual spelling fixes - then I'd say LGTM. |
You all are writing code and building products and working in two languages, so no judgements from me. I'm happy to be able to help. Is the "implementation" part actually a useful contribution (to submit as a second PR), or… should I simply elide those Makefile modifications altogether? No hard feelings either way. |
|
Thanks, for the kind words :D |
3c5e907 to
416cf9c
Compare
These two new Makefile targets allow you to: - identify potential misspellings with sphinxcontrib-spelling[1] - (optionally) add them to a custom word list, and - loop through all the misspelled files, opening them with your $EDITOR. Run `make check-spelling` (alias: `spell`) to start the process, followed by `make fix-spelling` (aliases: `fix` or `correct`). A list of _correct_ spellings (which will not be flagged by the Sphinx extension) is contained in `wordlist.txt`. The `check-spelling` target gives you the opportunity to update this word list if new (putative) misspellings are identified. The `fix-spelling` target works best with Vim/Neovim. It employs the `hlsearch` and quickfix features to make it easier to find and correct spelling mistakes in the individual source files. For other editors, the misspelled file and the list of misspellings identified by sphinxcontrib-spelling are simply passed as command-line arguments. [1]: https://sphinxcontrib-spelling.readthedocs.io
Uses the `make fix-spelling` target introduced by PR Nitrokey#572
|
|
||
| spelling_word_list_filename = '../wordlist.txt' | ||
| #spelling_show_suggestions = True | ||
| spelling_exclude_patterns = ['**/api/*'] |
There was a problem hiding this comment.
I have excluded the /api subpath for now; it would've been a lot of work, since many of the headings were "misspellings" due to their being API methods and such.
Uses the `make fix-spelling` target introduced by PR Nitrokey#572
@daringer OK, this is done. I would welcome feedback about how useful you think the Vim parts will actually be. If no one on your team uses that editor, then those parts of the Makefile are probably just a maintenance liability. The commit message for ac07841 describes the process I used. I have also updated the README (locally) with the same information, but I'll do that in a separate PR, once this is merged, if that's okay. |
check-spellingandfix-spelling(fix-spellingworks best with the Vim editor)You can run the Make targets like this: