Skip to content

Commit

Permalink
chore: enable use-any rule from revive
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu MOREL <[email protected]>
  • Loading branch information
mmorel-35 committed Jan 9, 2025
1 parent f307354 commit ea50139
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 29 deletions.
2 changes: 1 addition & 1 deletion server/embed/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ func (cfg *configYAML) configFromFile(path string) error {
}

// parses the yaml bytes to raw map first, then getBoolFlagVal can get the top level bool flag value.
var cfgMap map[string]interface{}
var cfgMap map[string]any
err = yaml.Unmarshal(b, &cfgMap)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions server/storage/wal/wal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func TestNew(t *testing.T) {
func TestCreateNewWALFile(t *testing.T) {
tests := []struct {
name string
fileType interface{}
fileType any
forceNew bool
}{
{
Expand Down Expand Up @@ -130,7 +130,7 @@ func TestCreateNewWALFile(t *testing.T) {
err := os.WriteFile(p, []byte("test data"), fileutil.PrivateFileMode)
require.NoError(t, err)

var f interface{}
var f any
switch tt.fileType.(type) {
case *os.File:
f, err = createNewWALFile[*os.File](p, tt.forceNew)
Expand Down
35 changes: 9 additions & 26 deletions tools/.golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,58 +44,41 @@ linters-settings: # please keep this alphabetized
# Align with https://github.com/alexkohler/nakedret/blob/v1.0.2/cmd/nakedret/main.go#L10
max-func-lines: 5
revive:
ignore-generated-header: false
severity: error
confidence: 0.8
enable-all-rules: false
rules:
- name: blank-imports
severity: error
disabled: false
- name: context-as-argument
severity: error
disabled: false
- name: context-keys-type
disabled: false
- name: dot-imports
severity: error
disabled: false
- name: error-return
severity: error
disabled: false
- name: error-naming
severity: error
disabled: false
- name: error-strings
disabled: false
- name: errorf
disabled: false
- name: if-return
severity: error
disabled: false
- name: increment-decrement
severity: error
disabled: false
- name: var-declaration
severity: error
- name: indent-error-flow
disabled: false
- name: package-comments
severity: error
disabled: false
- name: range
severity: error
disabled: false
- name: receiver-naming
severity: error
disabled: false
- name: time-naming
severity: error
disabled: false
- name: indent-error-flow
severity: error
disabled: false
- name: errorf
severity: error
- name: use-any
disabled: false
- name: context-keys-type
severity: error
disabled: false
- name: error-strings
severity: error
- name: var-declaration
disabled: false
- name: var-naming
disabled: false
Expand Down

0 comments on commit ea50139

Please sign in to comment.