Skip to content

Commit

Permalink
Fix Taskfile ordering so that "task" command formats code (#4471)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matthchr authored Nov 26, 2024
1 parent 1286b6e commit 0a6f488
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ vars:

tasks:
default:
deps:
- quick-checks
cmds:
- task: format-code # Run before quick-checks to avoid racing with generated file creation
- task: quick-checks

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

setup:
desc: Perform setup tasks
Expand Down Expand Up @@ -103,7 +102,7 @@ tasks:
desc: Ensure all code is formatted
dir: v2
cmds:
- golangci-lint run --fix ./...
- golangci-lint run --fix ./... --timeout 5m # I don't know why fix doesn't use the configured timeout
- gofumpt -l -w .

build-docs-site:
Expand Down

0 comments on commit 0a6f488

Please sign in to comment.