diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 6a6ce9fd8c..89415a184c 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -23,41 +23,23 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: go-version-file: .go-version - #go-version: '1.21' + go-version: '1.21' cache: false - - - name: Get list of changed files - id: getDiffFile - run: | - echo "::set-output name=files::$(git diff --name-only origin/master | grep '^tencentcloud/.*\.go$' | xargs)" - shell: bash - - - name: Check for changed Go files - id: checkDiffFile - run: | - if [ -z "${{ steps.getDiffFile.outputs.files }}" ]; then - echo "No Go files changed." - exit 0 - fi - - - name: Print changed files - id: showDiffFile - run: | - echo "Changed Go files: ${{ steps.getDiffFile.outputs.files }}" # Runs a set of commands using the runners shell - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: - version: v1.63.4 - working-directory: . - args: --new-from-rev=origin/master -v ${{ steps.getDiffFile.outputs.files }} - #args: --enable-all --max-same-issues=0 --max-issues-per-linter=0 --new-from-rev=origin/master -v + skip-cache: true + version: v1.54 + working-directory: ./tencentcloud + args: --new-from-rev=origin/master -v + #args: --enable-all --max-same-issues=0 --max-issues-per-linter=0 --new-from-rev=origin/master -v \ No newline at end of file diff --git a/.golangci.yml b/.golangci.yml index 831b35d913..5dca123f41 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -10,28 +10,25 @@ issues: linters: disable-all: true enable: - - deadcode - errcheck - gofmt - gosimple - ineffassign - misspell - staticcheck - - structcheck - unconvert - unused - - varcheck - vet linters-settings: errcheck: - ignore: github.com/hashicorp/terraform-plugin-sdk/helper/schema:ForceNew|Set,fmt:.*,io:Close + exclude-functions: github.com/hashicorp/terraform-plugin-sdk/helper/schema:ForceNew|Set,fmt:.*,io:Close run: modules-download-mode: vendor timeout: 60m # The default concurrency value is the number of available CPU. - concurrency: 12 + concurrency: 4 # Allow multiple parallel golangci-lint instances running. # If false (default) - golangci-lint acquires file lock on start. - allow-parallel-runners: true + allow-parallel-runners: true \ No newline at end of file