Skip to content

Commit 0a6f488

Browse files
authored
Fix Taskfile ordering so that "task" command formats code (#4471)
Previously, the format-code step was run AFTER the standard linting, so would always fail if there was incorrect format. Move the step to run before linting in the default task command (only run locally). No change for CI.
1 parent 1286b6e commit 0a6f488

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Taskfile.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ vars:
6262

6363
tasks:
6464
default:
65-
deps:
66-
- quick-checks
65+
cmds:
66+
- task: format-code # Run before quick-checks to avoid racing with generated file creation
67+
- task: quick-checks
6768

6869
quick-checks:
6970
desc: Perform all fast local pre-commit tasks.
@@ -73,8 +74,6 @@ tasks:
7374
- asoctl:quick-checks
7475
- crossplane:quick-checks
7576
- mangle-test:quick-checks
76-
cmds:
77-
- task: format-code # Run after the deps to avoid racing with generated file creation
7877

7978
setup:
8079
desc: Perform setup tasks
@@ -103,7 +102,7 @@ tasks:
103102
desc: Ensure all code is formatted
104103
dir: v2
105104
cmds:
106-
- golangci-lint run --fix ./...
105+
- golangci-lint run --fix ./... --timeout 5m # I don't know why fix doesn't use the configured timeout
107106
- gofumpt -l -w .
108107

109108
build-docs-site:

0 commit comments

Comments
 (0)