-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider adding rstcheck integration #22
Comments
Interesting. I see |
Looks like in theory we could call their |
Idea here is rstcheck will also validate python blocks etc, as well as the reStructuredText via docutils. That would need new error codes: $ flake8 --select RST some_python.py some_python.py:8:1: RST999 Unexpected prefix: '(python) unexpected EOF while parsing' See GitHub issue #22, using the example there: def some(): """ ==== Test ==== .. code:: python print( End. """ pass
Proof of principle - doesn't save any code, in fact adds a bit to parse the https://github.com/peterjc/flake8-rst-docstrings/tree/rstcheck The RST303 test case fails with:
The RST304 test case fails with:
May need to tweak https://github.com/peterjc/flake8-rst-docstrings/blob/master/tests/RST303/sphinx-directives.py and https://github.com/peterjc/flake8-rst-docstrings/blob/master/tests/RST304/sphinx-roles.py Anyway, your example gives:
Obviously would need to define a bunch of new flake8 codes - perhaps RST801 for python, RST802 for bash, etc (just one code per code block language, since otherwise would be very open ended): https://github.com/myint/rstcheck#supported-languages-in-code-blocks |
It seems for some reason @sobolevn I take it from your github 'reactions' that you like the way this is going in terms of additional functionality. Any thoughts on how best to assign new |
Might have to add |
Reading the code, Of course, most people using RST and linting it probably use Sphinx, but not everyone will. I suppose we could ask |
Logged rstcheck/rstcheck#65 |
Currently this code passes our CI:
But, the example is clearly invalid. It should not pass the CI in my opinion.
There's a tool for that: https://github.com/myint/rstcheck
Maybe we can integrate this tool into
flake8-rst-docstrings
?If it is not aligning nicely with the goal of this project, I will consider adding it directly into https://github.com/wemake-services/wemake-python-styleguide
The text was updated successfully, but these errors were encountered: