Skip to content

Misc. build cleanup #900

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

Merged
merged 4 commits into from
Dec 30, 2019
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,9 @@ linters:
run:
skip-dirs:
- test/testdata_etc
skip-files:
- internal/cache/.*_test.go

issues:
exclude-rules:
- path: internal/(cache|renameio)/
linters:
- lll
- gochecknoinits
- gocyclo
- funlen
- internal/cache
- internal/renameio
- internal/robustio

# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
Expand Down
26 changes: 14 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ export GOPROXY = https://proxy.golang.org

# Build

fast_build: FORCE
go build -o golangci-lint ./cmd/golangci-lint
build_race: FORCE
go build -race -o golangci-lint ./cmd/golangci-lint
build: golangci-lint
.PHONY: build

build_race:
go build -race -o golangci-lint ./cmd/golangci-lint
.PHONY: build_race

clean:
rm -f golangci-lint
rm -f test/path
Expand All @@ -23,20 +25,18 @@ clean:
rm -f tools/goreleaser
rm -f tools/svg-term
rm -rf tools/node_modules
.PHONY: fast_build build build_race clean
.PHONY: clean

# Test
test: export GOLANGCI_LINT_INSTALLED = true
test: build
GL_TEST_RUN=1 time ./golangci-lint run -v
time go run ./cmd/golangci-lint/main.go run -v
GL_TEST_RUN=1 time ./golangci-lint run --fast --no-config -v --skip-dirs 'test/testdata_etc,internal/(cache|renameio|robustio)'
GL_TEST_RUN=1 time ./golangci-lint run --no-config -v --skip-dirs 'test/testdata_etc,internal/(cache|renameio|robustio)'
GL_TEST_RUN=1 time go test -v ./...
.PHONY: test

test_race:
go build -race -o golangci-lint ./cmd/golangci-lint
test_race: build_race
GL_TEST_RUN=1 ./golangci-lint run -v --timeout=5m
.PHONY: test_race

Expand All @@ -47,12 +47,14 @@ test_linters:
# Maintenance

generate: README.md docs/demo.svg install.sh vendor
.PHONY: generate

fast_generate: README.md vendor
.PHONY: fast_generate

maintainer-clean: clean
rm -f docs/demo.svg README.md install.sh
rm -rf vendor
.PHONY: generate maintainer-clean
rm -rf docs/demo.svg README.md install.sh vendor
.PHONY: maintainer-clean

check_generated:
$(MAKE) --always-make generate
Expand Down Expand Up @@ -104,6 +106,6 @@ go.mod: FORCE
go mod verify
go.sum: go.mod

.PHONY: vendor
vendor: go.mod go.sum
go mod vendor
.PHONY: vendor
14 changes: 3 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1014,17 +1014,9 @@ linters:
run:
skip-dirs:
- test/testdata_etc
skip-files:
- internal/cache/.*_test.go

issues:
exclude-rules:
- path: internal/(cache|renameio)/
linters:
- lll
- gochecknoinits
- gocyclo
- funlen
- internal/cache
- internal/renameio
- internal/robustio

# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
Expand Down
12 changes: 10 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,29 @@ get_binaries() {
darwin/arm64) BINARIES="golangci-lint" ;;
darwin/armv6) BINARIES="golangci-lint" ;;
darwin/armv7) BINARIES="golangci-lint" ;;
darwin/ppc64le) BINARIES="golangci-lint" ;;
darwin/s390x) BINARIES="golangci-lint" ;;
freebsd/386) BINARIES="golangci-lint" ;;
freebsd/amd64) BINARIES="golangci-lint" ;;
freebsd/arm64) BINARIES="golangci-lint" ;;
freebsd/armv6) BINARIES="golangci-lint" ;;
freebsd/armv7) BINARIES="golangci-lint" ;;
freebsd/ppc64le) BINARIES="golangci-lint" ;;
freebsd/s390x) BINARIES="golangci-lint" ;;
linux/386) BINARIES="golangci-lint" ;;
linux/amd64) BINARIES="golangci-lint" ;;
linux/arm64) BINARIES="golangci-lint" ;;
linux/armv6) BINARIES="golangci-lint" ;;
linux/armv7) BINARIES="golangci-lint" ;;
linux/ppc64le) BINARIES="golangci-lint" ;;
linux/s390x) BINARIES="golangci-lint" ;;
windows/386) BINARIES="golangci-lint" ;;
windows/amd64) BINARIES="golangci-lint" ;;
windows/arm64) BINARIES="golangci-lint" ;;
windows/armv6) BINARIES="golangci-lint" ;;
windows/armv7) BINARIES="golangci-lint" ;;
windows/ppc64le) BINARIES="golangci-lint" ;;
windows/s390x) BINARIES="golangci-lint" ;;
*)
log_crit "platform $PLATFORM is not supported. Make sure this script is up-to-date and file request at https://github.com/${PREFIX}/issues/new"
exit 1
Expand Down Expand Up @@ -242,8 +250,8 @@ uname_arch_check() {
untar() {
tarball=$1
case "${tarball}" in
*.tar.gz | *.tgz) tar -xzf "${tarball}" ;;
*.tar) tar -xf "${tarball}" ;;
*.tar.gz | *.tgz) tar --no-same-owner -xzf "${tarball}" ;;
*.tar) tar --no-same-owner -xf "${tarball}" ;;
*.zip) unzip "${tarball}" ;;
*)
log_err "untar unknown archive format for ${tarball}"
Expand Down