-
-
Notifications
You must be signed in to change notification settings - Fork 22
Default role does not detect default roles starting with a single quote #40
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
Comments
The regex also doesn't detect default roles that are followed by a $ echo 'This is not detected: (`foo`)' >> buggy.rst; sphinx-lint --enable default-role buggy.rst
No problems found.
$ echo 'This is detected: ( `foo` )' >> buggy.rst; sphinx-lint --enable default-role buggy.rst
buggy.rst:2: default role used (hint: for inline literals, use double backticks) (default-role)
$ echo 'This is not detected: `foo`, `bar`.' >> buggy.rst; sphinx-lint --enable default-role buggy.rst
buggy.rst:2: default role used (hint: for inline literals, use double backticks) (default-role)
$ echo 'This is detected: `foo` , `bar`.' >> buggy.rst; sphinx-lint --enable default-role buggy.rst
buggy.rst:2: default role used (hint: for inline literals, use double backticks) (default-role)
buggy.rst:4: default role used (hint: for inline literals, use double backticks) (default-role)
$ cat buggy.rst
This is not detected: (`foo`)
This is detected: ( `foo` )
This is not detected: `foo`, `bar`.
This is detected: `foo` , `bar`. |
Another real world example I met today: $ echo 'The only supported backend is `"perf"`.' > buggy.rst
$ sphinx-lint --enable default-role buggy.rst
No problems found.
$ echo 'The only supported backend is `perf`.' >> buggy.rst
$ sphinx-lint --enable default-role buggy.rst
No problems found. |
$ echo 'Assignment expressions using the walrus operator `:=` assign a variable' > buggy.rst
$ sphinx-lint --enable default-role buggy.rst
No problems found.
|
JulienPalard
added a commit
that referenced
this issue
Sep 27, 2022
JulienPalard
added a commit
that referenced
this issue
Sep 27, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For example in:
The
default_role_re
(currentlyre.compile('(^| )`\\w([^`]*?\\w)?`($| )')
) won't catch it due to the\W
not matching the quote.The text was updated successfully, but these errors were encountered: