A lightweight test helper package
0

Configure Feed

Select the types of activity you want to include in your feed.

Bump FollowTheProcess/ci from 1 to 2 (#67)

* Bump FollowTheProcess/ci from 1 to 2

Bumps [FollowTheProcess/ci](https://github.com/followtheprocess/ci) from 1 to 2.
- [Release notes](https://github.com/followtheprocess/ci/releases)
- [Commits](https://github.com/followtheprocess/ci/compare/v1...v2)

---
updated-dependencies:
- dependency-name: FollowTheProcess/ci
dependency-type: direct:production
update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update golangci-lint config to v2

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tom Fleet <tomfleet2018@gmail.com>

authored by

dependabot[bot]
dependabot[bot]
Tom Fleet
and committed by
GitHub
(Mar 31, 2025, 1:17 PM +0100) 2b1d289b 6d6cc616

+125 -98
+123 -96
.golangci.yml
··· 1 + version: "2" 2 + 3 + formatters: 4 + enable: 5 + - gofumpt 6 + - goimports 7 + - golines 8 + 9 + settings: 10 + gofumpt: 11 + extra-rules: true 12 + 13 + golines: 14 + max-len: 140 15 + 1 16 linters: 2 - enable-all: true 17 + default: all 3 18 disable: 4 19 - decorder # Don't care about this 5 20 - dupl # Basically every table driven test ever triggers this ··· 8 23 - exhaustruct # No 9 24 - forbidigo # Nothing to forbid 10 25 - funlen # Bad metric for complexity 11 - - gci # gofmt/goimports is fine 12 26 - ginkgolinter # I don't use whatever this is 13 27 - gochecknoglobals # Globals are fine sometimes, use common sense 14 28 - gocyclo # cyclop does this instead ··· 20 34 - lll # Auto formatters do this and what they can't do I don't care about 21 35 - maintidx # This is just the inverse of complexity... which is cyclop 22 36 - nestif # cyclop does this 37 + - nlreturn # Similar to wsl, I think best left to judgement 23 38 - nonamedreturns # Named returns are often helpful, it's naked returns that are the issue 24 39 - paralleltest # I've never had Go tests take longer than a few seconds, it's fine 25 - - tenv # Replaced by usetesting 40 + - thelper # Everything in here is a helper basically 41 + - unparam # gopls is better and more subtle 26 42 - varnamelen # Lots of false positives of things that are fine 27 43 - wrapcheck # Not every error must be wrapped 44 + - wsl # Very aggressive, some of this I like but tend to do anyway 28 45 29 - issues: 30 - exclude-rules: 31 - - path: _test\.go 32 - linters: 33 - - prealloc # These kinds of optimisations will make no difference to test code 34 - - thelper # This entire package is a test helper 35 - - goconst # Lots of repeated test input 36 - 37 - exclude-files: 38 - - internal/diff/diff.go # Code taken from go/internal/diff 39 - 40 - linters-settings: 41 - cyclop: 42 - max-complexity: 20 43 - 44 - depguard: 46 + exclusions: 47 + presets: 48 + # See https://golangci-lint.run/usage/false-positives/#exclusion-presets 49 + - comments # Revive in particular has lots of false positives 50 + - std-error-handling 51 + - common-false-positives 45 52 rules: 46 - main: 47 - deny: 48 - - pkg: io/ioutil 49 - desc: io/ioutil is deprecated, use io instead 53 + - path: _test\.go 54 + linters: 55 + - prealloc # These kinds of optimisations will make no difference to test code 56 + - gosec # Tests don't need security stuff 57 + - goconst 50 58 51 - - pkg: "math/rand$" 52 - desc: use math/rand/v2 instead 59 + paths: 60 + - internal/diff 53 61 54 - errcheck: 55 - check-type-assertions: true 56 - check-blank: true 62 + settings: 63 + cyclop: 64 + max-complexity: 20 57 65 58 - exhaustive: 59 - check: 60 - - switch 61 - - map 62 - default-signifies-exhaustive: true 66 + depguard: 67 + rules: 68 + main: 69 + deny: 70 + - pkg: io/ioutil 71 + desc: io/ioutil is deprecated, use io instead 63 72 64 - staticcheck: 65 - checks: 66 - - all 73 + - pkg: "math/rand$" 74 + desc: use math/rand/v2 instead 67 75 68 - gosimple: 69 - checks: 70 - - all 76 + errcheck: 77 + check-type-assertions: true 78 + check-blank: true 71 79 72 - govet: 73 - enable-all: true 80 + exhaustive: 81 + check: 82 + - switch 83 + - map 84 + default-signifies-exhaustive: true 74 85 75 - gofumpt: 76 - extra-rules: true 86 + staticcheck: 87 + checks: 88 + - all 77 89 78 - nakedret: 79 - max-func-lines: 0 # Disallow any naked returns 90 + gosec: 91 + excludes: 92 + - G104 # Errors not checked, handled by errcheck 80 93 81 - nolintlint: 82 - allow-unused: false 83 - require-explanation: true 84 - require-specific: true 94 + govet: 95 + enable-all: true 85 96 86 - usetesting: 87 - context-background: true 88 - context-todo: true 89 - os-chdir: true 90 - os-mkdir-temp: true 91 - os-setenv: true 92 - os-create-temp: true 93 - os-temp-dir: true 97 + nakedret: 98 + max-func-lines: 0 # Disallow any naked returns 94 99 95 - revive: 96 - max-open-files: 256 97 - ignore-generated-header: true 98 - enable-all-rules: true 99 - rules: 100 - - name: add-constant 101 - disabled: true # goconst does this 100 + nolintlint: 101 + allow-unused: false 102 + require-explanation: true 103 + require-specific: true 102 104 103 - - name: argument-limit 104 - arguments: 105 - - 5 105 + usetesting: 106 + context-background: true 107 + context-todo: true 108 + os-chdir: true 109 + os-mkdir-temp: true 110 + os-setenv: true 111 + os-create-temp: true 112 + os-temp-dir: true 106 113 107 - - name: cognitive-complexity 108 - disabled: true # gocognit does this 114 + revive: 115 + max-open-files: 256 116 + enable-all-rules: true 117 + rules: 118 + - name: add-constant 119 + disabled: true # goconst does this 109 120 110 - - name: comment-spacings 111 - arguments: 112 - - "nolint:" 121 + - name: argument-limit 122 + arguments: 123 + - 5 113 124 114 - - name: cyclomatic 115 - disabled: true # cyclop does this 125 + - name: cognitive-complexity 126 + disabled: true # gocognit does this 116 127 117 - - name: exported 118 - arguments: 119 - - checkPrivateReceivers 120 - - checkPublicInterface 128 + - name: comment-spacings 129 + arguments: 130 + - "nolint:" 121 131 122 - - name: flag-parameter 123 - disabled: true # Lots of false positives in this package 132 + - name: cyclomatic 133 + disabled: true # cyclop does this 124 134 125 - - name: function-length 126 - disabled: true # Bad proxy for complexity 135 + - name: exported 136 + arguments: 137 + - checkPrivateReceivers 138 + - checkPublicInterface 127 139 128 - - name: function-result-limit 129 - arguments: 130 - - 3 140 + - name: function-length 141 + disabled: true # Bad proxy for complexity 131 142 132 - - name: import-shadowing 133 - disabled: true # predeclared does this 143 + - name: function-result-limit 144 + arguments: 145 + - 3 134 146 135 - - name: line-length-limit 136 - disabled: true # gofmt/golines handles this well enough 147 + - name: import-shadowing 148 + disabled: true # predeclared does this 137 149 138 - - name: redefines-builtin-id 139 - disabled: true # predeclared does this 150 + - name: line-length-limit 151 + disabled: true # gofmt/golines handles this well enough 140 152 141 - - name: unhandled-error 142 - arguments: 143 - - fmt\.(Fp|P)rint(ln|f)? 144 - - strings.Builder.Write(String|Byte)? 145 - - bytes.Buffer.Write(String|Byte)? 153 + - name: max-public-structs 154 + disabled: true # This is a dumb rule 155 + 156 + - name: redefines-builtin-id 157 + disabled: true # predeclared does this 158 + 159 + - name: unhandled-error 160 + arguments: 161 + - fmt\.(Fp|P)rint(ln|f)? 162 + - strings.Builder.Write(String|Byte)? 163 + - bytes.Buffer.Write(String|Byte)? 164 + 165 + - name: flag-parameter 166 + disabled: true # As far as I can work out this just doesn't like bools 167 + 168 + - name: unused-parameter 169 + disabled: true # The gopls unused analyzer covers this better 170 + 171 + - name: unused-receiver 172 + disabled: true # As above
+1 -1
test_test.go
··· 24 24 failed bool 25 25 } 26 26 27 - func (t *TB) Helper() {} //nolint: revive // We don't use t because it does nothing 27 + func (t *TB) Helper() {} 28 28 29 29 func (t *TB) Fatal(args ...any) { 30 30 t.failed = true
+1 -1
.github/workflows/CI.yml
··· 17 17 name: CI 18 18 permissions: 19 19 contents: read 20 - uses: FollowTheProcess/ci/.github/workflows/Go.yml@v1 20 + uses: FollowTheProcess/ci/.github/workflows/Go.yml@v2