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 6895948 commit c56542e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
13 changes: 4 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,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
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ Repository = "https://github.com/adamchainz/django-cors-headers"
[tool.black]
target-version = ['py38']

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

[tool.pytest.ini_options]
addopts = """\
--strict-config
Expand Down
2 changes: 1 addition & 1 deletion src/corsheaders/apps.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

from django.apps import AppConfig
from django.core.checks import register
from django.core.checks import Tags
from django.core.checks import register

from corsheaders.checks import check_settings

Expand Down
2 changes: 1 addition & 1 deletion src/corsheaders/conf.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from __future__ import annotations

from typing import cast
from typing import List
from typing import Pattern
from typing import Sequence
from typing import Tuple
from typing import Union
from typing import cast

from django.conf import settings

Expand Down

0 comments on commit c56542e

Please sign in to comment.