Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Get rid of references and uses of go lint and go vet #4444

Merged
merged 1 commit into from Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions .golangci.yml
Expand Up @@ -35,8 +35,10 @@ linters-settings:
- (*github.com/algorand/go-algorand/data/transactions/logic.OpStream).warn

issues:
# use these new lint checks on code since #2574
new-from-rev: eb019291beed556ec6ac1ceb4a15114ce4df0c57
# Work our way back over time to be clean against all these
# checkers. If you'd like to contribute, raise the number after ~,
# run the linter and dig in.
new-from-rev: eb019291beed556ec6ac1ceb4a15114ce4df0c57~25
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


# Disable default exclude rules listed in `golangci-lint run --help` (selectively re-enable some below)
exclude-use-default: false
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -45,7 +45,7 @@ Again, if you have a patch for a critical security vulnerability, please use our

For Go code we use the [Golang guidelines defined here](https://golang.org/doc/effective_go.html).
* Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
* We use **gofmt** and **golint**. Also make sure to run `make sanity` and `make generate` before opening a pull request.
* We use **gofmt** and **golangci-lint**. Also make sure to run `make sanity` and `make generate` before opening a pull request.
* Code must be documented adhering to the official Go commentary guidelines.

For JavaScript code we use the [MDN formatting rules](https://developer.mozilla.org/en-US/docs/MDN/Contribute/Guidelines/Code_guidelines/JavaScript).
Expand Down
7 changes: 2 additions & 5 deletions Makefile
Expand Up @@ -102,13 +102,10 @@ fix: build
lint: deps
$(GOPATH1)/bin/golangci-lint run -c .golangci.yml

vet:
go vet ./...

check_shell:
find . -type f -name "*.sh" -exec shellcheck {} +

sanity: vet fix lint fmt
sanity: fix lint fmt

cover:
go test $(GOTAGS) -coverprofile=cover.out $(UNIT_TEST_SOURCES)
Expand Down Expand Up @@ -331,7 +328,7 @@ dump: $(addprefix gen/,$(addsuffix /genesis.dump, $(NETWORKS)))
install: build
scripts/dev_install.sh -p $(GOPATH1)/bin

.PHONY: default fmt vet lint check_shell sanity cover prof deps build test fulltest shorttest clean cleango deploy node_exporter install %gen gen NONGO_BIN check-go-version rebuild_swagger
.PHONY: default fmt lint check_shell sanity cover prof deps build test fulltest shorttest clean cleango deploy node_exporter install %gen gen NONGO_BIN check-go-version rebuild_swagger

###### TARGETS FOR CICD PROCESS ######
include ./scripts/release/mule/Makefile.mule
Expand Down
1 change: 0 additions & 1 deletion scripts/buildtools/install_buildtools.sh
Expand Up @@ -87,7 +87,6 @@ if [[ "${BUILDTOOLS_INSTALL}" != "ALL" ]]; then
exit 0
fi

install_go_module golang.org/x/lint golang.org/x/lint/golint
install_go_module golang.org/x/tools golang.org/x/tools/cmd/stringer
install_go_module github.com/go-swagger/go-swagger github.com/go-swagger/go-swagger/cmd/swagger
install_go_module github.com/algorand/msgp
Expand Down
1 change: 0 additions & 1 deletion scripts/check_deps.sh
Expand Up @@ -35,7 +35,6 @@ missing_dep() {
}

GO_DEPS=(
"$GO_BIN/golint"
"$GO_BIN/stringer"
"$GO_BIN/msgp"
"$GO_BIN/golangci-lint"
Expand Down
7 changes: 2 additions & 5 deletions scripts/travis/codegen_verification.sh
Expand Up @@ -47,21 +47,18 @@ function runGoLint() {
return 0
fi

echo >&2 "golint must be clean. Please run the following to list issues(${warningCount}):"
echo >&2 "golangci-lint must be clean. Please run the following to list issues(${warningCount}):"
echo >&2 " make lint"

# run the linter again to output the actual issues
"$GOPATH"/bin/golangci-lint -c .golangci.yml >&2
return 1
}

echo "Running go vet..."
make vet

echo "Running gofmt..."
runGoFmt

echo "Running golint..."
echo "Running golangci-lint..."
runGoLint

echo "Running check_license..."
Expand Down