Skip to content

Commit 53dda4a

Browse files
style: add .golangci-lint.yaml
1 parent 416cd5c commit 53dda4a

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

.golangci.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
linters:
2+
enable:
3+
- errorlint
4+
- forbidigo
5+
- gochecknoinits
6+
- gocritic
7+
- goconst
8+
- gocyclo
9+
- gofumpt
10+
- goimports
11+
- misspell
12+
- revive
13+
- unconvert
14+
- unparam
15+
- wastedassign
16+
17+
linters-settings:
18+
gocyclo:
19+
min-complexity: 12
20+
gofumpt:
21+
extra-rules: true
22+
govet:
23+
enable-all: true
24+
disable:
25+
- fieldalignment

pkg/condition/github.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import (
88

99
var CIVERSION = "dev"
1010

11-
type GitHubActions struct {
12-
}
11+
type GitHubActions struct{}
1312

1413
func (gha *GitHubActions) Name() string {
1514
return "GitHub Actions"
@@ -37,10 +36,10 @@ func (gha *GitHubActions) IsBranchRef() bool {
3736
func (gha *GitHubActions) RunCondition(config map[string]string) error {
3837
defaultBranch := config["defaultBranch"]
3938
if !gha.IsBranchRef() {
40-
return fmt.Errorf("This test run is not running on a branch build.")
39+
return fmt.Errorf("this test run is not running on a branch build")
4140
}
4241
if branch := gha.GetCurrentBranch(); defaultBranch != "*" && branch != defaultBranch {
43-
return fmt.Errorf("This test run was triggered on the branch %s, while semantic-release is configured to only publish from %s.", branch, defaultBranch)
42+
return fmt.Errorf("this test run was triggered on the branch %s, while semantic-release is configured to only publish from %s", branch, defaultBranch)
4443
}
4544
return nil
4645
}

pkg/condition/github_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ func TestGithubValid(t *testing.T) {
1111
gha := GitHubActions{}
1212
os.Setenv("GITHUB_REF", "")
1313
err := gha.RunCondition(map[string]string{"defaultBranch": ""})
14-
assert.EqualError(t, err, "This test run is not running on a branch build.")
14+
assert.EqualError(t, err, "this test run is not running on a branch build")
1515
}

0 commit comments

Comments
 (0)