-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define RST307; wildcard in mappings (#29)
* Allow wildcard in mappings * Define RST307 * Sphinx users may want to ignore RST307 * Include 'invalid' RST307 examples from Sphinx https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html
- Loading branch information
Showing
3 changed files
with
62 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"""Print 'Hello world' to the terminal. | ||
This is a code block with not arguments other | ||
than the format: | ||
.. code:: pycon | ||
>>> print("Hello") | ||
Hello | ||
Now with an invalid code block argument: | ||
.. code:: pycon | ||
:wibble: | ||
>>> print("Hello") | ||
Hello | ||
Here are some actual examples from the Sphinx v4.0.0 | ||
documentation: | ||
.. code-block:: python | ||
:caption: this.py | ||
:name: this-py | ||
print 'Explicit is better than implicit.' | ||
And: | ||
.. code-block:: ruby | ||
:dedent: 4 | ||
some ruby code | ||
Sadly docutils considers all three examples to be invalid: | ||
$ flake8 --select RST RST307/code_invalid_arg.py | ||
RST307/code_invalid_arg.py:14:1: RST307 Error in "code" directive | ||
RST307/code_invalid_arg.py:23:1: RST307 Error in "code-block" directive: | ||
RST307/code_invalid_arg.py:31:1: RST307 Error in "code-block" directive: | ||
""" | ||
|
||
print("Hello world") |