File size: 477 Bytes
beb32ed
 
 
 
 
 
 
 
 
 
 
 
13a7d69
 
beb32ed
 
 
 
13a7d69
 
beb32ed
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""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("ruff check --select I --fix *.py")


@task
def sources(ctx: Context) -> None:
    """Format code sources with ruff."""
    ctx.run("ruff format *.py")


@task(pre=[imports, sources], default=True)
def all(_: Context) -> None:
    """Run all format tasks."""