-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopier.yaml
More file actions
127 lines (112 loc) · 4.1 KB
/
Copy pathcopier.yaml
File metadata and controls
127 lines (112 loc) · 4.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
---
# --- COPIER CONFIGURATION ---------------------------------------------------
_min_copier_version: "9"
_answers_file: .copier-answers.yaml
_envops:
autoescape: false
keep_trailing_newline: true
_jinja_extensions:
- copier_templates_extensions.TemplateExtensionLoader
- extensions/detect.py:DetectExtension
_subdirectory: template
_message_after_copy: &postmessage |
Your pre-commit configuration has been generated.
You should:
1. Review and commit these changes
2. Run `{{ hook_runner }} run --all-files` to ensure your repo's current state matches the configured rules
3. Run `{{ hook_runner }} install` to ensure these checks run on every commit
_message_after_update: *postmessage
_templates_suffix: .jinja
_migrations:
# Copier renders a renamed file as delete-then-create, which discards a project's local edits with no
# conflict marker. Renaming in place before the update diff is computed carries those edits across.
# Guarded because projects on `web_format_tool: prettier` (or `web_format: false`) never had the file.
- version: "2026.7.1"
when: "{{ _stage == 'before' }}"
command: "test -f biome.jsonc && git mv biome.jsonc .biome.jsonc || true"
# --- COMPUTED ---------------------------------------------------------------
# Detected rather than asked: prek and pre-commit read the same `.pre-commit-config.yaml`, so this only
# decides which runner the generated comments and messages point at. `when: false` keeps it out of
# `.copier-answers.yaml`, so it is recomputed on every run and tracks whatever the repo actually uses.
hook_runner:
type: str
default: "{{ detect_hook_runner(_copier_conf.dst_path) }}"
when: false
# --- PROMPT -----------------------------------------------------------------
ai:
type: bool
help: "Prepare AGENTS.md?"
default: true
conventional_commits:
type: bool
help: "Use conventional commits?"
default: true
editorconfig:
type: bool
help: "Use editorconfig?"
default: true
markdown:
type: bool
help: "Lint and format markdown?"
default: true
# Opt-in rather than opt-out: the script shells out to pandoc, which a project has no other reason to
# install, and a vendored script that cannot run is worse than no script at all. `--doctor` reports what
# is missing.
markdown_render_check:
type: bool
help: "Include a script that checks markdown still renders the same after formatting? (needs pandoc)"
default: false
when: "{{ markdown }}"
markdown_render_check_dir:
type: str
help: "Which directory should the render check script go in?"
default: "scripts"
when: "{{ markdown and markdown_render_check }}"
# The answer is substituted into the rendered path verbatim -- it cannot be normalized there, because a
# `/` inside the path template would itself split into another directory level -- so anything that would
# escape the project or produce an empty path segment has to be rejected here.
validator: >-
{% if not markdown_render_check_dir %}
Give a directory name
{% elif markdown_render_check_dir.startswith("/") or markdown_render_check_dir.endswith("/") %}
Give a path relative to the project root, with no leading or trailing slash
{% elif ".." in markdown_render_check_dir %}
Path traversal (`..`) would write outside the project
{% endif %}
python:
type: bool
help: "Lint and format python?"
default: true
docker:
type: bool
help: "Lint and check docker files?"
default: true
github_actions:
type: bool
help: "Validate GitHub Actions workflows and audit their security posture?"
default: true
shell:
type: bool
help: "Lint and format shell scripts?"
default: true
web_format:
type: bool
help: "Lint and format JS/TS/JSON/HTML/CSS and related files?"
default: true
web_format_tool:
type: str
help: "Select the web formatter"
choices:
- biome
- prettier
# Detected from the target repo so an existing setup is preserved; falls back to biome.
default: "{{ detect_web_format_tool(_copier_conf.dst_path) }}"
when: "{{ web_format }}"
yaml:
type: bool
help: "Lint and format YAML?"
default: true
typos:
type: bool
help: "Check for typos?"
default: true