From 5897809e26034df4b6ff757b5d0e9f99e05e5b60 Mon Sep 17 00:00:00 2001 From: felipemadero Date: Mon, 9 Dec 2024 22:26:52 -0300 Subject: [PATCH] use lint script (#2419) --- .github/workflows/lint.yml | 6 +----- scripts/lint.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) create mode 100755 scripts/lint.sh diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3e5df7da2..fec58b1b3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,11 +21,7 @@ jobs: go-version-file: 'go.mod' - name: Lint Golang - uses: golangci/golangci-lint-action@v6 - with: - version: v1.56.2 - working-directory: . - args: --timeout 5m + run: ./scripts/lint.sh - name: Check License run: | diff --git a/scripts/lint.sh b/scripts/lint.sh new file mode 100755 index 000000000..81870c3e3 --- /dev/null +++ b/scripts/lint.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# Copyright (C) 2023, Ava Labs, Inc. All rights reserved. +# See the file LICENSE for licensing terms. + +set -o errexit +set -o nounset +set -o pipefail + +CLI_PATH=$( + cd "$(dirname "${BASH_SOURCE[0]}")" + cd .. && pwd +) + +GOLANGCI_LINT_VERSION=v1.56.2 + +go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION} +golangci-lint run --config=$CLI_PATH/.golangci.yml ./... --timeout 5m