Skip to content

Commit

Permalink
Separate out format code per component
Browse files Browse the repository at this point in the history
  • Loading branch information
theunrepentantgeek committed Dec 3, 2024
1 parent 11b1b0b commit 11b85a2
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ tasks:
desc: Ensure all code is formatted
dir: v2
cmds:
- golangci-lint run --fix ./... --timeout 5m # I don't know why fix doesn't use the configured timeout
- gofumpt -l -w .
- task: asoctl:format-code
- task: generator:format-code
- task: controller:format-code

build-docs-site:
cmds:
Expand Down Expand Up @@ -163,6 +164,13 @@ tasks:
OUTPUT_FILE: '{{.TEST_OUT}}/asoctl-unit-tests.md'
- go test ./... -tags=noexit -race -covermode atomic -coverprofile='{{.TEST_OUT}}/asoctl-coverage.out' -json -coverpkg=./... -run '{{default ".*" .TEST_FILTER}}' > '{{.TEST_OUT}}/asoctl-unit-tests.json'

asoctl:format-code:
desc: Ensure all code for asoctl is formatted
dir: v2/cmd/asoctl/
cmds:
- golangci-lint run --fix ./... --timeout 5m --verbose
- gofumpt -l -w .

asoctl:lint:
desc: Run {{.ASOCTL_APP}} fast lint checks.
dir: '{{.ASOCTL_ROOT}}'
Expand Down Expand Up @@ -246,6 +254,13 @@ tasks:
cmds:
- go test ./... -run ^TestGolden -update

generator:format-code:
desc: Ensure all code for the code generator is formatted
dir: v2/tools/generator
cmds:
- golangci-lint run --fix ./... --timeout 5m --verbose
- gofumpt -l -w .

generator:lint:
desc: Run {{.GENERATOR_APP}} fast lint checks.
dir: '{{.GENERATOR_ROOT}}'
Expand Down Expand Up @@ -297,6 +312,13 @@ tasks:
- task: basic-checks
- task: controller:lint

controller:format-code:
desc: Ensure all code for the controller is formatted
dir: v2
cmds:
- golangci-lint run --fix ./... --timeout 5m --verbose
- gofumpt -l -w .

controller:lint:
desc: Run fast lint checks.
deps:
Expand Down Expand Up @@ -844,9 +866,12 @@ tasks:
deps:
- az-login
cmds:
- echo "Cleaning {{.KIND_WORKLOAD_IDENTITY_PATH}}"
- "rm -rf {{.KIND_WORKLOAD_IDENTITY_PATH}}"
- "mkdir -p {{.KIND_WORKLOAD_IDENTITY_PATH}}"
- echo "Calling create-kind-wi-storage.sh"
- "{{.SCRIPTS_ROOT}}/create-kind-wi-storage.sh -d {{.KIND_WORKLOAD_IDENTITY_PATH}} -p {{.TEST_LIVE_RESOURCE_PREFIX}}"
- echo "Calling kind-with-registry.sh"
- "export KIND_CLUSTER_NAME=asov2-wi && \
export SERVICE_ACCOUNT_ISSUER=$(cat {{.KIND_WORKLOAD_IDENTITY_PATH}}/azure/saissuer.txt) && \
{{.SCRIPTS_ROOT}}/kind-with-registry.sh"
Expand Down

0 comments on commit 11b85a2

Please sign in to comment.