[WIP] docs: Add rstcheck for generarated rst#15786
[WIP] docs: Add rstcheck for generarated rst#15786phlax wants to merge 3 commits intoenvoyproxy:mainfrom
Conversation
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
5e93ab6 to
4901deb
Compare
|
annoying rstcheck doesnt pick up the original error of |
d71a4f3 to
6f06328
Compare
docs/build.sh
Outdated
c8f711f to
3bdfbeb
Compare
htuch
left a comment
There was a problem hiding this comment.
Nice; looks good directionally, let me know when ready for a full review pass.
3bdfbeb to
e0ae8dc
Compare
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
55a7697 to
e9f8a59
Compare
|
im a bit concerned that rstcheck seems to be unmaintained, and also has kinda obvious bugs that have been kicking around for ~6 years (rstcheck/rstcheck#76) without being addressed all the same its kinda useful - so i think rather include it and add workarounds |
|
surveying other linting tools for rst (again) they are seemingly similar - ie barely maintained if at all the nature of rst is that it is complex (ie embeddable code) - not sure what is best here. |
|
|
||
| def parallel(self, cmd, args, handle): | ||
| errors = 0 | ||
| pool = multiprocessing.Pool(multiprocessing.cpu_count()) |
| # things we dont want to see in generated docs | ||
| # TODO(phlax): move to .rstcheck.cfg when available | ||
| RSTCHECK_GREP_FAIL = (" ref:", "\\[\\#") | ||
| RSTCHECK_CONFIG=".rstcheck.cfg" |
There was a problem hiding this comment.
Nit: spacing (why doesn't our linter cover this?)
There was a problem hiding this comment.
i think it does - flake8 might not because we dont enable most pep8 checks yet, but yapf isnt happy with it
| @contextmanager | ||
| def sphinx_enabled(): | ||
| """Register Sphinx directives and roles.""" | ||
| srcdir = tempfile.mkdtemp() |
There was a problem hiding this comment.
Why not with tempfile.TemporaryDirectory()?
|
|
||
| def _rstcheck_handle(self, results: list) -> None: | ||
| """Handle multiprocessed error results of rstchecks""" | ||
| for (filename, _errors) in results: |
There was a problem hiding this comment.
Nit: parens not needed here and below
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Commit Message: docs: Add rstcheck for generarated rst
Additional Description:
this is a follow on from #15766 to use rstcheck
it will take quite a lot more cleaning up so i was hoping it wouldnt block #15766
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]
[Optional API Considerations:]