Skip to content

Commit

Permalink
RST217 Mismatch: both interpreted text role suffix and reference suffix.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjc committed Nov 18, 2019
1 parent a1d87a5 commit 1dfcd06
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.rst
Expand Up @@ -104,6 +104,7 @@ 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.
RST216 Multiple roles in interpreted text (both prefix and suffix present; only one allowed).
RST217 Mismatch: both interpreted text role suffix and reference suffix.
RST299 Previously unseen warning, not yet assigned a unique code.
====== =======================================================================

Expand Down Expand Up @@ -217,7 +218,7 @@ Version History
======= ========== ===========================================================
Version Released Changes
------- ---------- -----------------------------------------------------------
v0.0.12 2019-11-18 - Adds ``RST213``, ``RST214``, ``RST215`` and ``RST216``.
v0.0.12 2019-11-18 - Adds ``RST213`` to ``RST217``.
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
1 change: 1 addition & 0 deletions flake8_rst_docstrings.py
Expand Up @@ -175,6 +175,7 @@ def tokenize_open(filename):
"Inline literal start-string without end-string.": 14,
"Inline interpreted text or phrase reference start-string without end-string.": 15,
"Multiple roles in interpreted text (both prefix and suffix present; only one allowed).": 16,
"Mismatch: both interpreted text role suffix and reference suffix.": 17,
}

# Level 3 - error
Expand Down
17 changes: 17 additions & 0 deletions tests/RST217/roles.py
@@ -0,0 +1,17 @@
"""Print 'Hello world' to the terminal.
RST uses single backticks or back-quotes for various things including
interpreted text roles and references.
Without a semi-colon prefix or suffix, `example` has the default role.
A prefix like :code:`example` or a suffix like `example`:math: is allowed.
However, trailing underscores have special meaning for referencing, thus
`code`:example:_ is considered to be an error:
$ flake8 --select RST RST217/roles.py
RST217/roles.py:10:1: RST17 Mismatch: both interpreted text role suffix and reference suffix.
"""

print("Hello world")

0 comments on commit 1dfcd06

Please sign in to comment.