Skip to content

Commit 5ef2500

Browse files
committed
refactor(templates): update comment syntax to use Jinja2 style
Change comment syntax in template files from `# ##` to `# {# ... #}` to align with Jinja2 templating engine. This improves consistency and avoids potential conflicts with Copier configuration. The new syntax: 1. Uses Jinja-native comment format for better IDE recognition 2. Maintains file type indicators for syntax highlighting 3. Adds proper Jinja comment termination with `-#}` where needed 4. Removes ambiguous `##` prefix that could conflict with other tools Affected files: - copier.yaml - template/.config/copier/{{ _copier_conf.answers_file }}.jinja - template/.readthedocs.yaml.jinja - template/mkdocs.yaml.jinja - template/pyproject.toml.jinja
1 parent f0eca01 commit 5ef2500

6 files changed

Lines changed: 7 additions & 5 deletions

File tree

.cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"direnv",
1010
"dmypy",
1111
"elif",
12+
"envops",
1213
"fieldz",
1314
"getattr",
1415
"hynek",

copier.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ _external_data:
88
shared: "{{ answers_file_shared }}"
99

1010
_envops:
11+
comment_start_string: "# {#"
1112
line_statement_prefix: "# %%"
12-
line_comment_prefix: "# ##"
1313

1414
_migrations: &migrations
1515
- rm --force --verbose '__builtins__.pyi'

template/.config/copier/{{ _copier_conf.answers_file }}.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ## -*- mode: yaml; -*-
1+
# {#- -*- mode: yaml; -*- -#}
22
# This file is @generated by <https://github.com/liblaf/copier-python>.
33
# DO NOT EDIT!
44
# prettier-ignore

template/.readthedocs.yaml.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ## -*- mode: yaml; -*-
1+
# {#- -*- mode: yaml; -*- -#}
22
# yaml-language-server: $schema=https://raw.githubusercontent.com/readthedocs/readthedocs.org/master/readthedocs/rtd_tests/fixtures/spec/v2/schema.json
33
# This file is @generated by <https://github.com/liblaf/copier-python>.
44
# DO NOT EDIT!

template/mkdocs.yaml.jinja

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# ## -*- mode: yaml; -*-
1+
# {#- -*- mode: yaml; -*- -#}
2+
23
INHERIT: .config/copier/mkdocs.yaml
34
site_name: "{{ project_name }}"
45
site_description: TODO

template/pyproject.toml.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ## -*- mode: toml; -*-
1+
# {#- -*- mode: toml; -*- -#}
22
#:schema https://json.schemastore.org/pyproject.json
33
# ref: <https://packaging.python.org/en/latest/specifications/pyproject-toml/>
44

0 commit comments

Comments
 (0)