-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #458 from TarsCloud/feat/github/action
feat: golangci-lint replace staticcheck
- Loading branch information
Showing
12 changed files
with
60 additions
and
23 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,22 +1,20 @@ | ||
name: reviewdog | ||
on: [pull_request] | ||
jobs: | ||
staticcheck: | ||
name: runner / staticcheck | ||
golangci-lint: | ||
runs-on: ubuntu-latest | ||
name: runner / golangci-lint | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: disable demo lint check | ||
run: | | ||
rm -rf tars/tools/Demo* | ||
- uses: reviewdog/action-staticcheck@v1 | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: reviewdog/action-golangci-lint@v2 | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
# Change reviewdog reporter if you need [github-pr-check,github-check,github-pr-review]. | ||
reporter: github-pr-review | ||
# Report all results. | ||
filter_mode: nofilter | ||
# Exit with 1 when it find at least one finding. | ||
# Exit with 1 when it finds at least one finding. | ||
fail_on_error: true | ||
# Set staticcheck flags | ||
staticcheck_flags: -checks=inherit,-SA1019,-SA4001 | ||
#golangci_lint_flags |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
run: | ||
timeout: 30m | ||
skip-dirs: | ||
- tars/protocol/res | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- unused | ||
- ineffassign | ||
- goimports | ||
- gofmt | ||
- misspell | ||
- unparam | ||
- unconvert | ||
- govet | ||
# - errcheck | ||
- staticcheck | ||
|
||
linters-settings: | ||
staticcheck: | ||
go: "1.17" | ||
checks: | ||
- "all" | ||
# TODO(fix) Using a deprecated function, variable, constant or field | ||
- "-SA1019" | ||
|
||
unused: | ||
go: "1.17" |
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
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,3 +1,4 @@ | ||
//go:build windows | ||
// +build windows | ||
|
||
package grace | ||
|
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