Skip to content

Commit 04a1e08

Browse files
authored
Config refine for toml-sort and isort. (#22)
1 parent 0918abe commit 04a1e08

File tree

5 files changed

+40
-24
lines changed

5 files changed

+40
-24
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ repos:
3737
name: black
3838
types:
3939
- python
40-
- args:
41-
- '--filter-files'
42-
entry: pipenv run python -m isort
40+
- entry: pipenv run python -m isort
4341
id: isort
4442
language: system
4543
name: isort
@@ -62,7 +60,7 @@ repos:
6260
name: ruff
6361
types:
6462
- python
65-
- entry: pipenv run toml-sort -a -i
63+
- entry: pipenv run toml-sort --check
6664
id: toml-sort
6765
language: system
6866
name: toml-sort

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ ruff:
5757
${PIPRUN} python -m ruff docs tests src
5858

5959
toml-sort:
60-
${PIPRUN} toml-sort -a -i pyproject.toml
60+
${PIPRUN} toml-sort pyproject.toml
6161

6262
tests:
6363
${PIPRUN} python -m pytest .

Makefile.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ ruff:
5959
${PIPRUN} python -m ruff docs tests src
6060

6161
toml-sort:
62-
${PIPRUN} toml-sort -a -i pyproject.toml
62+
${PIPRUN} toml-sort pyproject.toml
6363

6464
tests:
6565
${PIPRUN} python -m pytest .

pyproject.toml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
build-backend = "setuptools.build_meta"
33
requires = [
44
"setuptools",
5-
"setuptools-scm"
5+
"setuptools-scm",
66
]
77

88
[project]
99
authors = [
10-
{email = "[email protected]", name = "huxuan"}
10+
{email = "[email protected]", name = "huxuan"},
1111
]
1212
classifiers = [
1313
"Development Status :: 4 - Beta",
@@ -16,19 +16,19 @@ classifiers = [
1616
"Programming Language :: Python :: 3.10",
1717
"Programming Language :: Python :: 3.11",
1818
"Programming Language :: Python :: 3.8",
19-
"Programming Language :: Python :: 3.9"
19+
"Programming Language :: Python :: 3.9",
2020
]
2121
description = "A serious Python project template for out-of-box and production usage."
2222
dynamic = [
2323
"dependencies",
2424
"optional-dependencies",
25-
"version"
25+
"version",
2626
]
2727
keywords = [
2828
"out-of-box",
2929
"production",
3030
"project template",
31-
"template"
31+
"template",
3232
]
3333
name = "serious-scaffold"
3434
readme = "README.md"
@@ -46,18 +46,22 @@ fail_under = 100
4646

4747
[tool.coverage.run]
4848
omit = [
49-
"src/{{ module_name }}/*"
49+
"src/{{ module_name }}/*",
5050
]
5151

52+
[tool.isort]
53+
filter_files = true
54+
profile = "black"
55+
5256
[tool.mypy]
5357
check_untyped_defs = true
5458
disallow_any_unimported = true
5559
disallow_untyped_defs = true
5660
enable_error_code = [
57-
"ignore-without-code"
61+
"ignore-without-code",
5862
]
5963
exclude = [
60-
"src/{{ module_name }}"
64+
"src/{{ module_name }}",
6165
]
6266
no_implicit_optional = true
6367
show_error_codes = true
@@ -84,7 +88,7 @@ extend-ignore = [
8488
"D407",
8589
"D408",
8690
"D409",
87-
"D413"
91+
"D413",
8892
]
8993
fix = true
9094
per-file-ignores = {"tests/*" = ["S101"]}
@@ -102,3 +106,8 @@ package = {file = ["requirements/package.txt"]}
102106
tests = {file = ["requirements/tests.txt"]}
103107

104108
[tool.setuptools_scm]
109+
110+
[tool.tomlsort]
111+
all = true
112+
in_place = true
113+
trailing_comma_inline_array = true

pyproject.toml.jinja

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
build-backend = "setuptools.build_meta"
33
requires = [
44
"setuptools",
5-
"setuptools-scm"
5+
"setuptools-scm",
66
]
77

88
[project]
99
authors = [
10-
{email = "{{ author_email }}", name = "{{ author_name }}"}
10+
{email = "{{ author_email }}", name = "{{ author_name }}"},
1111
]
1212
classifiers = [
1313
"Development Status :: 4 - Beta",
@@ -16,19 +16,19 @@ classifiers = [
1616
"Programming Language :: Python :: 3.10",
1717
"Programming Language :: Python :: 3.11",
1818
"Programming Language :: Python :: 3.8",
19-
"Programming Language :: Python :: 3.9"
19+
"Programming Language :: Python :: 3.9",
2020
]
2121
description = "{{ project_description }}"
2222
dynamic = [
2323
"dependencies",
2424
"optional-dependencies",
25-
"version"
25+
"version",
2626
]
2727
keywords = [
2828
"out-of-box",
2929
"production",
3030
"project template",
31-
"template"
31+
"template",
3232
]
3333
name = "{{ package_name }}"
3434
readme = "README.md"
@@ -47,20 +47,24 @@ fail_under = 100
4747
[tool.coverage.run]
4848
omit = [
4949
{%- if project_name == "Serious Scaffold Python" %}
50-
"src/{{ '{{ module_name }}' }}/*"
50+
"src/{{ '{{ module_name }}' }}/*",
5151
{%- endif %}
5252
]
5353

54+
[tool.isort]
55+
filter_files = true
56+
profile = "black"
57+
5458
[tool.mypy]
5559
check_untyped_defs = true
5660
disallow_any_unimported = true
5761
disallow_untyped_defs = true
5862
enable_error_code = [
59-
"ignore-without-code"
63+
"ignore-without-code",
6064
]
6165
exclude = [
6266
{%- if project_name == "Serious Scaffold Python" %}
63-
"src/{{ '{{ module_name }}' }}"
67+
"src/{{ '{{ module_name }}' }}",
6468
{%- endif %}
6569
]
6670
no_implicit_optional = true
@@ -88,7 +92,7 @@ extend-ignore = [
8892
"D407",
8993
"D408",
9094
"D409",
91-
"D413"
95+
"D413",
9296
]
9397
fix = true
9498
per-file-ignores = {"tests/*" = ["S101"]}
@@ -106,3 +110,8 @@ package = {file = ["requirements/package.txt"]}
106110
tests = {file = ["requirements/tests.txt"]}
107111

108112
[tool.setuptools_scm]
113+
114+
[tool.tomlsort]
115+
all = true
116+
in_place = true
117+
trailing_comma_inline_array = true

0 commit comments

Comments
 (0)