Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove default pass on linters #711

Merged
merged 5 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 9 additions & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
nix_path: nixpkgs=channel:nixos-unstable
- name: golangci-lint
run: nix develop -c make lint-go-integration-tests
- name: Print lint report artifact
if: failure()
shell: bash
run: cat ./integration-tests/golangci-lint-integration-tests-report.xml
- name: Store lint report artifact
if: always()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
Expand All @@ -35,9 +39,13 @@ jobs:
nix_path: nixpkgs=channel:nixos-unstable
- name: golangci-lint
run: nix develop -c make lint-go-relay
- name: Print lint report artifact
if: failure()
shell: bash
run: cat ./pkg/golangci-lint-relay-report.xml
- name: Store lint report artifact
if: always()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: golangci-lint-relay-report
path: ./pkg/golangci-lint-relay-report.xml
path: ./pkg/golangci-lint-relay-report.xml
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
nodejs 16.13.2
yarn 1.22.19
rust 1.59.0
golang 1.21.1
golangci-lint 1.52.1
golang 1.21.6
golangci-lint 1.55.2
pulumi 3.40.1
ginkgo 2.5.1
actionlint 1.6.22
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ gomodtidy:

.PHONY: lint-go-integration-tests
lint-go-integration-tests:
cd ./integration-tests && golangci-lint --max-issues-per-linter 0 --max-same-issues 0 --color=always --exclude=dot-imports --timeout 10m --out-format checkstyle:golangci-lint-integration-tests-report.xml run || true
cd ./integration-tests && golangci-lint --max-issues-per-linter 0 --max-same-issues 0 --color=always --exclude=dot-imports --timeout 10m --out-format checkstyle:golangci-lint-integration-tests-report.xml run

.PHONY: lint-go-relay
lint-go-relay:
cd ./pkg && golangci-lint --max-issues-per-linter 0 --max-same-issues 0 --color=always --exclude=dot-imports --timeout 10m --out-format checkstyle:golangci-lint-relay-report.xml run || true
cd ./pkg && golangci-lint --max-issues-per-linter 0 --max-same-issues 0 --color=always --exclude=dot-imports --timeout 10m --out-format checkstyle:golangci-lint-relay-report.xml run

.PHONY: upgrade-e2e-solana-image
upgrade-e2e-solana-image:
Expand Down
30 changes: 15 additions & 15 deletions flake.lock

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

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/smartcontractkit/chainlink-solana

go 1.21
go 1.21.6

