Find deprecated Path.link_to() usage

Proprietary

Find usage of Path.link_to() which was deprecated in Python 3.10 and removed in 3.12. Use hardlink_to() instead (note: argument order is reversed). link_to is not a name reserved to pathlib, so this only reports calls whose receiver resolves to a Path; a parse without type attribution reports nothing. Only fires where the receiver's type resolves to pathlib.Path or a subclass.

org.openrewrite.python.migrate.FindPathlibLinkTo
mod run . --recipe=org.openrewrite.python.migrate.FindPathlibLinkTo

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.