resume / tasks /formats.py
Médéric Hurier (Fmind)
updated header
8ad46c1
raw
history blame
497 Bytes
"""Format tasks for the project."""
# %% IMPORTS
from invoke import task
from invoke.context import Context
# %% TASKS
@task
def imports(ctx: Context) -> None:
"""Format code imports with ruff."""
ctx.run(".venv/bin/ruff check --select I --fix *.py")
@task
def sources(ctx: Context) -> None:
"""Format code sources with ruff."""
ctx.run(".venv/bin/ruff format *.py")
@task(pre=[imports, sources], default=True)
def all(_: Context) -> None:
"""Run all format tasks."""