Skip to content

Commit 0dc51bf

Browse files
committed
chore: update jinja templating to hopefully match proper syntax in result
1 parent c1f3224 commit 0dc51bf

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

{{cookiecutter.project_name}}/noxfile.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def setup_branches(session: Session) -> None:
5656
session.run("git", "checkout", "-b", "develop", "main")
5757

5858

59-
6059
@nox.session(python=DEFAULT_PYTHON_VERSION, name="pre-commit")
6160
def precommit(session: Session) -> None:
6261
"""Lint using pre-commit."""
@@ -90,7 +89,7 @@ def format_python(session: Session) -> None:
9089
session.run("ruff", "format", *session.posargs)
9190

9291

93-
{% if cookiecutter.add_rust_extension == "y" %}
92+
{% if cookiecutter.add_rust_extension == "y" -%}
9493
@nox.session(python=None, name="format-rust")
9594
def format_rust(session: Session) -> None:
9695
"""Run Rust code formatter (cargo fmt)."""
@@ -100,7 +99,7 @@ def format_rust(session: Session) -> None:
10099
session.run("cargo", "fmt", "--all", "--", "--write", external=True)
101100

102101

103-
{% endif %}
102+
{% endif -%}
104103
@nox.session(python=None, name="lint")
105104
def lint(session: Session) -> None:
106105
"""Run all linting checks (Ruff, Pydocstyle)."""
@@ -120,7 +119,7 @@ def lint_python(session: Session) -> None:
120119
session.run("ruff", "check", "--verbose")
121120

122121

123-
{% if cookiecutter.add_rust_extension == "y" %}
122+
{% if cookiecutter.add_rust_extension == "y" -%}
124123
@nox.session(python=None, name="lint-rust")
125124
def lint_rust(session: Session) -> None:
126125
"""Run Rust code linters (cargo clippy)."""
@@ -130,7 +129,7 @@ def lint_rust(session: Session) -> None:
130129
session.run("cargo", "clippy", "--all-features", "--", "--write", external=True)
131130

132131

133-
{% endif %}
132+
{% endif -%}
134133
@nox.session(python=PYTHON_VERSIONS)
135134
def typecheck(session: Session) -> None:
136135
"""Run static type checking (Pyright) on Python code."""
@@ -163,7 +162,7 @@ def security_python(session: Session) -> None:
163162
session.run("pip-audit")
164163

165164

166-
{% if cookiecutter.add_rust_extension == 'y' %}
165+
{% if cookiecutter.add_rust_extension == 'y' -%}
167166
@nox.session(python=None, name="security-rust")
168167
def security_rust(session: Session) -> None:
169168
"""Run code security checks (cargo audit)."""
@@ -172,7 +171,7 @@ def security_rust(session: Session) -> None:
172171
session.run("cargo", "audit", "--all", external=True)
173172

174173

175-
{% endif %}
174+
{% endif -%}
176175
@nox.session(python=None, name="tests")
177176
def tests(session: Session) -> None:
178177
"""Run all Python and Rust tests."""
@@ -201,7 +200,7 @@ def tests_python(session: Session) -> None:
201200
)
202201

203202

204-
{% if cookiecutter.add_rust_extension == 'y' %}
203+
{% if cookiecutter.add_rust_extension == 'y' -%}
205204
@nox.session(python=None, name="tests-rust")
206205
def tests_rust(session: Session) -> None:
207206
"""Test the project's rust crates."""
@@ -211,8 +210,7 @@ def tests_rust(session: Session) -> None:
211210
session.run("cargo", "test", "--all-features", *crate_kwargs, external=True)
212211

213212

214-
215-
{% endif %}
213+
{% endif -%}
216214
@nox.session(python=DEFAULT_PYTHON_VERSION, name="docs-build")
217215
def docs_build(session: Session) -> None:
218216
"""Build the project documentation (Sphinx)."""
@@ -311,7 +309,7 @@ def publish_python(session: Session) -> None:
311309
session.run("uv", "publish", "dist/*", external=True)
312310

313311

314-
{% if cookiecutter.add_rust_extension == "y" %}
312+
{% if cookiecutter.add_rust_extension == "y" -%}
315313
@nox.session(python=None, name="publish-rust")
316314
def publish_rust(session: Session) -> None:
317315
"""Publish built crates to crates.io."""
@@ -321,7 +319,7 @@ def publish_rust(session: Session) -> None:
321319
session.run("cargo", "publish", "-p", crate_folder.name)
322320

323321

324-
{% endif %}
322+
{% endif -%}
325323
@nox.session(venv_backend="none")
326324
def release(session: Session) -> None:
327325
"""Run the release process using Commitizen.

0 commit comments

Comments
 (0)