sphinx-lint
sphinx-lint copied to clipboard
Detect `!~` in roles
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?