Skip to content

Commit

Permalink
v0.0.12 - RST213, RST214 and RST215 with tests
Browse files Browse the repository at this point in the history
These are all examples fitting the pattern:

'Inline %s start-string without end-string.'

Raised in docutils/parsers/rst/states.py

Noted in passing on GitHub issue #18.
  • Loading branch information
peterjc committed Nov 18, 2019
1 parent f8e6a83 commit 7d7bb73
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ RST208 Option list ends without a blank line; unexpected unindent.
RST210 Inline strong start-string without end-string.
RST211 Blank line required after table.
RST212 Title underline too short.
RST213 Inline emphasis start-string without end-string.
RST214 Inline literal start-string without end-string.
RST215 Inline interpreted text or phrase reference start-string without end-string.
RST299 Previously unseen warning, not yet assigned a unique code.
====== =======================================================================

Expand Down Expand Up @@ -213,6 +216,7 @@ Version History
======= ========== ===========================================================
Version Released Changes
------- ---------- -----------------------------------------------------------
v0.0.12 2019-11-18 - Adds ``RST213``, ``RST214`` and ``RST215``.
v0.0.11 2019-08-07 - Configuration options to define additional directives and
roles (e.g. from Sphinx) for ``RST303`` and ``RST304``.
v0.0.10 2019-06-17 - Fixed flake8 "builtins" parameter warning (contribution
Expand Down
5 changes: 4 additions & 1 deletion flake8_rst_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def tokenize_open(filename):
import restructuredtext_lint as rst_lint


__version__ = "0.0.11"
__version__ = "0.0.12"


log = logging.getLogger(__name__)
Expand Down Expand Up @@ -171,6 +171,9 @@ def tokenize_open(filename):
"Inline strong start-string without end-string.": 10,
"Blank line required after table.": 11,
"Title underline too short.": 12,
"Inline emphasis start-string without end-string.": 13,
"Inline literal start-string without end-string.": 14,
"Inline interpreted text or phrase reference start-string without end-string.": 15,
}

# Level 3 - error
Expand Down
15 changes: 15 additions & 0 deletions tests/RST213/emphasis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Print 'Hello world' to the terminal.
RST uses single asterisks for **emphasis**, which is
normally rendered as **italics**.
Here *emphasis is missing a closing asterisk.
That is considered to be an error, and should fail::
$ flake8 --select RST RST213/emphasis.py
RST213/emphasis.py:7:1: RST213 Inline emphasis start-string without end-string.
"""

print("Hello world")
15 changes: 15 additions & 0 deletions tests/RST214/literal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Print 'Hello world' to the terminal.
RST uses double backticks for ``literals`` like code
snippets.
Here ``literal is missing the closing backticks.
That is considered to be an error, and should fail::
$ flake8 --select RST RST214/literal.py
RST214/literal.py:7:1: RST214 Inline emphasis start-string without end-string.
"""

print("Hello world")
15 changes: 15 additions & 0 deletions tests/RST215/backticks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Print 'Hello world' to the terminal.
RST uses single backticks or back-quotes for various
things including interpreted text roles and references.
Here `example is missing a closing backtick.
That is considered to be an error, and should fail::
$ flake8 --select RST RST215/backticks.py
RST215/backticks.py:7:1: RST215 Inline interpreted text or phrase reference start-string without end-string.
"""

print("Hello world")

0 comments on commit 7d7bb73

Please sign in to comment.