Skip to content

Commit 293c201

Browse files
committed
Fix the Plone profile to be compatible with black
Fixes #2456
1 parent 024aa37 commit 293c201

4 files changed

Lines changed: 34 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Find out more about isort's release policy [here](https://pycqa.github.io/isort/
77
### Unreleased
88

99
- Removed `--old-finders` and `--magic-placement` flags and `old_finders` configuration option. The legacy finder logic that relied on environment introspection has been removed (#2445) @joao-faria-dev
10+
- Update the `plone` profile to not clash with `black` (#2456) @ale-rt
1011

1112
### 6.1.0 October 1 2025
1213

docs/configuration/profiles.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,10 @@ To use any of the listed profiles, use `isort --profile PROFILE_NAME` from the c
5252

5353
#plone
5454

55+
Based on black with these tweaks:
5556

5657
- **force_alphabetical_sort**: `True`
5758
- **force_single_line**: `True`
58-
- **lines_after_imports**: `2`
59-
- **line_length**: `200`
6059

6160
#attrs
6261

isort/profiles.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
{
4747
"force_alphabetical_sort": True,
4848
"force_single_line": True,
49-
"lines_after_imports": 2,
5049
}
5150
)
5251
attrs = {

tests/unit/profiles/test_plone.py

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ def test_plone_code_snippet_one():
1717
1818
import plone.app.multilingualindexes
1919
20-
2120
PAMI_FIXTURE = PloneWithPackageLayer(
2221
bases=(PLONE_APP_MULTILINGUAL_PRESET_FIXTURE,),
2322
name="PAMILayer:Fixture",
@@ -54,7 +53,6 @@ def test_plone_code_snippet_two():
5453
from zope.component import queryAdapter
5554
from zope.globalrequest import getRequest
5655
57-
5856
logger = getLogger(__name__)
5957
"""
6058
)
@@ -68,8 +66,39 @@ def test_plone_code_snippet_three():
6866
6967
import logging
7068
71-
7269
logger = logging.getLogger(__name__)
7370
7471
"""
7572
)
73+
74+
75+
def test_plone_code_snippet_four():
76+
plone_isort_test(
77+
"""# -*- coding: utf-8 -*-
78+
from plone.app.querystring.interfaces import IQueryModifier
79+
from zope.interface import provider
80+
81+
import logging
82+
83+
84+
def my_function():
85+
pass
86+
87+
"""
88+
)
89+
90+
91+
def test_plone_code_snippet_five():
92+
plone_isort_test(
93+
"""# -*- coding: utf-8 -*-
94+
from plone.app.querystring.interfaces import IQueryModifier
95+
from zope.interface import provider
96+
97+
import logging
98+
99+
100+
class MyClass:
101+
pass
102+
103+
"""
104+
)

0 commit comments

Comments
 (0)