Skip to content

Commit 3cfe331

Browse files
committed
🎨 Enhance whitespace consistency across template files
Based on djade
1 parent 3ded110 commit 3cfe331

File tree

7 files changed

+48
-48
lines changed

7 files changed

+48
-48
lines changed

‎project_name/.github/workflows/ci.yml.jinja‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
fetch-depth: 0
2121
- uses: psf/black@stable
2222
with:
23-
jupyter: {{"true" if contains_jupyter_files else "false"}}
23+
jupyter: {{ "true" if contains_jupyter_files else "false" }}
2424
version: "~=25.0"
2525
{%- endif %}
2626
{%- if format_tool == "ruff" %}

‎project_name/.pre-commit-config.yaml.jinja‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ repos:
112112
- repo: https://github.com/psf/black-pre-commit-mirror
113113
rev: 25.1.0
114114
hooks:
115-
- id: black{%if contains_jupyter_files %}-jupyter{% endif %}
115+
- id: black{% if contains_jupyter_files %}-jupyter{% endif %}
116116
{%- endif %}
117117
- repo: https://github.com/adamchainz/blacken-docs
118118
rev: 1.19.1

‎project_name/README.md.jinja‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# {{project_name}}
1+
# {{ project_name }}
22

33
[![Tests][tests-badge]][tests-link]
44
[![Documentation Status][rtd-badge]][rtd-link]
@@ -20,7 +20,7 @@ Made using [tsvikas/python-template](http://github.com/tsvikas/python-template)
2020
## Usage
2121

2222
```
23-
import {{package_name}}
23+
import {{ package_name }}
2424
```
2525

2626
## Development
@@ -51,38 +51,38 @@ import {{package_name}}
5151
- run formatting, linting, and tests.
5252
- optionally, use `uv run dunamai from git` to see the current version
5353
{%- if not get_package_version_from_vcs %}
54-
- replace the version in `src/{{package_name}}/__init__.py`
54+
- replace the version in `src/{{ package_name }}/__init__.py`
5555
- commit
5656
{%- endif %}
5757
- use
5858
`VER="vX.Y.Z" && git tag -a "$VER" -m "version $VER" -e && git push origin tag "$VER"`
5959
- use `uv build` to build
6060
{%- if not get_package_version_from_vcs %}
61-
- add '+dev' to the version in `src/{{package_name}}/__init__.py`
61+
- add '+dev' to the version in `src/{{ package_name }}/__init__.py`
6262
- commit
6363
- push
6464
{%- endif %}
6565

6666
[black-badge]: https://img.shields.io/badge/code%20style-black-000000.svg
6767
[black-link]: https://github.com/psf/black
68-
[conda-badge]: https://img.shields.io/conda/vn/conda-forge/{{project_name}}
69-
[conda-link]: https://github.com/conda-forge/{{project_name}}-feedstock
68+
[conda-badge]: https://img.shields.io/conda/vn/conda-forge/{{ project_name }}
69+
[conda-link]: https://github.com/conda-forge/{{ project_name }}-feedstock
7070
[github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github
71-
[github-discussions-link]: https://github.com/{{github_user}}/{{project_name}}/discussions
71+
[github-discussions-link]: https://github.com/{{ github_user }}/{{ project_name }}/discussions
7272
[install-git]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
7373
[install-uv]: https://docs.astral.sh/uv/getting-started/installation/
74-
[pepy-badge]: https://static.pepy.tech/badge/{{project_name}}
75-
[pepy-link]: https://pepy.tech/project/{{project_name}}
74+
[pepy-badge]: https://static.pepy.tech/badge/{{ project_name }}
75+
[pepy-link]: https://pepy.tech/project/{{ project_name }}
7676
[prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
7777
[prs-welcome-link]: http://makeapullrequest.com
78-
[pypi-link]: https://pypi.org/project/{{project_name}}/
79-
[pypi-platforms]: https://img.shields.io/pypi/pyversions/{{project_name}}
80-
[pypi-version]: https://img.shields.io/pypi/v/{{project_name}}
81-
[rtd-badge]: https://readthedocs.org/projects/{{project_name}}/badge/?version=latest
82-
[rtd-link]: https://{{project_name}}.readthedocs.io/en/latest/?badge=latest
78+
[pypi-link]: https://pypi.org/project/{{ project_name }}/
79+
[pypi-platforms]: https://img.shields.io/pypi/pyversions/{{ project_name }}
80+
[pypi-version]: https://img.shields.io/pypi/v/{{ project_name }}
81+
[rtd-badge]: https://readthedocs.org/projects/{{ project_name }}/badge/?version=latest
82+
[rtd-link]: https://{{ project_name }}.readthedocs.io/en/latest/?badge=latest
8383
[ruff-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
8484
[ruff-link]: https://github.com/astral-sh/ruff
85-
[tests-badge]: https://github.com/{{github_user}}/{{project_name}}/actions/workflows/lint_and_test.yml/badge.svg
86-
[tests-link]: https://github.com/{{github_user}}/{{project_name}}/actions/workflows/lint_and_test.yml
85+
[tests-badge]: https://github.com/{{ github_user }}/{{ project_name }}/actions/workflows/lint_and_test.yml/badge.svg
86+
[tests-link]: https://github.com/{{ github_user }}/{{ project_name }}/actions/workflows/lint_and_test.yml
8787
[uv-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json
8888
[uv-link]: https://github.com/astral-sh/uv

‎project_name/pyproject.toml.jinja‎

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ build-backend = "hatchling.build"
99

1010
[project]
1111
dynamic = ["version"]
12-
name = "{{project_name}}"
13-
description = "{{package_description}}"
14-
license = "{{license}}"
12+
name = "{{ project_name }}"
13+
description = "{{ package_description }}"
14+
license = "{{ license }}"
1515
license-files = ["LICEN[CS]E.*"]
1616
readme = "README.md"
17-
requires-python = ">=3.{{python_minor}}"
17+
requires-python = ">=3.{{ python_minor }}"
1818
authors = [
19-
{name = "{{user_name}}", email = "{{user_email}}"}
19+
{name = "{{ user_name }}", email = "{{ user_email }}"}
2020
]
2121
keywords = []
2222
classifiers = [
@@ -81,20 +81,20 @@ dependencies = [
8181
# optional_name = ["some_package >=1.0"]
8282

8383
[project.urls]
84-
# homepage = "https://{{project_name}}.readthedocs.io"
85-
source = "https://github.com/{{github_user}}/{{project_name}}"
86-
# changelog = "https://github.com/{{github_user}}/{{project_name}}/blob/master/CHANGELOG.md"
87-
# releasenotes = "https://github.com/{{github_user}}/{{project_name}}/releases"
88-
# documentation = "https://{{project_name}}.readthedocs.io"
89-
# issues = "https://github.com/{{github_user}}/{{project_name}}/issues"
90-
# funding = "https://github.com/sponsors/{{github_user}}"
84+
# homepage = "https://{{ project_name }}.readthedocs.io"
85+
source = "https://github.com/{{ github_user }}/{{ project_name }}"
86+
# changelog = "https://github.com/{{ github_user }}/{{ project_name }}/blob/master/CHANGELOG.md"
87+
# releasenotes = "https://github.com/{{ github_user }}/{{ project_name }}/releases"
88+
# documentation = "https://{{ project_name }}.readthedocs.io"
89+
# issues = "https://github.com/{{ github_user }}/{{ project_name }}/issues"
90+
# funding = "https://github.com/sponsors/{{ github_user }}"
9191

9292
[project.scripts]
9393
{% if not has_cli -%}# {% endif -%}
94-
{{project_name}} = "{{package_name}}.cli:app"
94+
{{ project_name }} = "{{ package_name }}.cli:app"
9595

9696
[project.gui-scripts]
97-
# {{project_name}} = "{{package_name}}.gui:app.run"
97+
# {{ project_name }} = "{{ package_name }}.gui:app.run"
9898

9999

100100
[tool.uv]
@@ -111,7 +111,7 @@ dev = [
111111
"nbstripout ~=0.8.0",
112112
{%- endif %}
113113
"editorconfig-checker ~=3.0",
114-
"black{%if contains_jupyter_files %}[jupyter]{% endif %} ~=25.0",
114+
"black{% if contains_jupyter_files %}[jupyter]{% endif %} ~=25.0",
115115
"blacken-docs ~=1.0",
116116
"ruff ~=0.9.0",
117117
"validate-pyproject[all,store] ~=0.23.0",
@@ -160,7 +160,7 @@ typing = [
160160
version.source = "vcs"
161161
build.hooks.vcs.version-file = "src/{{ package_name }}/_version.py"
162162
{%- else %}
163-
version.path = "src/{{ package_name }}/__init__.py"
163+
version.path = "src/{{ package_name }}/__init__.py"
164164
{%- endif %}
165165

166166

@@ -175,7 +175,7 @@ addopts = [
175175
"-ra",
176176
## addons
177177
"--benchmark-disable", # pytest-benchmark
178-
"--cov=src/{{package_name}}", # pytest-cov
178+
"--cov=src/{{ package_name }}", # pytest-cov
179179
"--reverse", # pytest-reverse
180180
"--numprocesses=auto", # pytest-xdist
181181
]
@@ -184,16 +184,16 @@ xfail_strict = true
184184
filterwarnings = [
185185
"error",
186186
"default::DeprecationWarning",
187-
"error::DeprecationWarning:{{package_name}}",
187+
"error::DeprecationWarning:{{ package_name }}",
188188
]
189189
log_cli_level = "INFO"
190190

191191

192192
[tool.coverage]
193193
run.omit = [
194-
"src/{{package_name}}/__main__.py",
194+
"src/{{ package_name }}/__main__.py",
195195
{%- if get_package_version_from_vcs %}
196-
"src/{{package_name}}/_version.py",
196+
"src/{{ package_name }}/_version.py",
197197
{%- endif %}
198198
]
199199

@@ -204,7 +204,7 @@ mypy_path = "stubs"
204204
# verify the config file
205205
warn_unused_configs = true
206206
# set the platform
207-
python_version = "3.{{python_minor}}"
207+
python_version = "3.{{ python_minor }}"
208208
# enable checks [last updated: mypy 1.15]
209209
strict = true
210210
disallow_any_explicit = true
@@ -274,11 +274,11 @@ flake8-comprehensions.allow-dict-calls-with-keyword-arguments = true
274274
"collections.namedtuple".msg = "Use typing.NamedTuple or @dataclasses.dataclass(frozen=True, slots=True)"
275275

276276
[tool.ruff.lint.per-file-ignores]
277-
"src/{{package_name}}/cli.py" = [
277+
"src/{{ package_name }}/cli.py" = [
278278
"T20", # flake8-print
279279
]
280280
{%- if get_package_version_from_vcs %}
281-
"src/{{package_name}}/_version.py" = [
281+
"src/{{ package_name }}/_version.py" = [
282282
"ALL",
283283
]
284284
{%- endif %}
@@ -294,7 +294,7 @@ flake8-comprehensions.allow-dict-calls-with-keyword-arguments = true
294294

295295

296296
[tool.pylint]
297-
py-version = "3.{{python_minor}}"
297+
py-version = "3.{{ python_minor }}"
298298
{%- if get_package_version_from_vcs %}
299299
ignore-paths = [".*/_version.py"]
300300
{%- endif %}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""{{ project_name }}: {{ package_description }}
22

3-
use `python -m {{package_name}}` to run the cli
3+
use `python -m {{ package_name }}` to run the cli
44
"""
55

66
from .cli import app
77

8-
app(prog_name="{{project_name}}")
8+
app(prog_name="{{ project_name }}")

‎project_name/src/{{package_name}}/{% if has_cli %}cli.py{% endif %}.jinja‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""CLI for {{package_name}}.
1+
"""CLI for {{ package_name }}.
22

33
Currently, a placeholder until the real CLI will be added.
44
"""
@@ -18,7 +18,7 @@ app = typer.Typer()
1818

1919
def _version_callback(value: bool) -> None: # noqa: FBT001
2020
if value:
21-
print(f"{{project_name}} {__version__}")
21+
print(f"{{ project_name }} {__version__}")
2222
raise typer.Exit(0)
2323

2424

‎project_name/tests/{% if has_cli %}test_cli.py{% endif %}.jinja‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typer.testing import CliRunner
22

3-
from {{package_name}} import __version__
4-
from {{package_name}}.cli import app
3+
from {{ package_name }} import __version__
4+
from {{ package_name }}.cli import app
55

66
runner = CliRunner()
77

0 commit comments

Comments
 (0)