-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Uniform block directive syntax. #44757
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
could u add as a doc check rule as well (can be a follow up)
Yeah, I'm unsure how to currently check for that. I detected it automatically but the project that made me discover that is way too far from prime time to be added as a check. I could just grep for it and check the status code, but I'm afraid it would be a bit brittle. |
Could you add it as a pygrep check to the precommit config file? |
block directive syntax technically does not have space before the double-colon. While this seem to be accepted by docutils – but not documented, this can throw off other RST parser/syntax highlighter. Sometime they can see that as comments, sometime they give garbage out. Plus this is really uncommon with 3 occurrences in pandas codebase with space and 4800 without: pandas[master] $ rg '\.\. \w+::' | wc -l 4853 Numpy and scipy used to have a few space in their block directive, but current master/main branch of both should also be free of directive with space before the double colon.
Done. |
lgtm. cc @MarcoGorelli |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @Carreau |
block directive syntax technically does not have space before the
double-colon.
While this seem to be accepted by docutils – but not documented,
this can throw off other RST parser/syntax highlighter.
Sometime they can see that as comments, sometime they give garbage out.
Plus this is really uncommon with 3 occurrences in pandas codebase with
space and 4800 without:
Numpy and scipy used to have a few space in their block directive, but
current master/main branch of both should also be free of directive with
space before the double colon.
Note that this issue can be seen in the syntax highlighting of the diff of this PR itself, where the deleted lines are gray (comment), and added ones are blue/purple (directives)