Skip to content
GitLab
探索
项目
群组
代码片段
项目
群组
代码片段
/
帮助
帮助
支持
社区论坛
快捷键
?
提交反馈
登录
切换导航
菜单
打开侧边栏
ExternalRepo
isort
提交
013b014b
提交
013b014b
编辑于
1年前
作者:
Pavel Bitiukov
浏览文件
操作
下载
电子邮件补丁
差异文件
Removed check for include_trailing_comma for the Hanging Indent wrap mode
上级
14d0b366
main
dependabot/pip/black-24.3.0
dependabot/pip/idna-3.7
dependabot/pip/jinja2-3.1.4
5.13.2
5.13.1
5.13.0
无相关合并请求
变更
2
Hide whitespace changes
Inline
Side-by-side
显示
2 个更改的文件
isort/wrap_modes.py
+0
-3
isort/wrap_modes.py
tests/unit/test_wrap_modes.py
+18
-0
tests/unit/test_wrap_modes.py
有
18 个添加
和
3 个删除
+18
-3
isort/wrap_modes.py
+
0
-
3
浏览文件 @
013b014b
...
...
@@ -141,9 +141,6 @@ def hanging_indent(**interface: Any) -> str:
)
interface
[
"statement"
]
=
next_statement
interface
[
"statement"
]
=
f
"
{
interface
[
'statement'
]
}{
','
if
interface
[
'include_trailing_comma'
]
else
''
}
"
if
interface
[
"comments"
]:
statement_with_comments
=
isort
.
comments
.
add_to_line
(
interface
[
"comments"
],
...
...
This diff is collapsed.
Click to expand it.
tests/unit/test_wrap_modes.py
+
18
-
0
浏览文件 @
013b014b
...
...
@@ -259,6 +259,24 @@ def test_fuzz_hanging_indent(
reject
()
@
pytest
.
mark
.
parametrize
(
"include_trailing_comma"
,
(
True
,
False
))
def
test_hanging_indent__with_include_trailing_comma__expect_same_result
(
include_trailing_comma
):
result
=
isort
.
wrap_modes
.
hanging_indent
(
statement
=
"from datetime import "
,
imports
=
[
"datetime"
,
"time"
,
"timedelta"
,
"timezone"
,
"tzinfo"
],
white_space
=
" "
,
indent
=
" "
,
line_length
=
50
,
comments
=
[],
line_separator
=
"
\n
"
,
comment_prefix
=
" #"
,
include_trailing_comma
=
include_trailing_comma
,
remove_comments
=
False
,
)
assert
result
==
"from datetime import datetime, time, timedelta,
\\\n
timezone, tzinfo"
@
given
(
statement
=
st
.
text
(),
imports
=
st
.
lists
(
st
.
text
()),
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
支持
Markdown
0%
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
菜单
探索
项目
群组
代码片段