Find Python function and method usages
ProprietaryFind function and method calls by pattern. Covers standalone functions, class methods, static methods, and constructor calls.
org. openrewrite. python. migrate. FindMethodsRequired
A method pattern used to find matching function and method calls. The pattern format is <module-or-type> <function-name>(<arg-patterns>). The module or type part is optional; when omitted, any declaring type matches. .. matches any number of arguments. For example, dumps(..) finds all calls to any function named dumps, json dumps(..) finds only calls to json.dumps(), and os.path join(..) finds calls to os.path.join().
Optional
When enabled, find methods that are overrides of the method pattern.
mod run . --recipe= org. openrewrite. python. migrate. FindMethods \
-P methodPattern= 'dumps(.. )'Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.