Skip to content

Commit

Permalink
Add a format task
Browse files Browse the repository at this point in the history
  • Loading branch information
medihack committed Oct 4, 2024
1 parent 3050fe0 commit e1cf0c4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e1cf0c4

Please sign in to comment.