high-energy-55500
07/20/2022, 3:05 PMdef foo(arg: Union[str, list]):
formatting the file with our linters will allow all of them to pass except pyupgrade
, which changes the line to
def foo(arg: str | list):
unfortunately, we still need to run our formatters once more, since now we’ve got an unused
from typing import Union
at the top of the file, which autoflake
complains about.
is there a better flow here that doesn’t require running our formatters twice or more times in a row? can we optimize this somehow so that some linters always run before other linters, so that in most cases they’d fix both issues in a single pass?bitter-ability-32190
07/20/2022, 3:11 PMpants.toml
is the order they run in fmt
high-energy-55500
07/20/2022, 3:13 PMhundreds-father-404
07/20/2022, 3:19 PMbitter-ability-32190
07/20/2022, 3:24 PMfix
goal for non-style changes. In this case you'd run fix
before fmt
high-energy-55500
07/20/2022, 5:37 PMfix
should be run first, followed by fmt
.
i’m thinking a good order would be
pyupgrade
autoflake
docformatter
isort
black
happy-kitchen-89482
07/21/2022, 11:42 PM