Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 9 additions & 27 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 3 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading