generated from thazelart/golang-cli-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.go-archetype.yaml
184 lines (180 loc) · 4.82 KB
/
.go-archetype.yaml
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
---
ignore:
- .git/
- .go-archtype.yml
- "LICENSE"
- "docs/bracket-creator"
inputs:
- id: repo_base_url
text: What is the project repo path base URL? (e.g. github.com)
type: text
- id: repo_user
text: What is the project repo user? (e.g. gitrgoliveira)
type: text
- id: repo_name
text: What is the project name? (e.g. my-awesome-go-cli)
type: text
- id: short_description
text: What is a short project description?
type: text
- id: long_description
text: What is a long project description? (long texts without no newlines)
type: text
- id: maintainer
text: Who is the maintainer? (e.g. Thibault HAZELART <[email protected]>)
type: text
- id: license
text: What is a software license? (e.g. Apache 2.0, MIT ...)
type: text
- id: includeMkdocs
text: Would you like to include the documentation with mkdocs?
type: yesno
before:
operations:
- sh:
- rm -rf {{.destination}}
transformations:
- name: do not include template code in the final output
type: include
region_marker: __DO_NOT_INCLUDE__
condition: false
files: ["**"]
- name: remove unwanted files
type: include
region_marker: # When there's no marker, the entire file(s) is included
condition: "yes"
files:
- ".go-archetype.yaml"
- "LICENSE"
- "docs/bracket-creator/**"
# ____ _ _
# | _ \ _ __ ___ (_) ___ ___| |_
# | |_) | '__/ _ \| |/ _ \/ __| __|
# | __/| | | (_) | | __/ (__| |_
# |_| |_| \___// |\___|\___|\__|
# |__/
- name: project short description
type: replace
pattern: A tournament bracket creator
replacement: "{{ wrap 80 .short_description }}"
files:
- "cmd/root.go"
- ".goreleaser"
- "docs/*"
- name: project long description
type: replace
pattern: An opinionated template for new Golang cli projects.
replacement: "{{ wrap 80 .long_description }}"
files:
- "cmd/root.go"
- "README.md"
- "docs/*"
- name: project long path
type: replace
pattern: github.com/gitrgoliveira/bracket-creator
replacement: "{{ .repo_base_url }}/{{ .repo_user }}/{{ .repo_name }}"
files:
- "*.go"
- "**/*.go"
- "go.mod"
- "go.sum"
- "Makefile"
- "Dockerfile"
- "README.md"
- ".goreleaser.yaml"
- ".github/workflows/*.yaml"
- ".github/ISSUE_TEMPLATE/*.yaml"
- ".github/ISSUE_TEMPLATE/config.yml"
- ".github/CONTRIBUTING.md"
- ".github/SECURITY.md"
- ".github/pull_request_template.md"
- "docs/*"
- name: project short path
type: replace
pattern: gitrgoliveira/bracket-creator
replacement: "{{ .repo_user }}/{{ .repo_name }}"
files:
- "*.go"
- "**/*.go"
- "Makefile"
- "Dockerfile"
- "README.md"
- ".goreleaser.yaml"
- ".github/workflows/*.yaml"
- "docs/*"
- name: user
type: replace
pattern: gitrgoliveira
replacement: "{{ .repo_user }}"
files:
- "scripts/fury-upload.sh"
- "README.md"
- ".goreleaser.yaml"
- "Makefile"
- ".github/ISSUE_TEMPLATE/*.yaml"
- "docs/*"
- name: project name
type: replace
pattern: bracket-creator
replacement: "{{ .repo_name }}"
files:
- "*.go"
- "**/*.go"
- ".gitignore"
- "Makefile"
- "Dockerfile"
- "README.md"
- ".goreleaser.yaml"
- ".github/workflows/*.yaml"
- ".github/ISSUE_TEMPLATE/*.yaml"
- ".github/ISSUE_TEMPLATE/config.yml"
- ".github/CONTRIBUTING.md"
- "scripts/completions.sh"
- "scripts/manpages.sh"
- "docs/*"
- name: project maintainer
type: replace
pattern: Thibault HAZELART <[email protected]>
replacement: "{{ wrap 80 .maintainer }}"
files:
- "*.go"
- "**/*.go"
- "Dockerfile"
- ".goreleaser.yaml"
- ".github/SECURITY.md"
- "docs/*"
- name: license
type: replace
pattern: Apache 2.0
replacement: "{{ .license }}"
files:
- "*.go"
- "**/*.go"
- "Dockerfile"
- ".goreleaser.yaml"
- "README.md"
# __ __ _ _
# | \/ | | ____| | ___ ___ ___
# | |\/| | |/ / _` |/ _ \ / __/ __|
# | | | | < (_| | (_) | (__\__ \
# |_| |_|_|\_\__,_|\___/ \___|___/
#
- name: include the mkdocs documentation
type: include
region_marker: # When there's no marker, the entire file(s) is included
condition: .IncludeMkdocs
files:
- docs/**
- .github/workflows/doc.yaml
- mkdocs.yaml
- name: include the mkdocs documentation
type: include
region_marker: __INCLUDE_MKDOCS__
condition: .IncludeMkdocs
files:
- "Makefile"
after:
operations:
- sh:
- cd {{.destination}} && gofmt -s -w .
- cd {{.destination}} && goimports -w .