From b793d6258fd64829cd1db7646312635b7df2dc27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Anda=20Estensen?= Date: Mon, 4 Oct 2021 13:06:21 +0200 Subject: [PATCH] Add Golangci-lint to GitHub Actions and add Deadcode linter (#9597) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Radosław Kapka Co-authored-by: Preston Van Loon Co-authored-by: terence tsao Co-authored-by: Raul Jordan --- .github/workflows/go.yml | 8 +++++++- beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go | 5 ----- config/features/flags.go | 4 ---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0afe578115..3fe5ff29d3 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -24,7 +24,7 @@ jobs: uses: ./.github/actions/gofmt with: path: ./ - + - name: GoImports checker id: goimports uses: Jerome1337/goimports-action@v1.0.2 @@ -35,6 +35,12 @@ jobs: uses: securego/gosec@master with: args: '-exclude-dir=crypto/bls/herumi ./...' + + - name: Golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + args: --print-issued-lines --sort-results --no-config --timeout=10m --disable-all -E deadcode --skip-files=validator/web/site_data.go + build: name: Build runs-on: ubuntu-latest diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go index 9ca4a02c90..957fadce78 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go @@ -43,11 +43,6 @@ var eth1DataNotification bool const eth1dataTimeout = 2 * time.Second -type eth1DataSingleVote struct { - eth1Data *ethpb.Eth1Data - blockHeight *big.Int -} - // blockData required to create a beacon block. type blockData struct { ParentRoot []byte diff --git a/config/features/flags.go b/config/features/flags.go index 283f335b83..a454777534 100644 --- a/config/features/flags.go +++ b/config/features/flags.go @@ -36,10 +36,6 @@ var ( Usage: "Enables the validator to connect to a beacon node using the --slasher flag" + "for remote slashing protection", } - disableLookbackFlag = &cli.BoolFlag{ - Name: "disable-lookback", - Usage: "Disables use of the lookback feature and updates attestation history for validators from head to epoch 0", - } disableGRPCConnectionLogging = &cli.BoolFlag{ Name: "disable-grpc-connection-logging", Usage: "Disables displaying logs for newly connected grpc clients",