forked from mariushelf/copier_python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopier.yml
More file actions
113 lines (97 loc) · 3.35 KB
/
Copy pathcopier.yml
File metadata and controls
113 lines (97 loc) · 3.35 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
_min_copier_version: "9.0.0"
_subdirectory: template
_templates_suffix: .jinja
_answers_file: .copier-answers.yml
_exclude:
- "*.pyc"
- "__pycache__"
- ".git"
_tasks:
- "git init"
- "git checkout -b main"
- "uv sync"
- "uv run pre-commit install"
- "git add --all -- :!branch_protection_rules.json"
- "git commit -m \"chore: initial commit\""
- command: gh repo create {{ github_username }}/{{ project_github_name }} --source=. --push --private
when: "{{ push_to_github }}"
- command: "gh api --method PUT -H \"Accept: application/vnd.github+json\" repos/{{ github_username }}/{{ project_github_name }}/branches/main/protection --input branch_protection_rules.json"
when: "{{ push_to_github }}"
- rm branch_protection_rules.json
- command: uvx copier copy git@github.com:XomniaAI/copier-claude-devcontainer.git "$(pwd)"
when: "{{ install_claude_devcontainer }}"
# Questions
author_name:
type: str
help: Author's full name
default: "Joe Doe"
author_email:
type: str
help: Author's email address
default: "joe@example.com"
github_username:
type: str
help: GitHub username or organization
default: "XomniaAi"
project_name:
type: str
help: Human-readable project name
default: "{{ author_name }}'s new project"
project_slug:
type: str
help: "Python package name (used for imports, directory name, etc.)"
# Allowlist sanitisation: lowercase, collapse every run of non-alphanumeric
# characters (spaces, hyphens, dots, apostrophes, …) into a single
# underscore, then trim leading/trailing underscores. A blocklist of
# individual replaces would leak characters such as the apostrophe in the
# default project_name ("…'s new project").
default: "{{ project_name | lower | regex_replace('[^a-z0-9]+', '_') | trim('_') }}"
# Reject anything that is not a valid Python package / import name, whether it
# comes from the default above or is typed by the user.
validator: >-
{% if not (project_slug | regex_search('^[a-z_][a-z0-9_]*$')) %}
project_slug must be a valid Python package name: lowercase letters, digits
and underscores only, and it may not start with a digit.
{% endif %}
project_github_name:
type: str
default: "{{ project_slug | lower | replace('_', '-') }}"
when: false
project_short_description:
type: str
help: A short description of the project
default: "{{ project_name }} is a Python project."
version:
type: str
help: Initial version number
default: "0.1.0"
license:
type: str
help: Project license
choices:
- MIT
- Apache-2.0
- GPL-3.0-only
- GPL-3.0-or-later
- LicenseRef-Proprietary
default: MIT
include_hexagonal:
type: bool
help: >-
Scaffold a hexagonal (ports-and-adapters) architecture? Adds domain/services/
adapters layers with an example slice, plus import-linter contracts that
enforce the layer boundaries.
default: true
push_to_github:
type: bool
help: >-
Push the repository to GitHub. Auto-applies standard branch protection rules
standard for trunk-based development. (e.g. one main branch)
default: true
install_claude_devcontainer:
type: bool
help: >-
Install Xomnia-authored Python + Claude Code devcontainer, which which comes
with uv, pre-commit, the GitHub CLI, a zsh/Powerlevel10k shell, a curated
set of Claude Code plugins, and a default-deny network firewall.
default: false