Merge pull request #14481 from serathius/verify-fmt

makefile: Split fmt into separate verify commands
dependabot/go_modules/go.uber.org/atomic-1.10.0
Marek Siarkowicz 2022-09-19 12:38:30 +02:00 committed by GitHub
commit e0647b9d42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 27 deletions

View File

@ -29,12 +29,12 @@ test-e2e-release: build
# Static analysis
verify: verify-fmt verify-bom verify-lint verify-dep
verify: verify-gofmt verify-bom verify-lint verify-dep verify-shellcheck verify-goword verify-govet verify-revive verify-license-header verify-receiver-name verify-mod-tidy verify-shellcheck verify-shellws verify-proto-annotations
update: update-bom update-lint update-dep update-fix
.PHONY: verify-fmt
verify-fmt:
PASSES="fmt" ./scripts/test.sh
.PHONY: verify-gofmt
verify-gofmt:
PASSES="gofmt" ./scripts/test.sh
.PHONY: verify-bom
verify-bom:
@ -64,6 +64,43 @@ update-lint:
update-fix:
./scripts/fix.sh
.PHONY: verify-shellcheck
verify-shellcheck:
PASSES="shellcheck" ./scripts/test.sh
.PHONY: verify-goword
verify-goword:
PASSES="goword" ./scripts/test.sh
.PHONY: verify-govet
verify-govet:
PASSES="govet" ./scripts/test.sh
.PHONY: verify-revive
verify-revive:
PASSES="revive" ./scripts/test.sh
.PHONY: verify-license-header
verify-license-header:
PASSES="license_header" ./scripts/test.sh
.PHONY: verify-receiver-name
verify-receiver-name:
PASSES="receiver_name" ./scripts/test.sh
.PHONY: verify-mod-tidy
verify-mod-tidy:
PASSES="mod_tidy" ./scripts/test.sh
.PHONY: verify-shellws
verify-shellws:
PASSES="shellws" ./scripts/test.sh
.PHONY: verify-proto-annotations
verify-proto-annotations:
PASSES="proto_annotations" ./scripts/test.sh
# Cleanup
clean:

View File

@ -388,29 +388,6 @@ function cov_pass {
######### Code formatting checkers #############################################
function fmt_pass {
toggle_failpoints disable
# TODO: add "unparam","staticcheck", "unconvert", "ineffasign","nakedret"
# after resolving ore-existing errors.
# markdown_you - too sensitive check was temporarilly disbled.
for p in shellcheck \
goword \
gofmt \
govet \
revive \
license_header \
receiver_name \
mod_tidy \
dep \
shellcheck \
shellws \
proto_annotations \
; do
run_pass "${p}" "${@}"
done
}
function shellcheck_pass {
if tool_exists "shellcheck" "https://github.com/koalaman/shellcheck#installing"; then
generic_checker run shellcheck -fgcc scripts/*.sh