Skip to content

Commit

Permalink
Merge pull request #77 from bschaatsbergen/add-golangci
Browse files Browse the repository at this point in the history
bschaatsbergen authored Dec 3, 2023
2 parents 2c56d21 + 164c734 commit 5b57d1a
Showing 3 changed files with 49 additions and 4 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -11,9 +11,12 @@ jobs:
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Generate
run: go generate -v ./...
cache: true
- name: Build
run: go build -v ./...
- name: Test
- name: Run linters
uses: golangci/golangci-lint-action@v3
with:
version: latest
- name: Run tests
run: go test -v ./...
38 changes: 38 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Visit https://golangci-lint.run/ for usage documentation and information on other useful linters
issues:
max-per-linter: 0
max-same-issues: 0

exclude-rules:
# disable funlen for test funcs
- source: "^func Test"
linters:
- funlen

linters:
disable-all: true
enable:
- bidichk
- durationcheck
- decorder
- dogsled
- errcheck
- exportloopref
- forcetypeassert
- funlen
- godot
- godox
- gofmt
- gosimple
- goconst
- ineffassign
- makezero
- misspell
- nilerr
- predeclared
- staticcheck
- tenv
- unconvert
- unparam
- unused
- vet
6 changes: 5 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
@@ -17,7 +17,11 @@ var (
Short: "cidr - CLI to perform various actions on CIDR ranges",
Version: version, // The version is set during the build by making using of `go build -ldflags`
Run: func(cmd *cobra.Command, args []string) {
cmd.Help()
err := cmd.Help()
if err != nil {
fmt.Println(err)
os.Exit(1)
}
},
}
)

0 comments on commit 5b57d1a

Please sign in to comment.