summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorYuriy Andamasov <yuriy@vyos.io>2026-05-14 00:44:52 +0300
committerYuriy Andamasov <yuriy@vyos.io>2026-05-14 00:44:52 +0300
commit6628b2901933f67568ba68617ee27c6f843c6dcf (patch)
treeba5e0b2c15b976fabf5d5a717ea3b739ce4a89ac /docs
parentcc1b4d7c28272786e39a11b37a3ca22b80b12eec (diff)
downloadvyos-documentation-6628b2901933f67568ba68617ee27c6f843c6dcf.tar.gz
vyos-documentation-6628b2901933f67568ba68617ee27c6f843c6dcf.zip
ci(doc-linter): fix RST code-block exit on short dedented lines
The dedent check inside `handle_file_action()` was if in_rst_codeblock: if len(line) > rst_codeblock_indent and not line[rst_codeblock_indent].isspace(): in_rst_codeblock = False This worked only when the next line was at least `rst_codeblock_indent + 1` chars long — the indexing `line[rst_codeblock_indent]` requires that. A short dedented line (e.g., a single character at column 0 under a directive indented at column 4) failed the length guard and `in_rst_codeblock` stayed True. The block remained open longer than it should, suppressing line-length checks on subsequent prose until either EOF or the next `.. code-block::` reset the state. Replace with a leading-whitespace-count check: on any non-blank line, exit the block when leading-ws is <= the directive's column. Blank lines don't reset the block context. Test: a 3-line file with `.. code-block:: text` directive at col 0, one body line, a single `a` at col 0, then a 113-char line at col 0. With the old logic the long line is still treated as inside the code block and not flagged. With the new logic the single-`a` dedent exits the block and the long line is flagged as expected. Tracked as items 6 and 12 of the rolling-side cleanup backlog from PR #2014 / #2019 / #2020 reviews. 🤖 Generated by [robots](https://vyos.io)
Diffstat (limited to 'docs')
0 files changed, 0 insertions, 0 deletions