Skip to content

Commit 4feca7c

Browse files
committed
Sort tasks in alphabetical order
I originally set out to establish some logical order to the tasks in the taskfiles I've worked in. Based from the start on some indecipherable and subjective criteria, then randomized to some extent by the whims of Git over the course of development, it ends up a jumble. Alphabetical order is completely objective and it results in a fairly logical order in the end due to the practice of using prefixes on the task names according to their domain. The exception I make is placing the convenience "umbrella" tasks at the top (in their own alphabetical order) so that they will have the maximum visibility as the most useful tasks. Even that is not completely inconsistent, since these don't have a namespace prefix, and so might be imagined to have a null global namespace prefix that should be sorted first.
1 parent 9a71d3f commit 4feca7c

File tree

5 files changed

+154
-154
lines changed

5 files changed

+154
-154
lines changed

Taskfile.yml

Lines changed: 116 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,33 @@
11
version: "3"
22

33
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-
174
check:
185
desc: Check for problems with the project
196
deps:
20-
- task: general:check-formatting
217
- task: ci:validate
22-
- task: general:check-spelling
238
- task: config:validate
24-
- task: markdown:lint
9+
- task: general:check-formatting
10+
- task: general:check-spelling
2511
- task: markdown:check-links
12+
- task: markdown:lint
2613
- task: python:lint
2714
- task: python:test
2815
- task: shell:check
2916
- task: shell:check-mode
3017
- task: yaml:lint
3118

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
6021
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
6431

6532
ci:sync:
6633
desc: Sync CI workflows from templates
@@ -82,49 +49,6 @@ tasks:
8249
"{{.WORKFLOW_TEMPLATES_PATH}}/test-python-poetry-task.yml" \
8350
"{{.WORKFLOWS_PATH}}"
8451
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-
12852
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-workflows-task/Taskfile.yml
12953
ci:validate:
13054
desc: Validate GitHub Actions workflows against their JSON schema
@@ -162,6 +86,21 @@ tasks:
16286
-s "{{.WORKFLOW_SCHEMA_PATH}}" \
16387
-d "{{.TEMPLATE_WORKFLOWS_DATA_PATH}}"
16488
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+
165104
config:validate:
166105
desc: Validate configuration files against their JSON schema
167106
vars:
@@ -211,17 +150,66 @@ tasks:
211150
-s "{{.MARKDOWNLINT_SCHEMA_PATH}}" \
212151
-d "{{.MARKDOWNLINT_DATA_PATH}}"
213152
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"
217158
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}}" \;
219168
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
223172
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}}"
225213
226214
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
227215
markdown:check-links:
@@ -264,6 +252,18 @@ tasks:
264252
'
265253
fi
266254
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+
267267
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
268268
poetry:install-deps:
269269
desc: Install dependencies managed by Poetry
@@ -276,12 +276,13 @@ tasks:
276276
cmds:
277277
- poetry update
278278

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
281282
deps:
282283
- task: poetry:install-deps
283284
cmds:
284-
- poetry run pytest workflow-templates/assets/deploy-mkdocs-versioned/siteversion/tests
285+
- poetry run black .
285286

286287
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
287288
python:lint:
@@ -291,24 +292,12 @@ tasks:
291292
cmds:
292293
- poetry run flake8 --show-source
293294

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
297297
deps:
298298
- task: poetry:install-deps
299299
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
312301

313302
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
314303
shell:check:
@@ -367,6 +356,17 @@ tasks:
367356
)"
368357
exit $EXIT_STATUS
369358
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+
370370
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-yaml-task/Taskfile.yml
371371
yaml:lint:
372372
desc: Check for problems with YAML files

workflow-templates/assets/check-go-task/Taskfile.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ tasks:
1010
- task: go:lint
1111

1212
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
13-
go:vet:
14-
desc: Check for errors in Go code
13+
go:fix:
14+
desc: Modernize usages of outdated APIs
1515
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
1616
cmds:
17-
- go vet {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
17+
- go fix {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
1818

1919
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
20-
go:fix:
21-
desc: Modernize usages of outdated APIs
20+
go:format:
21+
desc: Format Go code
2222
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
2323
cmds:
24-
- go fix {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
24+
- go fmt {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
2525

2626
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
2727
go:lint:
@@ -39,8 +39,8 @@ tasks:
3939
{{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
4040
4141
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
42-
go:format:
43-
desc: Format Go code
42+
go:vet:
43+
desc: Check for errors in Go code
4444
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
4545
cmds:
46-
- go fmt {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
46+
- go vet {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}

workflow-templates/assets/check-markdown-task/Taskfile.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,6 @@ tasks:
77
# This is an "umbrella" task used to call any documentation generation processes the project has.
88
# It can be left empty if there are none.
99

10-
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
11-
markdown:lint:
12-
desc: Check for problems in Markdown files
13-
cmds:
14-
- npx markdownlint-cli "**/*.md"
15-
16-
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
17-
markdown:fix:
18-
desc: Automatically correct linting violations in Markdown files where possible
19-
cmds:
20-
- npx markdownlint-cli --fix "**/*.md"
21-
2210
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
2311
markdown:check-links:
2412
desc: Check for broken links
@@ -61,3 +49,15 @@ tasks:
6149
exit $STATUS
6250
'
6351
fi
52+
53+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
54+
markdown:fix:
55+
desc: Automatically correct linting violations in Markdown files where possible
56+
cmds:
57+
- npx markdownlint-cli --fix "**/*.md"
58+
59+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
60+
markdown:lint:
61+
desc: Check for problems in Markdown files
62+
cmds:
63+
- npx markdownlint-cli "**/*.md"

0 commit comments

Comments
 (0)