Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
RST: Add hook to find inline code touching normal text #30
Conversation
|
looks good, just a small comment |
22cbaa5
to
4bae8e6

I recently used
rst-backticksto find and fix some PEPs (python/peps#1554) and am planning to add it as a pre-commit linter on the CI.I also fixed some related RST problems (python/peps#1560) where inline code touches normal text. This sort of stuff is allowed in Markdown but not reStructuredText:
Guido suggested a linter for this too (python/peps#1560 (review)), and as I used grep to find these:
then
pygrep-hooksmakes a good fit!I didn't find anything in the spec where "alphanumeric double-backticks alphanumeric" is allowed so I think it's safe to add:
Naming things: always hard, feedback welcome for improvements on
rst-inline-touching-normal.Tests: I added the four real problems I found in the PEPs, plus some simplified versions. Let me know if you'd prefer only the simplified versions.