Skip to content

Commit

Permalink
lint: bump golangci-lint to v1.57
Browse files Browse the repository at this point in the history
- update golangci config
- fix some new issues (revive)
  • Loading branch information
jeremmfr committed Apr 29, 2024
1 parent bded9cf commit 07d8189
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v5
with:
version: v1.56
version: v1.57
args: -c .golangci.yml -v
48 changes: 43 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,59 @@ run:
linters:
enable-all: true
disable:
# maligned # deprecated 1.38 but govet-fieldalignment not usuable
- maligned # deprecated 1.38
- interfacer # deprecated 1.38
- scopelint # deprecated 1.39
- golint # deprecated 1.41
- exhaustivestruct # deprecated 1.46
# ifshort # deprecated 1.48 but no replacement
- ifshort # deprecated 1.48
- nosnakecase # deprecated 1.48.1
- structcheck # deprecated 1.49.0
- deadcode # deprecated 1.49.0
- varcheck # deprecated 1.49.0
- deadcode # deprecated 1.49
- structcheck # deprecated 1.49
- varcheck # deprecated 1.49
- wsl
- gochecknoglobals
- gomnd
- nonamedreturns
- depguard
linters-settings:
gofumpt:
extra-rules: true
govet:
enable-all: true
revive:
rules:
# defaults
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: empty-block
- name: error-naming
- name: error-return
- name: error-strings
- name: errorf
- name: exported
- name: increment-decrement
- name: indent-error-flow
- name: package-comments
- name: range
- name: receiver-naming
- name: redefines-builtin-id
- name: superfluous-else
- name: time-naming
- name: unexported-return
- name: unreachable-code
- name: unused-parameter
- name: var-declaration
- name: var-naming
# additionals
- name: confusing-naming
- name: import-alias-naming
- name: import-shadowing
- name: unhandled-error
issues:
exclude-rules:
- path: '^example_test\.go$'
linters:
- revive
4 changes: 2 additions & 2 deletions jdecode.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func newDictAlpha() dictAlpha {
}

// gapDecode.
func gapDecode(gaps []int, dec []int) (string, error) {
func gapDecode(gaps, dec []int) (string, error) {
var num int

if len(gaps) != len(dec) {
Expand All @@ -137,7 +137,7 @@ func nibble(cref string, length int) (string, string) {
}

// gap betwean characters.
func (d *dictAlpha) gap(c1 string, c2 string) int {
func (d *dictAlpha) gap(c1, c2 string) int {
c1rune := []rune(c1)
c2rune := []rune(c2)

Expand Down

0 comments on commit 07d8189

Please sign in to comment.