Skip to content

Commit a1d87a5

Browse files
committed
RST216 Multiple roles in interpreted text
1 parent 7d7bb73 commit a1d87a5

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
@@ -103,6 +103,7 @@ RST212 Title underline too short.
103103
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.
106+
RST216 Multiple roles in interpreted text (both prefix and suffix present; only one allowed).
106107
RST299 Previously unseen warning, not yet assigned a unique code.
107108
====== =======================================================================
108109

@@ -216,7 +217,7 @@ Version History
216217
======= ========== ===========================================================
217218
Version Released Changes
218219
------- ---------- -----------------------------------------------------------
219-
v0.0.12 2019-11-18 - Adds ``RST213``, ``RST214`` and ``RST215``.
220+
v0.0.12 2019-11-18 - Adds ``RST213``, ``RST214``, ``RST215`` and ``RST216``.
220221
v0.0.11 2019-08-07 - Configuration options to define additional directives and
221222
roles (e.g. from Sphinx) for ``RST303`` and ``RST304``.
222223
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
@@ -174,6 +174,7 @@ def tokenize_open(filename):
174174
"Inline emphasis start-string without end-string.": 13,
175175
"Inline literal start-string without end-string.": 14,
176176
"Inline interpreted text or phrase reference start-string without end-string.": 15,
177+
"Multiple roles in interpreted text (both prefix and suffix present; only one allowed).": 16,
177178
}
178179

179180
# Level 3 - error

tests/RST216/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, :code:`example`:math: with both prefix and suffix is considered to be
10+
an error and should fail validation:
11+
12+
$ flake8 --select RST RST216/roles.py
13+
RST216/roles.py:10:1: RST216 Multiple roles in interpreted text (both prefix and suffix present; only one allowed).
14+
15+
"""
16+
17+
print("Hello world")

0 commit comments

Comments
 (0)