require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
Expand Down
36 changes: 18 additions & 18 deletions integration-tests/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (

commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config"

test_env_sol "github.com/smartcontractkit/chainlink-solana/integration-tests/docker/test_env"
test_env_sol "github.com/smartcontractkit/chainlink-solana/integration-tests/docker/testenv"
"github.com/smartcontractkit/chainlink-solana/integration-tests/solclient"
"github.com/smartcontractkit/chainlink-solana/pkg/solana"
solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
Expand All @@ -59,7 +59,7 @@ const (
type Common struct {
IsK8s bool
ChainName string
ChainId string
ChainID string
NodeCount int
NodeOpts []test_env.ClNodeOption
TTL time.Duration
Expand All @@ -68,7 +68,7 @@ type Common struct {
K8Config *environment.Config
Env *environment.Environment
DockerEnv *SolCLClusterTestEnv
SolanaUrl string
SolanaURL string
}

type SolCLClusterTestEnv struct {
Expand Down Expand Up @@ -122,15 +122,15 @@ func New(env string, isK8s bool) *Common {
c = &Common{
IsK8s: isK8s,
ChainName: ChainName,
ChainId: DevnetChainID,
SolanaUrl: SolanaDevnetURL,
ChainID: DevnetChainID,
SolanaURL: SolanaDevnetURL,
}
} else {
c = &Common{
IsK8s: isK8s,
ChainName: ChainName,
ChainId: LocalnetChainID,
SolanaUrl: SolanaLocalNetURL,
ChainID: LocalnetChainID,
SolanaURL: SolanaLocalNetURL,
}
}
// Checking if count of OCR nodes is defined in ENV
Expand Down Expand Up @@ -171,14 +171,14 @@ func New(env string, isK8s bool) *Common {

func (c *Common) CreateSolanaChainAndNode(nodes []*client.ChainlinkClient) error {
for _, n := range nodes {
_, _, err := n.CreateSolanaChain(&client.SolanaChainAttributes{ChainID: c.ChainId})
_, _, err := n.CreateSolanaChain(&client.SolanaChainAttributes{ChainID: c.ChainID})
if err != nil {
return err
}
_, _, err = n.CreateSolanaNode(&client.SolanaNodeAttributes{
Name: ChainName,
SolanaChainID: c.ChainId,
SolanaURL: c.SolanaUrl,
SolanaChainID: c.ChainID,
SolanaURL: c.SolanaURL,
})
if err != nil {
return err
Expand All @@ -196,7 +196,7 @@ func (c *Common) CreateNodeKeysBundle(nodes []*client.ChainlinkClient) ([]client
}

peerID := p2pkeys.Data[0].Attributes.PeerID
txKey, _, err := n.CreateTxKey(ChainName, c.ChainId)
txKey, _, err := n.CreateTxKey(ChainName, c.ChainID)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -300,7 +300,7 @@ func OffChainConfigParamsFromNodes(nodeCount int, nkb []client.NodeKeysBundle) (
}, nil
}

func CreateBridges(ContractsIdxMapToContractsNodeInfo map[int]*ContractNodeInfo, mockUrl string, isK8s bool) error {
func CreateBridges(ContractsIdxMapToContractsNodeInfo map[int]*ContractNodeInfo, mockURL string, isK8s bool) error {
for i, nodesInfo := range ContractsIdxMapToContractsNodeInfo {
// Bootstrap node first
var err error
Expand All @@ -315,7 +315,7 @@ func CreateBridges(ContractsIdxMapToContractsNodeInfo map[int]*ContractNodeInfo,
}
sourceValueBridge := client.BridgeTypeAttributes{
Name: nodeContractPairID,
URL: fmt.Sprintf("%s/%s", mockUrl, "five"),
URL: fmt.Sprintf("%s/%s", mockURL, "five"),
RequestData: "{}",
}
observationSource := client.ObservationSourceSpecBridge(&sourceValueBridge)
Expand All @@ -329,7 +329,7 @@ func CreateBridges(ContractsIdxMapToContractsNodeInfo map[int]*ContractNodeInfo,
}
juelsBridge := client.BridgeTypeAttributes{
Name: nodeContractPairID + "juels",
URL: fmt.Sprintf("%s/%s", mockUrl, "five"),
URL: fmt.Sprintf("%s/%s", mockURL, "five"),
RequestData: "{}",
}
juelsSource := client.ObservationSourceSpecBridge(&juelsBridge)
Expand Down Expand Up @@ -362,7 +362,7 @@ func CreateBridges(ContractsIdxMapToContractsNodeInfo map[int]*ContractNodeInfo,
}
sourceValueBridge := client.BridgeTypeAttributes{
Name: nodeContractPairID,
URL: fmt.Sprintf("%s/%s", mockUrl, "five"),
URL: fmt.Sprintf("%s/%s", mockURL, "five"),
RequestData: "{}",
}
observationSource := client.ObservationSourceSpecBridge(&sourceValueBridge)
Expand All @@ -376,7 +376,7 @@ func CreateBridges(ContractsIdxMapToContractsNodeInfo map[int]*ContractNodeInfo,
}
juelsBridge := client.BridgeTypeAttributes{
Name: nodeContractPairID + "juels",
URL: fmt.Sprintf("%s/%s", mockUrl, "five"),
URL: fmt.Sprintf("%s/%s", mockURL, "five"),
RequestData: "{}",
}
juelsSource := client.ObservationSourceSpecBridge(&juelsBridge)
Expand Down Expand Up @@ -499,11 +499,11 @@ func BuildNodeContractPairID(node *client.ChainlinkClient, ocr2Addr string) (str
func (c *Common) DefaultNodeConfig() *cl.Config {
solConfig := solana.TOMLConfig{
Enabled: ptr.Ptr(true),
ChainID: ptr.Ptr(c.ChainId),
ChainID: ptr.Ptr(c.ChainID),
Nodes: []*solcfg.Node{
{
Name: ptr.Ptr("primary"),
URL: config.MustParseURL(c.SolanaUrl),
URL: config.MustParseURL(c.SolanaURL),
},
},
}
Expand Down
Loading
Loading