|
1 | 1 | version: 2.4.3
|
2 | 2 | sources:
|
3 |
| - - source: github.com/anchore/syft/cmd/syft@latest |
4 |
| - - source: github.com/devops-kung-fu/hinge@latest |
5 |
| - - source: github.com/kisielk/errcheck@latest |
6 |
| - - source: golang.org/x/lint/golint@latest |
7 |
| - - source: github.com/fzipp/gocyclo/cmd/gocyclo@latest |
| 3 | + - source: github.com/devops-kung-fu/hinge@latest |
| 4 | + - source: github.com/kisielk/errcheck@latest |
| 5 | + - source: honnef.co/go/tools/cmd/staticcheck@latest |
| 6 | + - source: github.com/fzipp/gocyclo/cmd/gocyclo@latest |
| 7 | + - source: golang.org/x/vuln/cmd/govulncheck@latest |
8 | 8 | hooks:
|
9 | 9 | - type: pre-commit
|
10 | 10 | actions:
|
|
20 | 20 | - name: "gofmt: Run gofmt to format the code"
|
21 | 21 | exec: gofmt
|
22 | 22 | args: ["-s", "-w", "**/*.go"]
|
23 |
| - - name: "golint: Lint all go files" |
24 |
| - exec: golint |
25 |
| - args: ["-set_exit_status", "./..."] #to error out, add the arg "-set_exit_status" |
| 23 | + # - name: "staticcheck: Lint all go files" |
| 24 | + # exec: staticcheck |
| 25 | + # args: ["-f", "stylish", "-checks", "all", "./..."] #to error out, add the arg "-set_exit_status" |
26 | 26 | - name: "errcheck: Ensure that errors are checked"
|
27 | 27 | exec: errcheck
|
28 | 28 | args: ["-ignoretests", "./..."]
|
| 29 | + - name: "govulncheck: Check for vulnerabilities" |
| 30 | + exec: govulncheck |
| 31 | + args: ["./..."] |
29 | 32 | - name: "gocyclo: Check cyclomatic complexities"
|
30 | 33 | exec: gocyclo
|
31 |
| - args: ["-over", "14", "."] |
| 34 | + args: ["-over", "9", "."] |
32 | 35 | - name: Hinge
|
33 | 36 | exec: hinge
|
34 | 37 | args: ["."]
|
35 | 38 | - name: "go: Build (Ensure pulled modules do not break the build)"
|
36 | 39 | exec: go
|
37 |
| - args: ["build", "-v"] |
| 40 | + args: ["build", "-v", "./..."] |
38 | 41 | - name: "go: Run all tests"
|
39 | 42 | exec: go
|
40 | 43 | args: ["test", "-v", "-coverprofile=coverage.out", "./..."]
|
41 | 44 | - name: "go: Test coverage"
|
42 | 45 | exec: go
|
43 | 46 | args: ["tool", "cover", "-func=coverage.out"]
|
44 |
| - - name: "syft: Generate a Software Bill of Materials (SBoM)" |
45 |
| - script: " |
46 |
| - #!/bin/bash \n |
47 |
| - syft . -o cyclonedx-json=sbom/hookz.cyclonedx.json &> /dev/null \n |
48 |
| - " |
49 | 47 | - name: "git: Add all changed files during the pre-commit stage"
|
50 | 48 | exec: git
|
51 | 49 | args: ["add", "."]
|
|
0 commit comments