Skip to content

Commit

Permalink
Linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdee committed Jun 2, 2024
1 parent 313a25d commit 334aa65
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 22 deletions.
39 changes: 22 additions & 17 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
# This file is not a configuration example,
# it contains the exhaustive configuration with explanations of the options.

issues:
# Which files to exclude: they will be analyzed, but issues from them won't be reported.
# There is no need to include all autogenerated files,
# we confidently recognize autogenerated files.
# If it's not, please let us know.
# "/" will be replaced by current OS file path separator to properly work on Windows.
# Default: []
exclude-files:
- ".*_ssz\\.go$"

# Options for analysis running.
run:
# The default concurrency value is the number of available CPU.
Expand Down Expand Up @@ -39,15 +49,6 @@ run:
# Default: true
# skip-dirs-use-default: false

# Which files to skip: they will be analyzed, but issues from them won't be reported.
# Default value is empty list,
# but there is no need to include all autogenerated files,
# we confidently recognize autogenerated files.
# If it's not please let us know.
# "/" will be replaced by current OS file path separator to properly work on Windows.
skip-files:
- ".*_ssz\\.go$"

# If set we pass it to "go list -mod={option}". From "go help modules":
# If invoked with -mod=readonly, the go command is disallowed from the implicit
# automatic updating of go.mod described above. Instead, it fails when any changes
Expand All @@ -68,7 +69,7 @@ run:
# Define the Go version limit.
# Mainly related to generics support since go1.18.
# Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.18
go: '1.19'
# go: '1.19'


# output configuration options
Expand Down Expand Up @@ -108,6 +109,10 @@ linters-settings:
lll:
line-length: 132

nlreturn:
# Allow two-line blocks without requiring a newline
block-size: 3

stylecheck:
checks: [ "all", "-ST1000" ]

Expand All @@ -118,45 +123,45 @@ linters-settings:
json: snake
yaml: snake

nlreturn:
# Allow two-line blocks without requiring a newline
block-size: 3

linters:
# Enable all available linters.
# Default: false
enable-all: true
# Disable specific linter
# https://golangci-lint.run/usage/linters/#disabled-by-default
disable:
- contextcheck
- cyclop
- deadcode
- depguard
- dupl
- err113
- execinquery
- exhaustive
- exhaustivestruct
- exhaustruct
- forbidigo
- forcetypeassert
- funlen
- gci
- gochecknoglobals
- gocognit
- goconst
- goerr113
- goheader
- golint
- gomnd
- ifshort
- interfacer
- ireturn
- inamedparam
- lll
- maligned
- mnd
- musttag
- nestif
- nilnil
- nlreturn
- nosnakecase
- perfsprint
- promlinter
- scopelint
- structcheck
- varcheck
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import (
)

// ReleaseVersion is the release version for the code.
var ReleaseVersion = "0.8.3"
var ReleaseVersion = "0.8.4"

func main() {
os.Exit(main2())
Expand Down Expand Up @@ -778,7 +778,7 @@ func startSyncCommittees(
//nolint:unparam
func runCommands(_ context.Context) (bool, error) {
if viper.GetBool("version") {
fmt.Printf("%s\n", ReleaseVersion)
fmt.Fprintf(os.Stdout, "%s\n", ReleaseVersion)
return true, nil
}

Expand Down
4 changes: 2 additions & 2 deletions services/chaindb/postgresql/proposerduties.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ LIMIT $%d`, len(queryVals)))
for i := range queryVals {
params[i] = fmt.Sprintf("%v", queryVals[i])
}
log.Trace().Str("query", strings.ReplaceAll(queryBuilder.String(), "\n", " ")).Strs("params", params).Msg("SQL query")
e.Str("query", strings.ReplaceAll(queryBuilder.String(), "\n", " ")).Strs("params", params).Msg("SQL query")
}

rows, err := tx.Query(ctx,
Expand Down Expand Up @@ -248,6 +248,6 @@ LIMIT $%d`, len(queryVals)))
}
return duties[i].ValidatorIndex < duties[j].ValidatorIndex
})
return duties, nil

return duties, nil
}
2 changes: 1 addition & 1 deletion services/eth1deposits/getlogs/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (s *Service) post(ctx context.Context, endpoint string, body io.Reader) (io
cancel()
return nil, errors.Wrap(err, "failed to create POST request")
}
req.Header.Set("Content-type", "application/json")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Accept", "application/json")
resp, err := s.client.Do(req)
if err != nil {
Expand Down

0 comments on commit 334aa65

Please sign in to comment.