Skip to content

Commit 1dfcd06

Browse files
committed
RST217 Mismatch: both interpreted text role suffix and reference suffix.
1 parent a1d87a5 commit 1dfcd06

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

README.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ RST213 Inline emphasis start-string without end-string.
104104
RST214 Inline literal start-string without end-string.
105105
RST215 Inline interpreted text or phrase reference start-string without end-string.
106106
RST216 Multiple roles in interpreted text (both prefix and suffix present; only one allowed).
107+
RST217 Mismatch: both interpreted text role suffix and reference suffix.
107108
RST299 Previously unseen warning, not yet assigned a unique code.
108109
====== =======================================================================
109110

@@ -217,7 +218,7 @@ Version History
217218
======= ========== ===========================================================
218219
Version Released Changes
219220
------- ---------- -----------------------------------------------------------
220-
v0.0.12 2019-11-18 - Adds ``RST213``, ``RST214``, ``RST215`` and ``RST216``.
221+
v0.0.12 2019-11-18 - Adds ``RST213`` to ``RST217``.
221222
v0.0.11 2019-08-07 - Configuration options to define additional directives and
222223
roles (e.g. from Sphinx) for ``RST303`` and ``RST304``.
223224
v0.0.10 2019-06-17 - Fixed flake8 "builtins" parameter warning (contribution

flake8_rst_docstrings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ def tokenize_open(filename):
175175
"Inline literal start-string without end-string.": 14,
176176
"Inline interpreted text or phrase reference start-string without end-string.": 15,
177177
"Multiple roles in interpreted text (both prefix and suffix present; only one allowed).": 16,
178+
"Mismatch: both interpreted text role suffix and reference suffix.": 17,
178179
}
179180

180181
# Level 3 - error

tests/RST217/roles.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""Print 'Hello world' to the terminal.
2+
3+
RST uses single backticks or back-quotes for various things including
4+
interpreted text roles and references.
5+
6+
Without a semi-colon prefix or suffix, `example` has the default role.
7+
A prefix like :code:`example` or a suffix like `example`:math: is allowed.
8+
9+
However, trailing underscores have special meaning for referencing, thus
10+
`code`:example:_ is considered to be an error:
11+
12+
$ flake8 --select RST RST217/roles.py
13+
RST217/roles.py:10:1: RST17 Mismatch: both interpreted text role suffix and reference suffix.
14+
15+
"""
16+
17+
print("Hello world")

0 commit comments

Comments
 (0)