From 7d7bb733dd5b5ca32eccfa11a35888e3a6c1a40c Mon Sep 17 00:00:00 2001 From: Peter Cock Date: Mon, 18 Nov 2019 12:00:35 +0000 Subject: [PATCH] v0.0.12 - RST213, RST214 and RST215 with tests 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. --- README.rst | 4 ++++ flake8_rst_docstrings.py | 5 ++++- tests/RST213/emphasis.py | 15 +++++++++++++++ tests/RST214/literal.py | 15 +++++++++++++++ tests/RST215/backticks.py | 15 +++++++++++++++ 5 files changed, 53 insertions(+), 1 deletion(-) create mode 100755 tests/RST213/emphasis.py create mode 100755 tests/RST214/literal.py create mode 100755 tests/RST215/backticks.py diff --git a/README.rst b/README.rst index 64c061e..16eab78 100644 --- a/README.rst +++ b/README.rst @@ -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. ====== ======================================================================= @@ -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 diff --git a/flake8_rst_docstrings.py b/flake8_rst_docstrings.py index 2c7d6bb..71ce986 100644 --- a/flake8_rst_docstrings.py +++ b/flake8_rst_docstrings.py @@ -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__) @@ -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 diff --git a/tests/RST213/emphasis.py b/tests/RST213/emphasis.py new file mode 100755 index 0000000..4afa3e1 --- /dev/null +++ b/tests/RST213/emphasis.py @@ -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") diff --git a/tests/RST214/literal.py b/tests/RST214/literal.py new file mode 100755 index 0000000..47aad41 --- /dev/null +++ b/tests/RST214/literal.py @@ -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") diff --git a/tests/RST215/backticks.py b/tests/RST215/backticks.py new file mode 100755 index 0000000..6045f7a --- /dev/null +++ b/tests/RST215/backticks.py @@ -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")