New syntax and fully qualified names


We’ve continued to make our custom rules more powerful!

This includes:

  1. A new ... syntax for matching anything in a position. Say you want to write a rule that matches any print statement. You can now write pattern: print(...) and this will find all print statements with any number of positional or keyword arguments.

  2. Fully qualified name recognition. Say you want to transform typing.List into list in line with PEP 585. You can define the following rule:

    rules:
        - id: convert-typing-list
          pattern: typing.List
          replacement: list
          description: Use `list` rather than `typing.List`

    This will find all occurrences of typing.List and replace them with list, even if they have been imported using from typing import List.

Added

Changed

Fixed