Skip to content

Commit

Permalink
Get fully rid of black formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
medihack committed Feb 11, 2024
1 parent 7f91070 commit 7b77353
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 68 deletions.
57 changes: 1 addition & 56 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ pyvespa = "^0.38.0"
psycopg = { extras = ["binary"], version = "^3.1.13" }

[tool.poetry.group.dev.dependencies]
black = "^23.1.0"
celery-types = "^0.20.0"
debugpy = "^1.6.2"
django-debug-permissions = "^1.0.0"
Expand Down Expand Up @@ -115,10 +114,6 @@ exclude = ["migrations"]
line-length = 100
select = ["E", "F", "I", "DJ"]

[tool.black]
extend-exclude = "migrations"
line-length = 100

[tool.djlint]
profile = "django"
max_line_length = 120
Expand Down
14 changes: 7 additions & 7 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,16 @@ def stack_rm(ctx: Context, env: Environments = "prod"):

@task
def format(ctx: Context):
"""Format the source code (black, ruff, djlint)"""
"""Format the source code with ruff and djlint"""
# Format Python code
black_cmd = "poetry run black ."
run_cmd(ctx, black_cmd)
format_code_cmd = "poetry run ruff format ."
run_cmd(ctx, format_code_cmd)
# Sort Python imports
ruff_cmd = "poetry run ruff . --fix --select I"
run_cmd(ctx, ruff_cmd)
sort_imports_cmd = "poetry run ruff . --fix --select I"
run_cmd(ctx, sort_imports_cmd)
# Format Django templates
djlint_cmd = "poetry run djlint . --reformat"
run_cmd(ctx, djlint_cmd)
format_templates_cmd = "poetry run djlint . --reformat"
run_cmd(ctx, format_templates_cmd)


@task
Expand Down

0 comments on commit 7b77353

Please sign in to comment.