| 1 | version: "2" |
| 2 | run: |
| 3 | timeout: 5m |
| 4 | tests: true |
| 5 | linters: |
| 6 | default: none |
| 7 | enable: |
| 8 | - errcheck |
| 9 | - govet |
| 10 | - ineffassign |
| 11 | - staticcheck |
| 12 | - unused |
| 13 | - gocritic |
| 14 | - gosec |
| 15 | - revive |
| 16 | settings: |
| 17 | errcheck: |
| 18 | # fmt.Print* / fmt.Fprint* return (n, err) where the error is |
| 19 | # "writer broke" — for stderr/stdout/cobra writers there is no |
| 20 | # actionable recovery. Excluding these matches Go community |
| 21 | # practice and keeps the wider errcheck signal useful. |
| 22 | exclude-functions: |
| 23 | - fmt.Print |
| 24 | - fmt.Println |
| 25 | - fmt.Printf |
| 26 | - fmt.Fprint |
| 27 | - fmt.Fprintln |
| 28 | - fmt.Fprintf |
| 29 | - (io.Writer).Write |
| 30 | - (io.Closer).Close |
| 31 | # Render.RenderPage failures are best-effort — by the time it |
| 32 | # returns the response is already partially written. Handlers |
| 33 | # that DO want the log line opt in via the explicit if/err |
| 34 | # pattern; bare-call sites stay terse. |
| 35 | - (*github.com/tenseleyFlow/shithub/internal/web/render.Renderer).RenderPage |
| 36 | - (*github.com/tenseleyFlow/shithub/internal/web/render.Renderer).Render |
| 37 | gosec: |
| 38 | excludes: |
| 39 | - G104 # unhandled errors — errcheck owns this signal with project-specific exclusions |
| 40 | - G115 # int->int32 narrowing — values are bounded by callers we own |
| 41 | - G109 # strconv.Atoi result narrowed to int32 — same shape as G115 |
| 42 | - G204 # subprocess launched with variable; every git exec hits this. We audit args manually. |
| 43 | - G301 # directory permissions — repo dirs deliberately use 0o750 |
| 44 | - G302 # file permissions — we use 0o640 deliberately |
| 45 | - G306 # WriteFile permissions — same rationale as G302 |
| 46 | - G304 # file inclusion via variable — paths come from validated repo lookup |
| 47 | - G601 # implicit memory aliasing in range — Go 1.22+ closed this hole |
| 48 | - G602 # slice bounds out of range — false positives on bounded slices we own |
| 49 | - G710 # open redirect — redirect targets are composed from policy-validated owner/repo names that can't escape host |
| 50 | gocritic: |
| 51 | disabled-checks: |
| 52 | # singleCaseSwitch fires inside nested action/role matrices |
| 53 | # where converting one arm to `if` would break the visual |
| 54 | # symmetry across sibling arms. Other gocritic checks remain on. |
| 55 | - singleCaseSwitch |
| 56 | revive: |
| 57 | rules: |
| 58 | - name: var-naming |
| 59 | - name: package-comments |
| 60 | disabled: true |
| 61 | - name: exported |
| 62 | disabled: true |
| 63 | formatters: |
| 64 | enable: |
| 65 | - gofumpt |
| 66 | - goimports |
| 67 | settings: |
| 68 | goimports: |
| 69 | local-prefixes: |
| 70 | - github.com/tenseleyFlow/shithub |
| 71 | issues: |
| 72 | max-issues-per-linter: 0 |
| 73 | max-same-issues: 0 |
| 74 |