From d705c16ced3f5e0831b19972de70b0d3229391c0 Mon Sep 17 00:00:00 2001 From: Dhruv Jain <92215138+jaydee029@users.noreply.github.com> Date: Thu, 18 Apr 2024 11:46:40 +0530 Subject: [PATCH] ci: add golangci-lint (#311) Signed-off-by: Dhruv Jain <92215138+jaydee029@users.noreply.github.com> Signed-off-by: Akshay Gaikwad Co-authored-by: Akshay Gaikwad --- .github/workflows/go.yml | 20 ++++++++++++++++++++ .golangci.yml | 12 ++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .golangci.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 5d47c938..c6b3f2d9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -33,3 +33,23 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 + + golangci-lint: + strategy: + matrix: + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - name: checkout the code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + # Getting go version from the go.mod file + go-version-file: 'go.mod' + + - name: golangci-lint + uses: golangci/golangci-lint-action@v4 + with: + version: latest diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..4c8044b8 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,12 @@ +linters: + # Disable all linters untill all errors are fixed. + disable-all: true + # uncomment as we fix the linting issues + enable: + # - errcheck + # - gosimple + # - govet + # - staticcheck + # - unused + # - ineffassign + - misspell