Skip to content

Commit

Permalink
move tool installs to a hack script (#1177)
Browse files Browse the repository at this point in the history
This move unecessary tooling tasks out of the Makefile
and matches the setup in the tidb repo
  • Loading branch information
gregwebs authored and disksing committed Aug 7, 2018
1 parent 7e79908 commit 8fc28dd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
16 changes: 0 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,6 @@ test:
basic_test:
go test $(BASIC_TEST_PKGS)

tool-install: check-setup
# tool environment
# check runner
retool add gopkg.in/alecthomas/gometalinter.v2 v2.0.5
# check spelling
retool add github.com/client9/misspell/cmd/misspell v0.3.4
# checks correctness
retool add github.com/gordonklaus/ineffassign 7bae11eba15a3285c75e388f77eb6357a2d73ee2
retool add honnef.co/go/tools/cmd/megacheck master
retool add github.com/dnephin/govet 4a96d43e39d340b63daa8bc5576985aa599885f6
# slow checks
retool add github.com/kisielk/errcheck v1.1.0
# linter
retool add github.com/mgechev/revive 7773f47324c2bf1c8f7a5500aff2b6c01d3ed73b
retool add github.com/securego/gosec/cmd/gosec 1.0.0

# These need to be fixed before they can be ran regularly
check-fail:
CGO_ENABLED=0 retool do gometalinter.v2 --disable-all \
Expand Down
1 change: 1 addition & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Official lints are ran with:
make check

This will use `go get` to install `retool` which then vendors the linter tools local to the project.
Linter versions are changed with [hack/retool-install.sh](../hack/retool-install.sh).

## Testing

Expand Down
21 changes: 21 additions & 0 deletions hack/retool-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail

# This script generates tools.json
# It helps record what releases/branches are being used
which retool >/dev/null || go get github.com/twitchtv/retool

# tool environment
# check runner
retool add gopkg.in/alecthomas/gometalinter.v2 v2.0.5
# check spelling
retool add github.com/client9/misspell/cmd/misspell v0.3.4
# checks correctness
retool add github.com/gordonklaus/ineffassign 7bae11eba15a3285c75e388f77eb6357a2d73ee2
retool add honnef.co/go/tools/cmd/megacheck master
retool add github.com/dnephin/govet 4a96d43e39d340b63daa8bc5576985aa599885f6
# slow checks
retool add github.com/kisielk/errcheck v1.1.0
# linter
retool add github.com/mgechev/revive 7773f47324c2bf1c8f7a5500aff2b6c01d3ed73b
retool add github.com/securego/gosec/cmd/gosec 1.0.0

0 comments on commit 8fc28dd

Please sign in to comment.