You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able to use Sphinx directives like :class: and :meth: in my code documentation, but it is blocked by Flake8:
Bio/PDB/internal_coords.py:3595:1: RST304 Unknown interpreted text role "meth".
Is there anyway I can get around this? Would it be reasonable to have Flake8 ignore RST304?
I see @peterjc has looked around this, but not sure where it is now.
It seems like a very nice feature (and I just spent two days polishing my documentation, only to find I can't commit :-( )
OK, I see where I messed up and very sorry to anyone (@mdehoon) if you pulled my version that rm'd your .flake8.
.flake8 restored to distribution in last pushed commit.
So how do I resolve? For now I have 'stashed' the Sphinx directives in my PR by changing them to something that gets past the distribution's .flake8.
Happy to do a tiny PR for .flake8 rather than sneak it in if/when #3774 is merged, but probably a longer list of roles and directives is desirable beyond the ones I'm using so far?
Your proposed additions to flake8 for Sphinx look fine, I'd be happy to take that as a small self contained PR - and once merged that should make #3774 easier to finish.
Regarding line length, is this about docstrings specifically? Currently we ignore E501 so don't bother to set the flake8 line length limit (which as I recall is 79 by default, and would need to be increased to a least the black default of 88).
Activity
peterjc commentedon Nov 23, 2021
Rather than ignoring
RST304, specify which roles you are using via the.flake8configuration - see https://github.com/peterjc/flake8-rst-docstringsrob-miller commentedon Nov 24, 2021
Thank you, that worked. Could/should this be added to the distribution .flake8?
In my particular case the added lines are:
but now I hit the same issues in the continuous integration style check.
Also did you change to enforcing the 79 character line length?
rob-miller commentedon Nov 25, 2021
OK, I see where I messed up and very sorry to anyone (@mdehoon) if you pulled my version that rm'd your .flake8.
.flake8 restored to distribution in last pushed commit.
So how do I resolve? For now I have 'stashed' the Sphinx directives in my PR by changing them to something that gets past the distribution's .flake8.
Happy to do a tiny PR for .flake8 rather than sneak it in if/when #3774 is merged, but probably a longer list of roles and directives is desirable beyond the ones I'm using so far?
peterjc commentedon Nov 26, 2021
Your proposed additions to flake8 for Sphinx look fine, I'd be happy to take that as a small self contained PR - and once merged that should make #3774 easier to finish.
Regarding line length, is this about docstrings specifically? Currently we ignore E501 so don't bother to set the flake8 line length limit (which as I recall is 79 by default, and would need to be increased to a least the black default of 88).
peterjc commentedon Nov 26, 2021
If you'd rather add the roles and directives to
.flake8as part of your main PR, that's fine too - but I lean towards doing the flake8 changes first.rob-miller commentedon Nov 26, 2021
peterjc commentedon Nov 30, 2021
Applied, thank you.