Skip to content

Commit

Permalink
Use isort to sort imports
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz committed Feb 11, 2024
1 parent 76fc985 commit 40346f8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
13 changes: 4 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,11 @@ repos:
- id: blacken-docs
additional_dependencies:
- black==23.1.0
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.12.0
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: reorder-python-imports
args:
- --py38-plus
- --application-directories
- .:example:src
- --add-import
- 'from __future__ import annotations'
- id: isort
name: isort (python)
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
Expand Down
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ Repository = "https://github.com/adamchainz/django-htmx"
[tool.black]
target-version = ['py38']

[tool.isort]
add_imports = [
"from __future__ import annotations"
]
force_single_line = true
profile = "black"
src_paths = [
".",
"example",
"src",
]

[tool.pytest.ini_options]
addopts = """\
--strict-config
Expand Down
1 change: 0 additions & 1 deletion src/django_htmx/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from django.http.response import HttpResponseBase
from django.http.response import HttpResponseRedirectBase


HTMX_STOP_POLLING = 286


Expand Down
2 changes: 1 addition & 1 deletion tests/templatetags/test_django_htmx.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from django.template import Context
from django.template import Template
from django.test import override_settings
from django.test import SimpleTestCase
from django.test import override_settings


class DjangoHtmxScriptTests(SimpleTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_jinja.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from django.test import override_settings
from django.test import SimpleTestCase
from django.test import override_settings

from django_htmx.jinja import django_htmx_script

Expand Down

0 comments on commit 40346f8

Please sign in to comment.