-
Notifications
You must be signed in to change notification settings - Fork 8
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
New Option: Configurable RST Substitutions #62
New Option: Configurable RST Substitutions #62
Conversation
Allow to add user-defined RST substitutions that don't throw error code RST305.
153c276
to
577f17a
Compare
This sounds reasonable. Note to self: If we switch the backend to |
Glad to hear that you find it reasonable. I hope I did everything correctly. I'm not sure how to handle the Code Climate error. |
I'm not too bothered about the CodeClimate warning. We could combine the three if statements into a single What I would like to see is at least one test case using the new functionality though, something like the roles and directives test in |
Add a test case to `test_all.py` that checks whether ignoring undefined substitutions (RST305) works.
3f11d43
to
0208203
Compare
Just tell me if you want to have more test cases (now there is really only one test case) or if you want anything else to be done. |
That looks good, and worth calling this the v0.2.6 release 👍 |
Released, thank you. |
Thank you for accepting my PR and your fast respond 😉 |
I forgot to ask, would you like to be acknowledged in the release notes (see previous examples)? |
Oh, this would be kind. Yes, thank you! |
Related to Issues #7 and #10 and PR #16.
As bskinn explained in #10, RST allows the definition of substition sequences. Commonly used substitutions can be put into
rst_epilog
(orrst_prolog
) of Sphinx'conf.py
file. However, RST does not know about these definitions inconf.py
and thus flake8 throws anRST305 Undefined substitution referenced: "XXX"
error.You could add RST305 to the list of ignored error codes or ignore it via flake8's per-file-igonres, like bskinn did. However these ways of ignoring the error code are quite coarse and you would not be warned if you indeed referenced an undefined substitution in one of the files.
Therefore, I suggest to add a config option
rst-substitutions
where users can enter self-defined substitutions to suppress error code RST305, similar torst-directives
andrst-roles
introduced in #16.