Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
version=$(echo "${stringArray[3]}")
echo "version found: ${version}"
echo "version=${version}" >>$GITHUB_OUTPUT
- name: Free Disk Space
uses: smartcontractkit/.github/actions/free-disk-space@free-disk-space/v1
Comment thread Fixed
outputs:
version: ${{ steps.parse.outputs.version }}

Expand Down
296 changes: 150 additions & 146 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,155 +1,159 @@
run:
timeout: 15m0s
version: "2"
linters:
enable:
- exhaustive
- containedctx
- copyloopvar
- revive
- goimports
- depguard
- errorlint
- exhaustive
- fatcontext
- gosec
- loggercheck
- mirror
- misspell
- noctx
- revive
- rowserrcheck
- errorlint
- unconvert
- sqlclosecheck
- noctx
- unconvert
- whitespace
- depguard
- containedctx
- fatcontext
- mirror
- loggercheck
linters-settings:
exhaustive:
default-signifies-exhaustive: true
goimports:
local-prefixes: github.com/smartcontractkit/chainlink-starknet
golint:
min-confidence: 1.0
gosec:
excludes:
- G101
- G104
# - G204
# - G304
# - G404
govet:
enable:
- shadow
settings:
printf:
# Additionally check custom logger
funcs:
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Debugf
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Infof
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Warnf
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Errorf
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Panicf
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Fatalf
- (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).AssumptionViolationf
- (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).Tracef
- (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).Criticalf
errorlint:
# Allow formatting of errors without %w
errorf: false
revive:
confidence: 0.8
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
- name: exported
- name: if-return
- name: increment-decrement
- name: var-naming
- name: var-declaration
- name: package-comments
- name: range
- name: receiver-naming
- name: time-naming
# - name: unexported-return
- name: indent-error-flow
- name: errorf
- name: empty-block
- name: superfluous-else
# - name: unused-parameter
- name: unreachable-code
- name: redefines-builtin-id
- name: waitgroup-by-value
- name: unconditional-recursion
- name: struct-tag
# - name: string-format
- name: string-of-int
- name: range-val-address
- name: range-val-in-closure
- name: modifies-value-receiver
- name: modifies-parameter
- name: identical-branches
- name: get-return
# - name: flag-parameter
- name: early-return
- name: defer
- name: constant-logical-expr
# - name: confusing-naming
# - name: confusing-results
- name: bool-literal-in-expr
- name: atomic
depguard:
settings:
depguard:
rules:
main:
list-mode: lax
deny:
- pkg: cosmossdk.io/errors
desc: Use the standard library instead
- pkg: github.com/go-gorm/gorm
desc: Use github.com/jmoiron/sqlx directly instead
- pkg: github.com/gofrs/uuid
desc: Use github.com/google/uuid instead
- pkg: github.com/pkg/errors
desc: Use the standard library instead, for example https://pkg.go.dev/errors#Join
- pkg: github.com/satori/go.uuid
desc: Use github.com/google/uuid instead
- pkg: github.com/test-go/testify/assert
desc: Use github.com/stretchr/testify/assert instead
- pkg: github.com/test-go/testify/mock
desc: Use github.com/stretchr/testify/mock instead
- pkg: github.com/test-go/testify/require
desc: Use github.com/stretchr/testify/require instead
- pkg: go.uber.org/multierr
desc: Use the standard library instead, for example https://pkg.go.dev/errors#Join
- pkg: gopkg.in/guregu/null.v1
desc: Use gopkg.in/guregu/null.v4 instead
- pkg: gopkg.in/guregu/null.v2
desc: Use gopkg.in/guregu/null.v4 instead
- pkg: gopkg.in/guregu/null.v3
desc: Use gopkg.in/guregu/null.v4 instead
- pkg: github.com/go-gorm/gorm
desc: Use github.com/jmoiron/sqlx directly instead
errorlint:
errorf: false
exhaustive:
default-signifies-exhaustive: true
gosec:
excludes:
- G101
- G104
govet:
enable:
- shadow
settings:
printf:
funcs:
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Debugf
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Infof
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Warnf
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Errorf
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Panicf
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Fatalf
- (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).AssumptionViolationf
- (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).Tracef
- (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).Criticalf
loggercheck:
rules:
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Debugw
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Infow
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Warnw
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Errorw
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Panicw
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Fatalw
- (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).AssumptionViolationw
- (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).Tracew
- (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).Criticalw
- (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).With
revive:
confidence: 0.8
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
- name: exported
- name: if-return
- name: increment-decrement
- name: var-naming
- name: var-declaration
- name: package-comments
- name: range
- name: receiver-naming
- name: time-naming
- name: indent-error-flow
- name: errorf
- name: empty-block
- name: superfluous-else
- name: unreachable-code
- name: redefines-builtin-id
- name: waitgroup-by-value
- name: unconditional-recursion
- name: struct-tag
- name: string-of-int
- name: range-val-address
- name: range-val-in-closure
- name: modifies-value-receiver
- name: modifies-parameter
- name: identical-branches
- name: get-return
- name: early-return
- name: defer
- name: constant-logical-expr
- name: bool-literal-in-expr
- name: atomic
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
main:
list-mode: lax
deny:
- pkg: "cosmossdk.io/errors"
desc: Use the standard library instead
- pkg: "github.com/go-gorm/gorm"
desc: Use github.com/jmoiron/sqlx directly instead
- pkg: "github.com/gofrs/uuid"
desc: Use github.com/google/uuid instead
- pkg: "github.com/pkg/errors"
desc: Use the standard library instead, for example https://pkg.go.dev/errors#Join
- pkg: "github.com/satori/go.uuid"
desc: Use github.com/google/uuid instead
- pkg: "github.com/test-go/testify/assert"
desc: Use github.com/stretchr/testify/assert instead
- pkg: "github.com/test-go/testify/mock"
desc: Use github.com/stretchr/testify/mock instead
- pkg: "github.com/test-go/testify/require"
desc: Use github.com/stretchr/testify/require instead
- pkg: "go.uber.org/multierr"
desc: Use the standard library instead, for example https://pkg.go.dev/errors#Join
- pkg: "gopkg.in/guregu/null.v1"
desc: Use gopkg.in/guregu/null.v4 instead
- pkg: "gopkg.in/guregu/null.v2"
desc: Use gopkg.in/guregu/null.v4 instead
- pkg: "gopkg.in/guregu/null.v3"
desc: Use gopkg.in/guregu/null.v4 instead
- pkg: github.com/go-gorm/gorm
desc: Use github.com/jmoiron/sqlx directly instead
loggercheck:
# Check that *w logging functions have even number of args (i.e., well formed key-value pairs).
rules:
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Debugw
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Infow
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Warnw
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Errorw
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Panicw
- (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Fatalw
- (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).AssumptionViolationw
- (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).Tracew
- (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).Criticalw
- (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).With
issues:
exclude-rules:
- path: test
text: "^G404:"
linters:
- gosec
# TODO: re-add gpp op file once we integrate into workflows
- path: "common/gauntlet_plus_plus_common.go"
text: ".*"
linters:
- unused
- linters:
- gosec
path: test
text: '^G404:'
- linters:
- unused
path: common/gauntlet_plus_plus_common.go
text: .*
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- goimports
settings:
goimports:
local-prefixes:
- github.com/smartcontractkit/chainlink-starknet
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ python 3.9.13

# Tools
mockery 2.53.0
golangci-lint 1.62.2
golangci-lint 2.6.2
actionlint 1.6.12
shellcheck 0.8.0
scarb 2.9.2
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ format-ts-check:

.PHONY: lint-go-ops
lint-go-ops:
cd ./ops && golangci-lint --config ../.golangci.yml --color=always --out-format checkstyle run > golangci-lint-ops-report.xml
cd ./ops && golangci-lint --config ../.golangci.yml --color=always --output.checkstyle.path ./ops/golangci-lint-ops-report.xml run

.PHONY: lint-go-relayer
lint-go-relayer:
cd ./relayer && golangci-lint --config ../.golangci.yml --color=always --out-format checkstyle run --fix
cd ./relayer && golangci-lint --config ../.golangci.yml --color=always --output.checkstyle.path ./relayer/golangci-lint-relayer-report.xml run

.PHONY: lint-go-test
lint-go-test:
cd ./integration-tests && golangci-lint --config ../.golangci.yml --color=always --out-format checkstyle run > golangci-lint-integration-tests-report.xml
cd ./integration-tests && golangci-lint --config ../.golangci.yml --color=always --output.checkstyle.path ./integration-tests/golangci-lint-integration-tests-report.xml run

.PHONY: test-go
test-go: test-unit-go test-unit-go-race test-integration-go
Expand Down
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading