Merge branch 'main' of github.com:databricks/cli into feat/custom-annotations-json-schema

This commit is contained in:
Ilya Kuznetsov 2024-12-17 16:48:06 +01:00
commit 386c7d3041
No known key found for this signature in database
GPG Key ID: 91F3DDCF5D21CDDF
2 changed files with 8 additions and 39 deletions

View File

@ -57,38 +57,6 @@ jobs:
- name: Publish test coverage - name: Publish test coverage
uses: codecov/codecov-action@v4 uses: codecov/codecov-action@v4
fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.23.2
# No need to download cached dependencies when running gofmt.
cache: false
- name: Install goimports
run: |
go install golang.org/x/tools/cmd/goimports@latest
- name: Run make fmt
run: |
make fmt
- name: Run go mod tidy
run: |
go mod tidy
- name: Fail on differences
run: |
# Exit with status code 1 if there are differences (i.e. unformatted files)
git diff --exit-code
golangci: golangci:
name: lint name: lint
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -97,6 +65,13 @@ jobs:
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: 1.23.2 go-version: 1.23.2
- name: Run go mod tidy
run: |
go mod tidy
- name: Fail on differences
run: |
# Exit with status code 1 if there are differences (i.e. unformatted files)
git diff --exit-code
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v6
with: with:

View File

@ -1,11 +1,5 @@
default: build default: build
fmt:
@echo "✓ Formatting source code with goimports ..."
@goimports -w $(shell find . -type f -name '*.go' -not -path "./vendor/*")
@echo "✓ Formatting source code with gofmt ..."
@gofmt -w $(shell find . -type f -name '*.go' -not -path "./vendor/*")
lint: vendor lint: vendor
@echo "✓ Linting source code with https://golangci-lint.run/ (with --fix)..." @echo "✓ Linting source code with https://golangci-lint.run/ (with --fix)..."
@golangci-lint run --fix ./... @golangci-lint run --fix ./...
@ -43,4 +37,4 @@ schema:
@echo "✓ Generating json-schema ..." @echo "✓ Generating json-schema ..."
@go run ./bundle/internal/schema ./bundle/internal/schema ./bundle/schema/jsonschema.json @go run ./bundle/internal/schema ./bundle/internal/schema ./bundle/schema/jsonschema.json
.PHONY: fmt lint lintcheck test testonly coverage build snapshot vendor integration schema .PHONY: lint lintcheck test testonly coverage build snapshot vendor integration schema