-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
improve repo tooling #805
improve repo tooling #805
Changes from 1 commit
6360dd0
d8d9dc1
e2bfd03
ca3a118
245ca10
a116f7f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,39 +24,9 @@ res=0 | |
|
||
# run all verify scripts, optionally skipping any of them | ||
|
||
if [[ "${VERIFY_SHELLCHECK:-true}" == "true" ]]; then | ||
echo "verifying shellcheck ..." | ||
hack/verify/shellcheck.sh || res=1 | ||
cd "${REPO_ROOT}" | ||
fi | ||
|
||
if [[ "${VERIFY_SPELLING:-true}" == "true" ]]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these are all in lint.sh now, by way of golangci-lint |
||
echo "verifying spelling ..." | ||
hack/verify/spelling.sh || res=1 | ||
cd "${REPO_ROOT}" | ||
fi | ||
|
||
if [[ "${VERIFY_GOFMT:-true}" == "true" ]]; then | ||
echo "verifying gofmt ..." | ||
hack/verify/gofmt.sh || res=1 | ||
cd "${REPO_ROOT}" | ||
fi | ||
|
||
if [[ "${VERIFY_GOLINT:-true}" == "true" ]]; then | ||
echo "verifying golint ..." | ||
hack/verify/golint.sh || res=1 | ||
cd "${REPO_ROOT}" | ||
fi | ||
|
||
if [[ "${VERIFY_GOVET:-true}" == "true" ]]; then | ||
echo "verifying govet ..." | ||
hack/verify/govet.sh || res=1 | ||
cd "${REPO_ROOT}" | ||
fi | ||
|
||
if [[ "${VERIFY_STATICCHECK:-true}" == "true" ]]; then | ||
echo "verifying staticcheck ..." | ||
hack/verify/staticcheck.sh || res=1 | ||
if [[ "${VERIFY_LINT:-true}" == "true" ]]; then | ||
echo "verifying lints ..." | ||
hack/verify/lint.sh || res=1 | ||
cd "${REPO_ROOT}" | ||
fi | ||
|
||
|
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,24 +13,19 @@ | |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# CI script to run staticcheck | ||
# script to run linters | ||
set -o errexit -o nounset -o pipefail | ||
|
||
# cd to the repo root | ||
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" | ||
cd "${REPO_ROOT}" | ||
|
||
# enable modules and the proxy cache | ||
export GO111MODULE="on" | ||
GOPROXY="${GOPROXY:-https://proxy.golang.org}" | ||
export GOPROXY | ||
# build golangci-lint | ||
SOURCE_DIR="${REPO_ROOT}/hack/tools" hack/go_container.sh \ | ||
go build -o /out/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint | ||
|
||
# build staticcheck | ||
BINDIR="${REPO_ROOT}/bin" | ||
# use the tools module | ||
cd "hack/tools" | ||
go build -o "${BINDIR}/staticcheck" honnef.co/go/tools/cmd/staticcheck | ||
# go back to the root | ||
cd "${REPO_ROOT}" | ||
|
||
"${BINDIR}/staticcheck" ./pkg/... ./cmd/... . | ||
# run golangci-lint | ||
GO111MODULE=on bin/golangci-lint \ | ||
--enable=golint --enable=vet --enable=gofmt \ | ||
--enable=misspell \ | ||
run ./pkg/... ./cmd/... . | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this includes staticcheck and other lints by default, we're explicitly enabling a few that are not on by default:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. iterative (hot) run:
much faster than running these individually. I'm exploring the additional lints we can enable, but may leave that for a follow up. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's progress There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's more like a minute on a cold run, but that's not bad considering how much static analysis we're getting. this already caught some bugs we hadn't before, just with the default checks. |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
golangci/golangci-lint#595 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
basically: go 1.13 is stricter about the timestamps matching the source when using a pseudo-version, the module proxy is equally strict now even in 1.12 / 1.11. golangci-lint needs to update their go.mod upstream, there are PRs open for this.