Skip to content

ci(lint): integrate rstcheck linter and resolve existing warnings - #7128

Merged
blackboxsw merged 5 commits into
canonical:mainfrom
nryanl:rstcheck
Oct 5, 2026
Merged

blackboxsw merged 5 commits into
canonical:mainfrom
nryanl:rstcheck

Conversation

@nryanl

@nryanl nryanl commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator
docs: integrate rstcheck linter and resolve existing warnings

- Add rstcheck to tox.ini [testenv:doc] target
- Add missing lexer types to .rst code-block directives
- Resolved style-related .rstcheck warnings

Additional Context

rstcheck will now run as part of $ tox -e doc to improve quality of .rst files in our documentation. In addition, existing warnings as part of integration were resolved, including:

  • code-block directives missing lexer types, e.g. .. code-block:: [lexer-type] now have appropriate types.
  • Resolved "Document may not end with transition" warnings that would remove existing styling by adding a comment to sections after the "ending transition".
  • Added rstcheck ignore comments for specific code blocks that use non-standard syntax or placeholders.

Test Steps

tox -e doc / .tox/doc/bin/python -m rstcheck --recursive doc/

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

@github-actions github-actions Bot added the documentation This Pull Request changes documentation label Oct 1, 2026

@blackboxsw blackboxsw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @nryanl. Ttwo notes on this before we proceed:

  1. Let's not raise log level to WARNING if we can avoid it because that may hide real misconfiguration information we care about.
  2. I think we should be intentional about each type of INFO level issue we are ignoring and that approach will either be a blanket ignore_messages option for high-frequency lints or a specific ignore statements we add to each specific file around that specific info message we are trying to ignore.

If we don't make our ignores specific to individ cases, as already shown in your existing ignore_messages values, we don't know what class of lints we have squelched.

--------------------------------------------

.. code-block:: yaml
.. code-block:: text

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be jinja not text.

Comment thread pyproject.toml Outdated
convention = "pep257"

[tool.rstcheck]
report_level = "WARNING"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not raise this report_level to WARNING as it hides other potentially useful INFO-level errors.

Instead we can add to the ignore_messages with explicit messages we want to broadly disregard due to rstcheck not honoring sphinx awareness of included general links.txt.

What we may need to explicitly includer and benign matches like:

  • "Duplicate implicit target name" : because sphinx de-dupes headers and anchor names
  • Hyperlink target "*" is not referenced: because of the shared links.txt

Once we lower the report_level to "INFO" we can see a couple of other factors to fix:
Enumerated list start value not ordinal-1 (nocloud.rst). We are missing leading indentation for each code block under itemized "creating a disk" section. Let's fix that.

Example: CLI discovery of ``instance-data``
-------------------------------------------

.. code-block:: shell-session

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blackboxsw I think this one should be jinja as well. The section discusses jinja, and while it doesn't match the type of the block, it formats it a little better in context. Thoughts?

nryanl added 2 commits October 5, 2026 10:35
- Silence hyperlink related messages
- Fix code-block indentation in nocloud.rst to fix list ordinal
  warning
@nryanl
nryanl requested a review from blackboxsw October 5, 2026 14:47

@blackboxsw blackboxsw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nryanl for the tooling improvements here. This LGTM. Just awaiting final CI report before merging.

@blackboxsw
blackboxsw merged commit e7f4b7c into canonical:main Oct 5, 2026
18 checks passed
@nryanl
nryanl deleted the rstcheck branch October 5, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation This Pull Request changes documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants