-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Redo github actions Signed-off-by: Steve Coffman <[email protected]> * Update golangci-lint to match gqlgen Signed-off-by: Steve Coffman <[email protected]> * Linter fixes Signed-off-by: Steve Coffman <[email protected]> --------- Signed-off-by: Steve Coffman <[email protected]>
- Loading branch information
1 parent
3c0d3ac
commit 6d16c05
Showing
32 changed files
with
183 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,33 @@ | ||
name: golangci-lint | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
branches: | ||
- main | ||
types: [ opened, synchronize ] | ||
# When a new revision is pushed to a PR, cancel all in-progress CI runs for that | ||
# PR. See https://docs.github.com/en/actions/using-jobs/using-concurrency | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
GOFLAGS: "-trimpath" | ||
GO_VERSION: 1.19 | ||
jobs: | ||
resolve-modules: | ||
name: Resolve Modules | ||
# runs-on: [self-hosted, linux, x64] | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- name: Checkout Sources | ||
uses: actions/checkout@v2 | ||
- id: set-matrix | ||
run: ./tools/resolve-modules.sh | ||
golangci: | ||
name: Linter | ||
needs: resolve-modules | ||
runs-on: ubuntu-latest | ||
golangci-lint: | ||
strategy: | ||
matrix: ${{ fromJson(needs.resolve-modules.outputs.matrix) }} | ||
matrix: | ||
go: ["1.21", "1.22"] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
# stable: 'false' # Keep this line to be able to use rc and beta version of Go (ex: 1.18.0-rc1). | ||
go-version: ${{ env.GO_VERSION }} | ||
- uses: actions/checkout@v2 | ||
- name: lint | ||
uses: golangci/[email protected] | ||
go-version: ${{ matrix.go }} | ||
- name: golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
version: latest | ||
# skip cache because of flaky behaviors | ||
skip-build-cache: true | ||
skip-pkg-cache: true | ||
working-directory: ${{ matrix.workdir }} | ||
args: --timeout 5m --issues-exit-code=0 | ||
args: '--timeout 5m' | ||
# only-new-issues: true #show only new issues if it's a pull request. options working-directory and only-new-issues are incompatible |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,54 @@ | ||
run: | ||
timeout: 10m | ||
tests: true | ||
|
||
linters-settings: | ||
errcheck: | ||
exclude-functions: | ||
- (io.Writer).Write | ||
- io.Copy | ||
- io.WriteString | ||
revive: | ||
enable-all-rules: false | ||
rules: | ||
- name: empty-lines | ||
testifylint: | ||
disable-all: true | ||
enable: | ||
- bool-compare | ||
- compares | ||
- error-is-as | ||
- error-nil | ||
- expected-actual | ||
- nil-compare | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- bodyclose | ||
- dupl | ||
- errcheck | ||
- gocritic | ||
- gofmt | ||
- goimports | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- misspell | ||
- nakedret | ||
- prealloc | ||
- revive | ||
- staticcheck | ||
- testifylint | ||
- typecheck | ||
- varcheck | ||
- unconvert | ||
- unused | ||
- structcheck | ||
- deadcode | ||
- gosimple | ||
- goimports | ||
- errcheck | ||
- staticcheck | ||
- stylecheck | ||
- gosec | ||
- asciicheck | ||
- bodyclose | ||
- exportloopref | ||
- rowserrcheck | ||
- makezero | ||
- durationcheck | ||
- prealloc | ||
- predeclared | ||
|
||
linters-settings: | ||
staticcheck: | ||
checks: ["S1002","S1004","S1007","S1009","S1010","S1012","S1019","S1020","S1021","S1024","S1030","SA2*","SA3*","SA4009","SA5*","SA6000","SA6001","SA6005", "-SA2002"] | ||
stylecheck: | ||
checks: ["-ST1003"] | ||
gosec: | ||
severity: "low" | ||
confidence: "low" | ||
excludes: | ||
- G101 | ||
- G112 | ||
issues: | ||
exclude-dirs: | ||
- bin | ||
exclude-rules: | ||
# Exclude some linters from running on tests files. | ||
- path: _test\.go | ||
linters: | ||
- dupl | ||
- errcheck | ||
- gosec | ||
- rowserrcheck | ||
- makezero |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.