Skip to content

Commit

Permalink
chore: bump dependencies, replace ice with skyapm repo, and update li…
Browse files Browse the repository at this point in the history
…nters

- Updated project dependencies to their latest versions
- Replaced ice repository with skyapm repository
- Bumped up linter versions and updated configurations

Signed-off-by: Gao Hongtao <[email protected]>
  • Loading branch information
hanahmily committed Nov 8, 2024
1 parent d2e64eb commit cf7f16a
Show file tree
Hide file tree
Showing 25 changed files with 349 additions and 341 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3.2.0
uses: golangci/golangci-lint-action@v6.1.1
with:
version: v1.47.1
version: v1.61.0
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ jobs:
test:
strategy:
matrix:
go-version: [1.17.x, 1.18.x]
go-version: [1.23.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Test
run: |
go version
Expand Down
317 changes: 159 additions & 158 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,69 +9,69 @@ linters-settings:
min-occurrences: 2
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport # https://github.com/go-critic/go-critic/issues/845
- ifElseChain
- octalLiteral
- whyNoLint
- wrapperFunc
- dupImport # https://github.com/go-critic/go-critic/issues/845
- ifElseChain
- octalLiteral
- whyNoLint
- wrapperFunc
gocyclo:
min-complexity: 20 # increased from 15 to get us going, but not make things worse
lll:
line-length: 140
misspell:
locale: US
nolintlint:
allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
allow-unused: false # report any unused nolint directives
require-explanation: false # don't require an explanation for nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
gosec:
excludes:
- G115 # integer overflow conversion
revive:
rules:
- name: unused-parameter
disabled: true

linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- errcheck
- funlen
- gochecknoinits
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- revive
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- lll
- misspell
- nakedret
- nolintlint
- rowserrcheck
- exportloopref
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
- whitespace

- bodyclose
- dogsled
- dupl
- errcheck
- funlen
- gochecknoinits
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- revive
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- lll
- misspell
- nakedret
- nolintlint
- rowserrcheck
- staticcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- whitespace
# don't enable:
# - asciicheck
# - gochecknoglobals
Expand All @@ -88,118 +88,119 @@ linters:
issues:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- path: _test\.go
linters:
- lll
- funlen
- goconst
- gocyclo
- dupl
- gochecknoinits
- path: cmd/bluge/cmd
linters:
- gochecknoinits
- path: sizes.go
linters:
- gochecknoinits

# we don't need secure random in test
- path: _test\.go
linters:
- gosec
text: G404

# allow lock test to invoke itself
- path: index/lock/lock_test.go
linters:
- gosec
text: G204

# cannot safely refactor until optimization tests are in place again
- path: index/optimize.go
linters:
- funlen

# FIXME refactor persister
- path: index/persister.go
linters:
- funlen
text: persisterLoop

# many analysis tests have non-english words
# lots of false alarms on duplicate code
- path: ^analysis/.*_test\.go$
linters:
- misspell
- dupl

# used in some analyzers
- path: analysis/lang/
linters:
- stylecheck
text: ST1018

# many language specific analyzers have
# non-english words or non-word substrings
# lots of false alrams on duplicate code
- path: ^analysis/lang/.*\.go$
linters:
- misspell
- dupl
- gocyclo
- funlen

# allow init here
- path: analysis/lang/in/scripts.go
linters:
- gochecknoinits

# and allow init here
- path: analysis/freq.go
linters:
- gochecknoinits

- path: search/searcher/search_fuzzy.go
linters:
- gochecknoinits

# has long regexp
- path: analysis/tokenizer/web.go
linters:
- lll

# needs rewrite to avoid fallthrough
# skipping funlen,gocyclo since ported
- path: analysis/char/asciifolding.go
linters:
- gocritic
- funlen
- gocyclo

# many hard-coded values
- path: numeric/geo/sloppy.go
linters:
- gochecknoinits

# allow init methods for our size calculations
- path: size.go
linters:
- gochecknoinits

# https://github.com/go-critic/go-critic/issues/926
- linters:
- gocritic
text: "unnecessaryDefer:"

# until we make final decision on config
- linters:
- gocritic
text: "config is heavy"
- path: _test\.go
linters:
- lll
- funlen
- goconst
- gocyclo
- dupl
- gochecknoinits
- path: cmd/bluge/cmd
linters:
- gochecknoinits
- path: sizes.go
linters:
- gochecknoinits

# we don't need secure random in test
- path: _test\.go
linters:
- gosec
text: G404

# allow lock test to invoke itself
- path: index/lock/lock_test.go
linters:
- gosec
text: G204

# cannot safely refactor until optimization tests are in place again
- path: index/optimize.go
linters:
- funlen

# FIXME refactor persister
- path: index/persister.go
linters:
- funlen
text: persisterLoop

# many analysis tests have non-english words
# lots of false alarms on duplicate code
- path: ^analysis/.*_test\.go$
linters:
- misspell
- dupl

# used in some analyzers
- path: analysis/lang/
linters:
- stylecheck
text: ST1018

# many language specific analyzers have
# non-english words or non-word substrings
# lots of false alrams on duplicate code
- path: ^analysis/lang/.*\.go$
linters:
- misspell
- dupl
- gocyclo
- funlen

# allow init here
- path: analysis/lang/in/scripts.go
linters:
- gochecknoinits

# and allow init here
- path: analysis/freq.go
linters:
- gochecknoinits

- path: search/searcher/search_fuzzy.go
linters:
- gochecknoinits

# has long regexp
- path: analysis/tokenizer/web.go
linters:
- lll

# needs rewrite to avoid fallthrough
# skipping funlen,gocyclo since ported
- path: analysis/char/asciifolding.go
linters:
- gocritic
- funlen
- gocyclo

# many hard-coded values
- path: numeric/geo/sloppy.go
linters:
- gochecknoinits

# allow init methods for our size calculations
- path: size.go
linters:
- gochecknoinits

# https://github.com/go-critic/go-critic/issues/926
- linters:
- gocritic
text: "unnecessaryDefer:"

# until we make final decision on config
- linters:
- gocritic
text: "config is heavy"

exclude-dirs:
- test/testdata_etc
- internal/cache
- internal/renameio
- internal/robustio

run:
skip-dirs:
- test/testdata_etc
- internal/cache
- internal/renameio
- internal/robustio
timeout: 5m
Loading

0 comments on commit cf7f16a

Please sign in to comment.