1
1
version : " 3"
2
2
3
3
tasks :
4
- fix :
5
- desc : Make automated corrections to the project's files
6
- deps :
7
- - task : ci:sync
8
- - task : config:sync
9
- - task : dependabot:sync
10
- - task : github:sync
11
- - task : markdown:fix
12
- - task : general:format-prettier
13
- - task : general:correct-spelling
14
- - task : python:format
15
- - task : shell:format
16
-
17
4
check :
18
5
desc : Check for problems with the project
19
6
deps :
20
- - task : general:check-formatting
21
7
- task : ci:validate
22
- - task : general:check-spelling
23
8
- task : config:validate
24
- - task : markdown:lint
9
+ - task : general:check-formatting
10
+ - task : general:check-spelling
25
11
- task : markdown:check-links
12
+ - task : markdown:lint
26
13
- task : python:lint
27
14
- task : python:test
28
15
- task : shell:check
29
16
- task : shell:check-mode
30
17
- task : yaml:lint
31
18
32
- # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-prettier-formatting-task/Taskfile.yml
33
- general:format-prettier :
34
- desc : Format all supported files with Prettier
35
- cmds :
36
- - npx prettier --write .
37
-
38
- # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-general-formatting-task/Taskfile.yml
39
- general:check-formatting :
40
- desc : Check basic formatting style of all files
41
- cmds :
42
- - |
43
- if ! which ec &>/dev/null; then
44
- echo "ec not found or not in PATH. Please install: https://github.com/editorconfig-checker/editorconfig-checker#installation"
45
- exit 1
46
- fi
47
- - ec
48
-
49
- # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check-task/Taskfile.yml
50
- general:check-spelling :
51
- desc : Check for commonly misspelled words
52
- deps :
53
- - task : poetry:install-deps
54
- cmds :
55
- - poetry run codespell
56
-
57
- # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check-task/Taskfile.yml
58
- general:correct-spelling :
59
- desc : Correct commonly misspelled words where possible
19
+ fix :
20
+ desc : Make automated corrections to the project's files
60
21
deps :
61
- - task : poetry:install-deps
62
- cmds :
63
- - poetry run codespell --write-changes
22
+ - task : ci:sync
23
+ - task : config:sync
24
+ - task : dependabot:sync
25
+ - task : general:correct-spelling
26
+ - task : general:format-prettier
27
+ - task : github:sync
28
+ - task : markdown:fix
29
+ - task : python:format
30
+ - task : shell:format
64
31
65
32
ci:sync :
66
33
desc : Sync CI workflows from templates
@@ -82,49 +49,6 @@ tasks:
82
49
"{{.WORKFLOW_TEMPLATES_PATH}}/test-python-poetry-task.yml" \
83
50
"{{.WORKFLOWS_PATH}}"
84
51
85
- config:sync :
86
- desc : Sync configuration files from templates
87
- vars :
88
- REPOSITORY_ROOT_PATH : " ./"
89
- WORKFLOW_TEMPLATE_ASSETS_PATH : " ./workflow-templates/assets"
90
- cmds :
91
- - |
92
- cp \
93
- "{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/check-general-formatting/.ecrc" \
94
- "{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/general/.editorconfig" \
95
- "{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/check-python/.flake8" \
96
- "{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/check-markdown/.markdownlint.yml" \
97
- "{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/check-yaml/.yamllint.yml" \
98
- "{{.REPOSITORY_ROOT_PATH}}"
99
-
100
- dependabot:sync :
101
- desc : Sync workflow duplicates for dependabot checks
102
- vars :
103
- WORKFLOW_TEMPLATES_PATH : " ./workflow-templates"
104
- WORKFLOW_TEMPLATE_COPIES_PATH : " ./workflow-templates/dependabot/workflow-template-copies/.github/workflows"
105
- cmds :
106
- # Sync workflow templates with the copies in the folder where Dependabot can check them for updates.
107
- - mkdir --parents "{{.WORKFLOW_TEMPLATE_COPIES_PATH}}"
108
- - rm --force "{{.WORKFLOW_TEMPLATE_COPIES_PATH}}"/*
109
- - |
110
- find "{{.WORKFLOW_TEMPLATES_PATH}}" \
111
- -maxdepth 1 \
112
- -type f \
113
- -regex '.*\.ya?ml' \
114
- -exec cp '{}' "{{.WORKFLOW_TEMPLATE_COPIES_PATH}}" \;
115
-
116
- github:sync :
117
- desc : Sync GitHub community health files
118
- vars :
119
- ISSUE_TEMPLATES_INSTALLATION_PATH : " ./.github/ISSUE_TEMPLATE"
120
- ISSUE_TEMPLATES_PATH : " ./issue-templates"
121
- cmds :
122
- - |
123
- cp \
124
- "{{.ISSUE_TEMPLATES_PATH}}/minimal/bug-report.md" \
125
- "{{.ISSUE_TEMPLATES_PATH}}/minimal/feature-request.md" \
126
- "{{.ISSUE_TEMPLATES_INSTALLATION_PATH}}"
127
-
128
52
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-workflows-task/Taskfile.yml
129
53
ci:validate :
130
54
desc : Validate GitHub Actions workflows against their JSON schema
@@ -162,6 +86,21 @@ tasks:
162
86
-s "{{.WORKFLOW_SCHEMA_PATH}}" \
163
87
-d "{{.TEMPLATE_WORKFLOWS_DATA_PATH}}"
164
88
89
+ config:sync :
90
+ desc : Sync configuration files from templates
91
+ vars :
92
+ REPOSITORY_ROOT_PATH : " ./"
93
+ WORKFLOW_TEMPLATE_ASSETS_PATH : " ./workflow-templates/assets"
94
+ cmds :
95
+ - |
96
+ cp \
97
+ "{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/check-general-formatting/.ecrc" \
98
+ "{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/general/.editorconfig" \
99
+ "{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/check-python/.flake8" \
100
+ "{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/check-markdown/.markdownlint.yml" \
101
+ "{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/check-yaml/.yamllint.yml" \
102
+ "{{.REPOSITORY_ROOT_PATH}}"
103
+
165
104
config:validate :
166
105
desc : Validate configuration files against their JSON schema
167
106
vars :
@@ -211,17 +150,66 @@ tasks:
211
150
-s "{{.MARKDOWNLINT_SCHEMA_PATH}}" \
212
151
-d "{{.MARKDOWNLINT_DATA_PATH}}"
213
152
214
- # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
215
- markdown:lint :
216
- desc : Check for problems in Markdown files
153
+ dependabot:sync :
154
+ desc : Sync workflow duplicates for dependabot checks
155
+ vars :
156
+ WORKFLOW_TEMPLATES_PATH : " ./workflow-templates"
157
+ WORKFLOW_TEMPLATE_COPIES_PATH : " ./workflow-templates/dependabot/workflow-template-copies/.github/workflows"
217
158
cmds :
218
- - npx markdownlint-cli "**/*.md"
159
+ # Sync workflow templates with the copies in the folder where Dependabot can check them for updates.
160
+ - mkdir --parents "{{.WORKFLOW_TEMPLATE_COPIES_PATH}}"
161
+ - rm --force "{{.WORKFLOW_TEMPLATE_COPIES_PATH}}"/*
162
+ - |
163
+ find "{{.WORKFLOW_TEMPLATES_PATH}}" \
164
+ -maxdepth 1 \
165
+ -type f \
166
+ -regex '.*\.ya?ml' \
167
+ -exec cp '{}' "{{.WORKFLOW_TEMPLATE_COPIES_PATH}}" \;
219
168
220
- # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown -task/Taskfile.yml
221
- markdown:fix :
222
- desc : Automatically correct linting violations in Markdown files where possible
169
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-general-formatting -task/Taskfile.yml
170
+ general:check-formatting :
171
+ desc : Check basic formatting style of all files
223
172
cmds :
224
- - npx markdownlint-cli --fix "**/*.md"
173
+ - |
174
+ if ! which ec &>/dev/null; then
175
+ echo "ec not found or not in PATH. Please install: https://github.com/editorconfig-checker/editorconfig-checker#installation"
176
+ exit 1
177
+ fi
178
+ - ec
179
+
180
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check-task/Taskfile.yml
181
+ general:check-spelling :
182
+ desc : Check for commonly misspelled words
183
+ deps :
184
+ - task : poetry:install-deps
185
+ cmds :
186
+ - poetry run codespell
187
+
188
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check-task/Taskfile.yml
189
+ general:correct-spelling :
190
+ desc : Correct commonly misspelled words where possible
191
+ deps :
192
+ - task : poetry:install-deps
193
+ cmds :
194
+ - poetry run codespell --write-changes
195
+
196
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-prettier-formatting-task/Taskfile.yml
197
+ general:format-prettier :
198
+ desc : Format all supported files with Prettier
199
+ cmds :
200
+ - npx prettier --write .
201
+
202
+ github:sync :
203
+ desc : Sync GitHub community health files
204
+ vars :
205
+ ISSUE_TEMPLATES_INSTALLATION_PATH : " ./.github/ISSUE_TEMPLATE"
206
+ ISSUE_TEMPLATES_PATH : " ./issue-templates"
207
+ cmds :
208
+ - |
209
+ cp \
210
+ "{{.ISSUE_TEMPLATES_PATH}}/minimal/bug-report.md" \
211
+ "{{.ISSUE_TEMPLATES_PATH}}/minimal/feature-request.md" \
212
+ "{{.ISSUE_TEMPLATES_INSTALLATION_PATH}}"
225
213
226
214
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
227
215
markdown:check-links :
@@ -264,6 +252,18 @@ tasks:
264
252
'
265
253
fi
266
254
255
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
256
+ markdown:fix :
257
+ desc : Automatically correct linting violations in Markdown files where possible
258
+ cmds :
259
+ - npx markdownlint-cli --fix "**/*.md"
260
+
261
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
262
+ markdown:lint :
263
+ desc : Check for problems in Markdown files
264
+ cmds :
265
+ - npx markdownlint-cli "**/*.md"
266
+
267
267
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
268
268
poetry:install-deps :
269
269
desc : Install dependencies managed by Poetry
@@ -276,12 +276,13 @@ tasks:
276
276
cmds :
277
277
- poetry update
278
278
279
- python:test :
280
- desc : Run Python tests
279
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
280
+ python:format :
281
+ desc : Format Python files
281
282
deps :
282
283
- task : poetry:install-deps
283
284
cmds :
284
- - poetry run pytest workflow-templates/assets/deploy-mkdocs-versioned/siteversion/tests
285
+ - poetry run black .
285
286
286
287
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
287
288
python:lint :
@@ -291,24 +292,12 @@ tasks:
291
292
cmds :
292
293
- poetry run flake8 --show-source
293
294
294
- # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
295
- python:format :
296
- desc : Format Python files
295
+ python:test :
296
+ desc : Run Python tests
297
297
deps :
298
298
- task : poetry:install-deps
299
299
cmds :
300
- - poetry run black .
301
-
302
- # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
303
- shell:format :
304
- desc : Format shell script files
305
- cmds :
306
- - |
307
- if ! which shfmt &>/dev/null; then
308
- echo "shfmt not installed or not in PATH. Please install: https://github.com/mvdan/sh#shfmt"
309
- exit 1
310
- fi
311
- - shfmt -w .
300
+ - poetry run pytest workflow-templates/assets/deploy-mkdocs-versioned/siteversion/tests
312
301
313
302
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
314
303
shell:check :
@@ -367,6 +356,17 @@ tasks:
367
356
)"
368
357
exit $EXIT_STATUS
369
358
359
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
360
+ shell:format :
361
+ desc : Format shell script files
362
+ cmds :
363
+ - |
364
+ if ! which shfmt &>/dev/null; then
365
+ echo "shfmt not installed or not in PATH. Please install: https://github.com/mvdan/sh#shfmt"
366
+ exit 1
367
+ fi
368
+ - shfmt -w .
369
+
370
370
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-yaml-task/Taskfile.yml
371
371
yaml:lint :
372
372
desc : Check for problems with YAML files
0 commit comments