sphinx-lint icon indicating copy to clipboard operation
sphinx-lint copied to clipboard

Detect `!~` in roles

Open hugovk opened this issue 11 months ago • 0 comments
trafficstars

:meth:`~list.pop` can be used to display pop().

:meth:`!list.pop` can be used to display list.pop() and avoid reference warnings.

:meth:`!~list.pop` cannot be used to display pop() and avoid reference warnings, instead it shows ~list.pop()

✅ We should instead write :meth:`!pop` to display pop().

Real life example: https://github.com/python/cpython/pull/127054#pullrequestreview-2484402392

Can we detect this with Sphinx Lint?

hugovk avatar Dec 06 '24 14:12 hugovk