Skip to content

Commit e8bba94

Browse files
committed
dev: Add black and isort configurations
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent bfc04a8 commit e8bba94

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tab_width = 4
88
end_of_line = lf
99
insert_final_newline = true
1010
trim_trailing_whitespace = true
11-
max_line_length = 88
11+
max_line_length = 120
1212

1313
[{*.y{a,}ml,*.html,*.xhtml,*.xml,*.xsd}]
1414
indent_size = 2

pyproject.toml

+36-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ exclude_lines = [
123123
directory = "cov_html"
124124

125125
[tool.flake8]
126-
max-line-length = 88
126+
max-line-length = 120
127127
max-complexity = 18
128128
count = true
129129
show-source = true
@@ -135,6 +135,7 @@ enable-extensions = [
135135
# 'ignore' defaults to: E121,E123,E126,E226,E24,E704,W503,W504
136136
extend-ignore = [
137137
'E501', # line too long; instead, use B950
138+
'E203', # whitespace before ‘,’, ‘;’, or ‘:’; may conflict with black
138139
'W503', # line break before binary operator
139140
]
140141
per-file-ignores = [
@@ -187,6 +188,40 @@ extend-exclude = [
187188
'build', 'dist', 'sdist', 'wheels',
188189
]
189190

191+
[tool.black]
192+
line-length = 120
193+
extend-exclude = '''
194+
# A regex preceded with ^/ will apply only to files and directories
195+
# in the root of the project.
196+
(
197+
\.pytest_cache
198+
)
199+
'''
200+
201+
[tool.isort]
202+
profile = 'black'
203+
# The 'black' profile means:
204+
# multi_line_output = 3
205+
# include_trailing_comma = true
206+
# force_grid_wrap = 0
207+
# use_parentheses = true
208+
# ensure_newline_before_comments = true
209+
# line_length = 88
210+
line_length = 120 # override black provile line_length
211+
force_single_line = true # override black profile multi_line_output
212+
star_first = true
213+
group_by_package = true
214+
force_sort_within_sections = true
215+
lines_after_imports = 2
216+
honor_noqa = true
217+
atomic = true
218+
ignore_comments = true
219+
skip_gitignore = true
220+
src_paths = [
221+
'src',
222+
'test',
223+
]
224+
190225
# XXX TODO
191226
#[tool.mypy]
192227
#pretty = true

0 commit comments

Comments
 (0)