Skip to content

Commit

Permalink
Simplify isort config using 'profile = black'
Browse files Browse the repository at this point in the history
isort now has builtin support for black through its "profiles" feature.

https://timothycrosley.github.io/isort/docs/configuration/profiles/#black
  • Loading branch information
jdufresne committed Aug 19, 2020
1 parent 4f65c03 commit b21c94b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
6 changes: 1 addition & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,4 @@ exclude = tests*
ignore = E501

[isort]
combine_as_imports = True
forced_separate = taggit
include_trailing_comma = True
line_length = 88
multi_line_output = 3
profile = black
3 changes: 2 additions & 1 deletion taggit/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from django.contrib.contenttypes.models import ContentType
from django.db import IntegrityError, models, router, transaction
from django.utils.text import slugify
from django.utils.translation import gettext, gettext_lazy as _
from django.utils.translation import gettext
from django.utils.translation import gettext_lazy as _

try:
from unidecode import unidecode
Expand Down
10 changes: 5 additions & 5 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
from django.test import RequestFactory, SimpleTestCase, TestCase
from django.test.utils import override_settings

from taggit.managers import TaggableManager, _TaggableManager
from taggit.models import Tag, TaggedItem
from taggit.utils import edit_string_for_tags, parse_tags
from taggit.views import tagged_object_list

from .forms import (
BlankTagForm,
CustomPKFoodForm,
Expand Down Expand Up @@ -55,11 +60,6 @@
UUIDTaggedItem,
)

from taggit.managers import TaggableManager, _TaggableManager
from taggit.models import Tag, TaggedItem
from taggit.utils import edit_string_for_tags, parse_tags
from taggit.views import tagged_object_list


class BaseTaggingTestCase(TestCase):
def assert_tags_equal(self, qs, tags, sort=True, attr="name"):
Expand Down
4 changes: 2 additions & 2 deletions tests/views.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from django.views.generic.list import ListView

from .models import Food

from taggit.views import TagListMixin

from .models import Food


class FoodTagListView(TagListMixin, ListView):
model = Food
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ commands = flake8
[testenv:isort]
basepython = python3
skip_install = true
deps = isort
commands = isort --recursive --check-only --diff
deps = isort>=5.0.2
commands = isort --check-only --diff .

[testenv:docs]
deps = sphinx
Expand Down

0 comments on commit b21c94b

Please sign in to comment.