Skip to content

reviewdog support added #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
17 changes: 17 additions & 0 deletions .github/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
linters-settings:
govet:
check-shadowing: true
golint:
min-confidence: 0
misspell:
locale: US
errcheck:
check-type-assertions: false
check-blank: false

linters:
enable-all: true

issues:
exclude-use-default: false
max-same-issues: 0
82 changes: 82 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: reviewdog
on: [pull_request]
jobs:
golangci-lint:
name: runner / golangci-lint
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v1
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--enable-all --exclude-use-default=false"

govet:
name: runner / govet
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: govet
uses: reviewdog/action-golangci-lint@v1
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--disable-all -E govet ./testdata"
tool_name: govet

staticcheck:
name: runner / staticcheck
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: staticcheck
uses: ./
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--disable-all -E staticcheck ./testdata"
tool_name: staticcheck

golint:
name: runner / golint
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: golint
uses: reviewdog/action-golangci-lint@v1
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--disable-all -E golint ./testdata"
tool_name: golint
level: warning

errcheck:
name: runner / errcheck
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: errcheck
uses: ./
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--disable-all -E errcheck ./testdata"
tool_name: errcheck
level: warning

misspell:
name: runner / misspell
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: misspell
uses: ./
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--disable-all -E misspell ./testdata"
tool_name: misspell
level: info
37 changes: 37 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 'Run golangci-lint with reviewdog'
description: 'Run golangci-lint with reviewdog on pull requests to improve code review experience.'
author: 'patil-ashutosh (reviewdog)'
inputs:
github-token:
description: 'GITHUB_TOKEN.'
required: true
golangci-lint-flags:
description: 'golangci-lint flags.'
default: ''
tool-name:
description: 'Tool name to use for reviewdog reporter'
default: 'golangci'
level:
description: 'Report level for reviewdog [info,warning,error]'
default: 'error'
reporter:
description: 'Reporter of reviewdog command [github-pr-check,github-pr-review,github-check].'
default: 'github-pr-check'
filter_mode:
description: |
Filtering for the reviewdog command [added,diff_context,file,nofilter].
Default is added.
default: 'added'
fail_on_error:
description: |
Exit code for reviewdog when errors are found [true,false]
Default is `false`.
default: 'false'
reviewdog_flags:
description: 'Additional reviewdog flags'
default: ''
workdir:
description: 'Working directory relative to the root directory.'
default: '.
runs:
modules-download-mode: vendor