ci: go mod tidy check (#8263)

This commit is contained in:
battlmonstr 2023-09-22 09:04:25 +02:00 committed by GitHub
parent ec2f50f74e
commit 80d40ef898
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 3 deletions

View File

@ -170,6 +170,7 @@ lintci:
lint:
@cd erigon-lib && $(MAKE) lint
@./erigon-lib/tools/golangci_lint.sh
@./erigon-lib/tools/mod_tidy_check.sh
## clean: cleans the go cache, build dir, libmdbx db dir
clean:

View File

@ -90,8 +90,11 @@ lint-licenses-deps:
lint-licenses:
@./tools/licenses_check.sh
lint-mod-tidy:
@./tools/mod_tidy_check.sh
lint-deps: lintci-deps lint-licenses-deps
lint: lintci lint-licenses
lint: lintci lint-licenses lint-mod-tidy
test:
$(GOTEST) --count 1 -p 2 ./...

View File

@ -15,7 +15,7 @@ then
echo "golangci-lint tool is not found, install it with:"
echo " $scriptName --install-deps"
echo "or follow https://golangci-lint.run/usage/install/"
exit
exit 2
fi
golangci-lint run --config ./.golangci.yml

View File

@ -15,7 +15,7 @@ if ! which go-licenses > /dev/null
then
echo "go-licenses tool is not found, install it with:"
echo " go install github.com/google/go-licenses@$goLicensesVersion"
exit
exit 2
fi
# enable build tags to cover maximum .go files

View File

@ -0,0 +1,9 @@
#!/bin/bash
go mod tidy
if ! git diff --exit-code -- go.mod go.sum
then
echo "ERROR: go.mod/sum is not tidy. Run 'go mod tidy' in $PWD and commit the changes."
exit 1
fi