Skip to content

Commit

Permalink
Get rid of references and uses of go lint and go vet
Browse files Browse the repository at this point in the history
  • Loading branch information
jannotti committed Aug 22, 2022
1 parent e4d6d42 commit 80246b7
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 15 deletions.
6 changes: 4 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
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

# 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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 80246b7

Please sign in to comment.