-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR] Auto-record the release
and version
values into the known words list
#224
Comments
Otherwise, `sphinxcontrib.spelling` would complain about `dev` and two/three-letter local version identifier segments as misspelled[[1]]. [1]: sphinx-contrib/spelling#224
Otherwise, `sphinxcontrib.spelling` would complain about `dev` and two/three-letter local version identifier segments as misspelled[[1]]. [1]: sphinx-contrib/spelling#224
Otherwise, `sphinxcontrib.spelling` would complain about `dev` and two/three-letter local version identifier segments as misspelled[[1]]. [1]: sphinx-contrib/spelling#224
Otherwise, `sphinxcontrib.spelling` would complain about `dev` and two/three-letter local version identifier segments as misspelled[[1]]. [1]: sphinx-contrib/spelling#224
As a workaround for myself, I managed to hack together a custom filter that's hooked to one of the Sphinx's events and is set before the |
I don't remember why the interface is a class. It looks like it inherits from something in enchant, so I was probably just trying to be consistent with that. Are you interested in contributing the version filter to this package? |
Maybe someday, if I have time. Meanwhile, I discovered that using the WARNING: cannot cache unpickable configuration value: 'spelling_filters' (because it contains a function, class, or module object) [config.cache] |
In my projects, the version is generated with
setuptools-scm
and thus is derived from Git. For non-tagged commits this means that it has a local specifier part (per PEP 440) which contains a short commit SHA among other things. Like this:10.0.1.dev100+gf84df246
— it makessphinxcontrib-spelling
complain aboutdev
,gf
anddf
not being words.The version is rendered through an RST substitution as in
|release|
. So I can't dobecause then, the substitution doesn't work since the role doesn't interpret it.
Similarly, the following doesn't work either:
because the substitution isn't interpreted.
So the ideal solution for this specific problem would be for the extension to auto-learn the version "word".
A more flexible/generic solutions could include:
conf.py
I suppose using a custom
spelling_filters = [VersionFilter]
can be my workaround (though I haven't yet managed to make it work!) but this interface is not really ergonomic — making a class and a method to make just one comparison seems excessive. Even a regular callable with a signature like(str) -> bool
would be much cleaner.The text was updated successfully, but these errors were encountered: