Skip to content

Commit 77efbf4

Browse files
committed
Define RST218 Literal block expected; none found.
1 parent 670ca1b commit 77efbf4

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ 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).
107107
RST217 Mismatch: both interpreted text role suffix and reference suffix.
108+
RST218 Literal block expected; none found.
108109
RST299 Previously unseen warning, not yet assigned a unique code.
109110
====== =======================================================================
110111

@@ -218,6 +219,7 @@ Version History
218219
======= ========== ===========================================================
219220
Version Released Changes
220221
------- ---------- -----------------------------------------------------------
222+
v0.0.13 2019-12-26 - Adds ``RST218``.
221223
v0.0.12 2019-11-18 - Adds ``RST213`` to ``RST217``.
222224
v0.0.11 2019-08-07 - Configuration options to define additional directives and
223225
roles (e.g. from Sphinx) for ``RST303`` and ``RST304``.

flake8_rst_docstrings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ def tokenize_open(filename):
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, # noqa: E501
178178
"Mismatch: both interpreted text role suffix and reference suffix.": 17,
179+
"Literal block expected; none found.": 18,
179180
}
180181

181182
# Level 3 - error

tests/RST218/no_literal_block.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""Print 'Hello world' to the terminal.
2+
3+
RST uses double colons to indicate the following
4+
indented text is a literal block. The following
5+
code snippet is a typical usage::
6+
7+
$ flake8 --select RST RST218/no_literal_block.py
8+
RST218/no_literal_block.py:14:1: RST218 Literal block expected; none found.
9+
10+
This file triggers an error because this paragraph
11+
says there should be a following literal block, but
12+
there is none::
13+
"""
14+
15+
print("Hello world")

0 commit comments

Comments
 (0)