-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
exp: add review assistant reviewdog on top of refact
- Loading branch information
Showing
3 changed files
with
86 additions
and
3 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
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 |
---|---|---|
|
@@ -8,11 +8,8 @@ on: | |
|
||
# golangci-lint-action requires those permissions to annotate issues in the PR. | ||
permissions: | ||
# Required for analysis. | ||
contents: read | ||
# Used by `only-new-issues``. | ||
pull-requests: read | ||
# Allow access to checks to annotate code in the PR. | ||
checks: write | ||
|
||
env: | ||
|
@@ -83,3 +80,59 @@ jobs: | |
args: --timeout=10m | ||
working-directory: openshift-tests-plugin | ||
only-new-issues: true | ||
|
||
# https://github.com/reviewdog/reviewdog | ||
# https://github.com/reviewdog/action-golangci-lint | ||
reviewdog: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout' | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- uses: reviewdog/action-setup@v1 | ||
with: | ||
reviewdog_version: latest | ||
|
||
# run staticcheck | ||
- uses: reviewdog/action-staticcheck@v1 | ||
with: | ||
github_token: ${{ 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. | ||
fail_on_error: true | ||
|
||
- name: Run revive | ||
run: go install github.com/mgechev/revive@latest | ||
|
||
- name: Run golangci-lint | ||
run: |- | ||
go install \ | ||
github.com/golangci/golangci-lint/cmd/[email protected] | ||
- name: Run misspell check spelling | ||
run: go get -u github.com/client9/misspell/cmd/misspell | ||
|
||
- name: Run unparam to check for unused params | ||
run: go install mvdan.cc/unparam@latest | ||
|
||
- name: Setup security linter | ||
run: go install github.com/securego/gosec/v2/cmd/gosec@latest | ||
|
||
- name: Run reviewdog github-check | ||
continue-on-error: true | ||
run: reviewdog -reporter=github-check | ||
|
||
- name: Run reviewdog pr-review | ||
continue-on-error: true | ||
run: reviewdog -reporter=github-pr-review |
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,25 @@ | ||
runner: | ||
govet: | ||
cmd: go vet $(go list ./...) | ||
format: govet | ||
staticcheck: | ||
cmd: staticcheck $(go list ./...) | ||
errorformat: | ||
- "%f:%l:%c: %m" | ||
revive: | ||
cmd: revive -config=.revive.toml $(go list ./...) | ||
format: golint | ||
level: warning | ||
golangci: | ||
cmd: golangci-lint run --out-format=line-number ./... | ||
errorformat: | ||
- '%E%f:%l:%c: %m' | ||
- '%E%f:%l: %m' | ||
- '%C%.%#' | ||
level: warning | ||
misspell: | ||
cmd: misspell $(git ls-files) | ||
errorformat: | ||
- "%f:%l:%c: %m" | ||
gosec: | ||
cmd: gosec $(go list ./...) |