diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aa44d560..6942430e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,9 +37,7 @@ repos: name: black types: - python - - args: - - '--filter-files' - entry: pipenv run python -m isort + - entry: pipenv run python -m isort id: isort language: system name: isort @@ -62,7 +60,7 @@ repos: name: ruff types: - python - - entry: pipenv run toml-sort -a -i + - entry: pipenv run toml-sort --check id: toml-sort language: system name: toml-sort diff --git a/Makefile b/Makefile index b70c8182..cf84a777 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ ruff: ${PIPRUN} python -m ruff docs tests src toml-sort: - ${PIPRUN} toml-sort -a -i pyproject.toml + ${PIPRUN} toml-sort pyproject.toml tests: ${PIPRUN} python -m pytest . diff --git a/Makefile.jinja b/Makefile.jinja index 6295a002..a0b63a72 100644 --- a/Makefile.jinja +++ b/Makefile.jinja @@ -59,7 +59,7 @@ ruff: ${PIPRUN} python -m ruff docs tests src toml-sort: - ${PIPRUN} toml-sort -a -i pyproject.toml + ${PIPRUN} toml-sort pyproject.toml tests: ${PIPRUN} python -m pytest . diff --git a/pyproject.toml b/pyproject.toml index 350def3a..57d66dd4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,12 +2,12 @@ build-backend = "setuptools.build_meta" requires = [ "setuptools", - "setuptools-scm" + "setuptools-scm", ] [project] authors = [ - {email = "i@huxuan.org", name = "huxuan"} + {email = "i@huxuan.org", name = "huxuan"}, ] classifiers = [ "Development Status :: 4 - Beta", @@ -16,19 +16,19 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9" + "Programming Language :: Python :: 3.9", ] description = "A serious Python project template for out-of-box and production usage." dynamic = [ "dependencies", "optional-dependencies", - "version" + "version", ] keywords = [ "out-of-box", "production", "project template", - "template" + "template", ] name = "serious-scaffold" readme = "README.md" @@ -46,18 +46,22 @@ fail_under = 100 [tool.coverage.run] omit = [ - "src/{{ module_name }}/*" + "src/{{ module_name }}/*", ] +[tool.isort] +filter_files = true +profile = "black" + [tool.mypy] check_untyped_defs = true disallow_any_unimported = true disallow_untyped_defs = true enable_error_code = [ - "ignore-without-code" + "ignore-without-code", ] exclude = [ - "src/{{ module_name }}" + "src/{{ module_name }}", ] no_implicit_optional = true show_error_codes = true @@ -84,7 +88,7 @@ extend-ignore = [ "D407", "D408", "D409", - "D413" + "D413", ] fix = true per-file-ignores = {"tests/*" = ["S101"]} @@ -102,3 +106,8 @@ package = {file = ["requirements/package.txt"]} tests = {file = ["requirements/tests.txt"]} [tool.setuptools_scm] + +[tool.tomlsort] +all = true +in_place = true +trailing_comma_inline_array = true diff --git a/pyproject.toml.jinja b/pyproject.toml.jinja index eb183866..fc34aee4 100644 --- a/pyproject.toml.jinja +++ b/pyproject.toml.jinja @@ -2,12 +2,12 @@ build-backend = "setuptools.build_meta" requires = [ "setuptools", - "setuptools-scm" + "setuptools-scm", ] [project] authors = [ - {email = "{{ author_email }}", name = "{{ author_name }}"} + {email = "{{ author_email }}", name = "{{ author_name }}"}, ] classifiers = [ "Development Status :: 4 - Beta", @@ -16,19 +16,19 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9" + "Programming Language :: Python :: 3.9", ] description = "{{ project_description }}" dynamic = [ "dependencies", "optional-dependencies", - "version" + "version", ] keywords = [ "out-of-box", "production", "project template", - "template" + "template", ] name = "{{ package_name }}" readme = "README.md" @@ -47,20 +47,24 @@ fail_under = 100 [tool.coverage.run] omit = [ {%- if project_name == "Serious Scaffold Python" %} - "src/{{ '{{ module_name }}' }}/*" + "src/{{ '{{ module_name }}' }}/*", {%- endif %} ] +[tool.isort] +filter_files = true +profile = "black" + [tool.mypy] check_untyped_defs = true disallow_any_unimported = true disallow_untyped_defs = true enable_error_code = [ - "ignore-without-code" + "ignore-without-code", ] exclude = [ {%- if project_name == "Serious Scaffold Python" %} - "src/{{ '{{ module_name }}' }}" + "src/{{ '{{ module_name }}' }}", {%- endif %} ] no_implicit_optional = true @@ -88,7 +92,7 @@ extend-ignore = [ "D407", "D408", "D409", - "D413" + "D413", ] fix = true per-file-ignores = {"tests/*" = ["S101"]} @@ -106,3 +110,8 @@ package = {file = ["requirements/package.txt"]} tests = {file = ["requirements/tests.txt"]} [tool.setuptools_scm] + +[tool.tomlsort] +all = true +in_place = true +trailing_comma_inline_array = true