ci(lint): integrate rstcheck linter and resolve existing warnings - #7128
Conversation
blackboxsw
left a comment
There was a problem hiding this comment.
Looks good @nryanl. Ttwo notes on this before we proceed:
- Let's not raise log level to WARNING if we can avoid it because that may hide real misconfiguration information we care about.
- 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 |
There was a problem hiding this comment.
This should be jinja not text.
| convention = "pep257" | ||
|
|
||
| [tool.rstcheck] | ||
| report_level = "WARNING" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
@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?
- Silence hyperlink related messages - Fix code-block indentation in nocloud.rst to fix list ordinal warning
blackboxsw
left a comment
There was a problem hiding this comment.
Thanks @nryanl for the tooling improvements here. This LGTM. Just awaiting final CI report before merging.
Additional Context
rstcheckwill now run as part of$ tox -e docto improve quality of.rstfiles in our documentation. In addition, existing warnings as part of integration were resolved, including:code-blockdirectives missing lexer types, e.g... code-block:: [lexer-type]now have appropriate types.rstcheckignore 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