From 9f591546ae9865013d26fe25b107550d68fa8382 Mon Sep 17 00:00:00 2001 From: Rakhat Zhuman Date: Tue, 16 May 2023 07:57:23 +0600 Subject: [PATCH] add golangci-lint as code analysis tool Signed-off-by: Rakhat Zhuman --- .github/workflows/code-analysis.yml | 30 ----------------------------- .github/workflows/lint.yml | 14 ++++++-------- CHANGELOG.md | 2 +- 3 files changed, 7 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/code-analysis.yml diff --git a/.github/workflows/code-analysis.yml b/.github/workflows/code-analysis.yml deleted file mode 100644 index f3aef33a5..000000000 --- a/.github/workflows/code-analysis.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Codacy Analysis CLI - -on: - push: - branches: - - "*" - pull_request: - branches: - - "*" - -jobs: - codacy-analysis-cli: - name: Codacy Analysis CLI - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Run Codacy Analysis CLI - uses: codacy/codacy-analysis-cli-action@master - with: - output: results.sarif - format: sarif - gh-code-scanning-compat: true - max-allowed-issues: 2147483647 - - - name: Upload SARIF results file - uses: github/codeql-action/upload-sarif@main - with: - sarif_file: results.sarif \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7422aee3d..d2786f966 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,15 +18,13 @@ jobs: steps: - uses: actions/checkout@v3 with: { fetch-depth: 1 } - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: { go-version: '1.x' } - - name: Install dependencies - run: go install golang.org/x/lint/golint@latest - env: - GOBIN: ${{ env.GOROOT }}/bin - shell: bash - - run: go version - - run: make lint + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.52.2 + args: -v -c .golangci.yml prettify: name: Prettify diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ab46422c..44268c815 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,7 +33,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Adds `advanced_index_actions` guide ([#288](https://github.com/opensearch-project/opensearch-go/pull/288)) - Adds testcases to check UpdateByQuery functionality ([#304](https://github.com/opensearch-project/opensearch-go/pull/304)) - Adds additional timeout after cluster start ([#303](https://github.com/opensearch-project/opensearch-go/pull/303)) -- Adds Codacy as quality analysis tool ([#313](https://github.com/opensearch-project/opensearch-go/pull/313)) +- Adds golangci-lint in actions ([#313](https://github.com/opensearch-project/opensearch-go/pull/313)) ### Changed