-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update tools, use new go-fish (#8)
* chore: Use goimports * chore: Use new go-fish * chore: Upgrade tools * chore: Fix check_fmt script
- Loading branch information
Showing
10 changed files
with
65 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
go-fish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/go-fish/go-fish.sh" | ||
|
||
[ -n "$CI" ] && exit 0 | ||
|
||
shed() { | ||
go run main.go "$@" | ||
} | ||
|
||
if GO_FILES="$(git diff --name-only --staged --diff-filter=ACMR | grep "\.go$")"; then | ||
shed run goimports -- -w $GO_FILES && git add $GO_FILES | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
#!/bin/bash | ||
|
||
if [ "$(gofmt -l . | wc -l)" -gt 0 ]; then | ||
set -eo pipefail | ||
|
||
shed() { | ||
go run main.go "$@" | ||
} | ||
|
||
if [ "$(shed run goimports -- -l . | wc -l)" -gt 0 ]; then | ||
echo "Unformatted files found:" | ||
# Run again to print files. Couldn't figure out a way to | ||
# save the output and make it work with wc. | ||
gofmt -l . | ||
shed run goimports -- -l . | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
{ | ||
"tools": { | ||
"github.com/cszatmary/go-fish": { | ||
"version": "v0.0.0-20201203230243-22d10c9b658d" | ||
"version": "v0.0.0-20210414180724-443d9e00794d" | ||
}, | ||
"github.com/golangci/golangci-lint/cmd/golangci-lint": { | ||
"version": "v1.33.0" | ||
"version": "v1.39.0" | ||
}, | ||
"github.com/goreleaser/godownloader": { | ||
"version": "v0.1.1-0.20200813202458-888d721de8bd" | ||
}, | ||
"github.com/goreleaser/goreleaser": { | ||
"version": "v0.149.0" | ||
"version": "v0.162.0" | ||
}, | ||
"golang.org/x/tools/cmd/goimports": { | ||
"version": "v0.1.0" | ||
} | ||
} | ||
} |