Skip to content

Commit 8067f3b

Browse files
style: add .golangci-lint.yaml
1 parent 5eff7f1 commit 8067f3b

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/gitlab.go

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

88
var CIVERSION = "dev"
99

10-
type GitLab struct {
11-
}
10+
type GitLab struct{}
1211

1312
func (gl *GitLab) Name() string {
1413
return "GitLab CI"
@@ -33,10 +32,10 @@ func (gl *GitLab) IsBranchRef() bool {
3332
func (gl *GitLab) RunCondition(config map[string]string) error {
3433
defaultBranch := config["defaultBranch"]
3534
if !gl.IsBranchRef() {
36-
return fmt.Errorf("This test run is not running on a branch build.")
35+
return fmt.Errorf("this test run is not running on a branch build")
3736
}
3837
if branch := gl.GetCurrentBranch(); defaultBranch != "*" && branch != defaultBranch {
39-
return fmt.Errorf("This test run was triggered on the branch %s, while semantic-release is configured to only publish from %s.", branch, defaultBranch)
38+
return fmt.Errorf("this test run was triggered on the branch %s, while semantic-release is configured to only publish from %s", branch, defaultBranch)
4039
}
4140
return nil
4241
}

pkg/condition/gitlab_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ func TestGitlabValid(t *testing.T) {
1111
gl := GitLab{}
1212
os.Setenv("CI_COMMIT_BRANCH", "")
1313
err := gl.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)