Skip to content

Conversation

@ceh
Copy link
Contributor

@ceh ceh commented Jul 14, 2018

There's been a number of misspelled words in the documentation. This PR adds the ability to spell check the documentation via a make target.

Spell checking is implemented by adding a Sphinx spell check extension: http://sphinxcontrib-spelling.readthedocs.io/en/latest/

We use a dictionary file which contains words that are known to be spelled correctly, such as "mypy" and "Dataclasses".

Sample output:

$ make spellcheck
sphinx-build -b spelling -d build/doctrees   source build/spellcheck
Running Sphinx v1.7.5
Initializing Spelling Checker
loading pickled environment... done
Ignoring wiki words
Ignoring acronyms
Ignoring Python builtins
Ignoring importable module names
Looking for custom word list in /Users/ceh/src/python/mypy/docs/source/../dictionary.txt
building [mo]: targets for 0 po files that are out of date
building [spelling]: all documents
updating environment: [config changed] 29 added, 0 changed, 0 removed
reading sources... [100%] type_inference_and_annotations                                                                                                                           
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
installed_packages.rst:101:interpeter:["interpreter", "inter peter", "interpersonal", "interpenetrates", "interpreted", "interpretor"]                                             
more_types.rst:476:discrepency:["discrepancy", "discrepant", "discreteness", "discretionary", "discreetness"]                                                                      
writing output... [100%] type_inference_and_annotations                                                                                                                            
Spelling checker messages written to /Users/ceh/src/python/mypy/docs/build/spellcheck/output.txt
WARNING: Found 2 misspelled words
build succeeded, 1 warnings.

Spell check complete; look for any errors in the above output, or in build/spellcheck/output.txt.

The two misspelled words reported in the output are fixed in #5355

What do you think?

fallback
genericity
indices
ing
Copy link
Contributor Author

@ceh ceh Jul 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for ”await-ing” in

expect to get back when ``await``-ing the coroutine.

Which is a bit weird, and showcases the downside that the dictionary file would be need to be continuously maintained and updated.

@gvanrossum
Copy link
Member

FWIW I don’t believe in batch spell checking. IMO it’s up to the text editor. But it’s Jukka’s docs so maybe he likes it?

@emmatyping
Copy link
Member

If we do go ahead with this, it would be a good idea to add it to CI, so that we are all using it consistently.

@gvanrossum
Copy link
Member

add it to CI

Yes, that would be the way to go, but I worry that we'd end up constantly updating the dictionary to teach it about words like unparameterized or unannotated...

@emmatyping
Copy link
Member

emmatyping commented Jul 15, 2018

I worry that we'd end up constantly updating the dictionary to teach it about words like unparameterized or unannotated...

I'm not particularly worried about that actually. 2000 or so words make up about 80% of all words used in a day. I expect for a technical document that is likely a lower percentage, but I don't think that much new vocabulary will be introduced. Of course, we can always try this, and if we find it annoying, rip it out.

@ceh
Copy link
Contributor Author

ceh commented Jul 23, 2018

Any final thoughts on the general idea, or should we just close this PR for now given the low traction?

@emmatyping
Copy link
Member

Any final thoughts on the general idea, or should we just close this PR for now given the low traction?

I think we are waiting on @JukkaL to give an opinion. I don't see a problem with leaving this open for a while, unless you would like to withdraw this PR, in which case it is of course your prerogative to close it if you wish.

@JukkaL
Copy link
Collaborator

JukkaL commented Jul 23, 2018

This seems like a reasonable idea to me -- we've had a lot of spelling mistakes, and catching them all without some automation is hard. If this turns out to be too noisy, we can turn this off. I'll play around with this a bit before merging (this might have to wait for a few weeks, since I'm going to be on vacation).

@ceh ceh mentioned this pull request Aug 11, 2018
@ceh ceh closed this Sep 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants