diff --git a/tasks.py b/tasks.py index 23b732d..b12885d 100644 --- a/tasks.py +++ b/tasks.py @@ -44,6 +44,16 @@ def lint(ctx: Context): ctx.run("poetry run pyright", pty=True) +@task +def format(ctx: Context): + """Format the source code with ruff and djlint""" + print("Formatting Python code with ruff...") + ctx.run("poetry run ruff format .", pty=True) + + print("Sorting Python imports with ruff...") + ctx.run("poetry run ruff check . --fix --select I", pty=True) + + @task def test( ctx: Context,