1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-09-16 09:26:52 +02:00

chore: improve pre-commit

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Alexandro Becker
2021-07-24 21:15:40 -03:00
parent c63d704ce6
commit 2a304f5932
4 changed files with 5 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ export GOPROXY = https://proxy.golang.org,direct
# Setup pre-commit hooks
dev:
ln -sf ./scripts/pre-commit.sh .git/hooks/pre-commit
cp -f scripts/pre-commit.sh .git/hooks/pre-commit
.PHONY: dev
# Install dependencies

View File

@@ -241,7 +241,7 @@ func TestExecute(t *testing.T) {
AnyOf: []MockCall{
{
ExpectedArgs: []string{"a.deb"},
ExpectedEnv: osEnv(),
ExpectedEnv: osEnv(),
Stderr: "test error",
ExitCode: 1,
},

View File

@@ -514,7 +514,7 @@ func testSign(tb testing.TB, ctx *context.Context, signaturePaths []string, sign
// run the pipeline
if expectedErrMsg != "" {
err:=Pipe{}.Run(ctx)
err := Pipe{}.Run(ctx)
require.Error(tb, err)
require.Contains(tb, err.Error(), expectedErrMsg)
return

View File

@@ -1,7 +1,7 @@
#!/bin/bash
FILES=$(git diff --staged --diff-filter=AM --no-renames --name-only)
FILES=$(git diff --cached --name-only --diff-filter=ACMR)
gofumpt -s -l -w $FILES
gofumpt -s -l -w .
golangci-lint run --new --fix
git add $FILES