Skip to content

Commit

Permalink
refactor: add golines (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
1riatsila1 authored Oct 31, 2024
1 parent 91dc07e commit 9294105
Show file tree
Hide file tree
Showing 68 changed files with 2,859 additions and 607 deletions.
17 changes: 15 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ generate-config-api-client: retrieve-config-api-openapi-spec

setup-dev:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.60.1
go install github.com/segmentio/golines@latest

test-client +ARGS='':
cd {{ CONFIG_API_CLIENT_DIR }} && go test -v ./... -race -covermode=atomic -coverprofile=.coverage {{ ARGS }}
Expand All @@ -38,7 +39,8 @@ coverage-client:
cd {{ CONFIG_API_CLIENT_DIR }} && go tool cover -html=.coverage -o=.coverage.html

fmt-client:
gofmt -w pkg/config-api-client
gofmt -w {{ CONFIG_API_CLIENT_DIR }}
golines -w {{ CONFIG_API_CLIENT_DIR }}

tidy-client:
cd {{ CONFIG_API_CLIENT_DIR }} && go mod tidy
Expand All @@ -53,6 +55,11 @@ lint-client:
exit 1
fi

if [ -n "$(golines . --dry-run)" ]; then
echo "Error: (golines) formatting required" >&2
exit 1
fi

golangci-lint run

lint-provider:
Expand All @@ -65,10 +72,16 @@ lint-provider:
exit 1
fi

if [ -n "$(golines . --dry-run)" ]; then
echo "Error: (golines) formatting required" >&2
exit 1
fi

golangci-lint run

fmt-provider:
gofmt -w pkg/config-api-provider
gofmt -w {{ CONFIG_API_PROVIDER_DIR }}
golines -w {{ CONFIG_API_PROVIDER_DIR }}

tidy-provider:
cd {{ CONFIG_API_PROVIDER_DIR }} && go mod tidy
Expand Down
Loading

0 comments on commit 9294105

Please sign in to comment.