Git Product home page Git Product logo

action-golangci-lint's Introduction

reviewdog - A code review dog who keeps your codebase healthy.


reviewdog provides a way to post review comments to code hosting services, such as GitHub, automatically by integrating with any linter tools with ease. It uses an output of lint tools and posts them as a comment if findings are in the diff of patches to review.

reviewdog also supports running in the local environment to filter the output of lint tools by diff.

design doc

Table of Contents

github-pr-check sample comment in pull-request commit status sample-comment.png reviewdog-local-demo.gif

Installation

# Install the latest version. (Install it into ./bin/ by default).
$ curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s

# Specify installation directory ($(go env GOPATH)/bin/) and version.
$ curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b $(go env GOPATH)/bin [vX.Y.Z]

# In alpine linux (as it does not come with curl by default)
$ wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s [vX.Y.Z]

Nightly releases

You can also use nightly reviewdog release to try the latest reviewdog improvements every day!

$ curl -sfL https://raw.githubusercontent.com/reviewdog/nightly/master/install.sh | sh -s -- -b $(go env GOPATH)/bin

GitHub Action: reviewdog/action-setup

steps:
- uses: reviewdog/action-setup@v1
  with:
    reviewdog_version: latest # Optional. [latest,nightly,v.X.Y.Z]

homebrew / linuxbrew

You can also install reviewdog using brew:

$ brew install reviewdog/tap/reviewdog
$ brew upgrade reviewdog/tap/reviewdog

Scoop on Windows

> scoop install reviewdog

Build with go install

$ go install github.com/reviewdog/reviewdog/cmd/reviewdog@latest

Input Format

'errorformat'

reviewdog accepts any compiler or linter result from stdin and parses it with scan-f like 'errorformat', which is the port of Vim's errorformat feature.

For example, if the result format is {file}:{line number}:{column number}: {message}, errorformat should be %f:%l:%c: %m and you can pass it as -efm arguments.

$ golint ./...
comment_iowriter.go:11:6: exported type CommentWriter should have comment or be unexported
$ golint ./... | reviewdog -efm="%f:%l:%c: %m" -diff="git diff FETCH_HEAD"
name description
%f file name
%l line number
%c column number
%m error message
%% the single '%' character
... ...

Please see reviewdog/errorformat and :h errorformat if you want to deal with a more complex output. 'errorformat' can handle more complex output like a multi-line error message.

You can also try errorformat on the Playground!

With this 'errorformat' feature, reviewdog can support any tool output with ease.

Available pre-defined 'errorformat'

But, you don't have to write 'errorformat' in many cases. reviewdog supports pre-defined errorformat for major tools.

You can find available errorformat name by reviewdog -list and you can use it with -f={name}.

$ reviewdog -list
golint          linter for Go source code                                       - https://github.com/golang/lint
govet           Vet examines Go source code and reports suspicious problems     - https://golang.org/cmd/vet/
sbt             the interactive build tool                                      - http://www.scala-sbt.org/
...
$ golint ./... | reviewdog -f=golint -diff="git diff FETCH_HEAD"

You can add supported pre-defined 'errorformat' by contributing to reviewdog/errorformat

Reviewdog Diagnostic Format (RDFormat)

reviewdog supports Reviewdog Diagnostic Format (RDFormat) as a generic diagnostic format and it supports both rdjson and rdjsonl formats.

This rdformat supports rich features like multiline ranged comments, severity, rule code with URL, and code suggestions.

$ <linter> | <convert-to-rdjson> | reviewdog -f=rdjson -reporter=github-pr-review
# or
$ <linter> | <convert-to-rdjsonl> | reviewdog -f=rdjsonl -reporter=github-pr-review

Example: ESLint with RDFormat

eslint reviewdog rdjson demo

You can use eslint-formatter-rdjson to output rdjson as eslint output format.

$ npm install --save-dev eslint-formatter-rdjson
$ eslint -f rdjson . | reviewdog -f=rdjson -reporter=github-pr-review

Or you can also use reviewdog/action-eslint for GitHub Actions.

Diff

reviewdog with gofmt example

reviewdog supports diff (unified format) as an input format especially useful for code suggestions. reviewdog can integrate with any code suggestions tools or formatters to report suggestions.

-f.diff.strip: option for -f=diff: strip NUM leading components from diff file names (equivalent to 'patch -p') (default is 1 for git diff) (default 1)

$ <any-code-fixer/formatter> # e.g. eslint --fix, gofmt
$ TMPFILE=$(mktemp)
$ git diff >"${TMPFILE}"
$ git stash -u && git stash drop
$ reviewdog -f=diff -f.diff.strip=1 -reporter=github-pr-review < "${TMPFILE}"

Or you can also use reviewdog/action-suggester for GitHub Actions.

If diagnostic tools support diff output format, you can pipe the diff directly.

$ gofmt -s -d . | reviewdog -name="gofmt" -f=diff -f.diff.strip=0 -reporter=github-pr-review
$ shellcheck -f diff $(shfmt -f .) | reviewdog -f=diff

checkstyle format

reviewdog also accepts checkstyle XML format as well. If the linter supports checkstyle format as a report format, you can use -f=checkstyle instead of using 'errorformat'.

# Local
$ eslint -f checkstyle . | reviewdog -f=checkstyle -diff="git diff"

# CI (overwrite tool name which is shown in review comment by -name arg)
$ eslint -f checkstyle . | reviewdog -f=checkstyle -name="eslint" -reporter=github-check

Also, if you want to pass other Json/XML/etc... format to reviewdog, you can write a converter.

$ <linter> | <convert-to-checkstyle> | reviewdog -f=checkstyle -name="<linter>" -reporter=github-pr-check

SARIF format

reviewdog supports SARIF 2.1.0 JSON format. You can use reviewdog with -f=sarif option.

# Local
$ eslint -f @microsoft/eslint-formatter-sarif . | reviewdog -f=sarif -diff="git diff"

Code Suggestions

eslint reviewdog suggestion demo reviewdog with gofmt example

reviewdog supports code suggestions feature with rdformat or diff input. You can also use reviewdog/action-suggester for GitHub Actions.

reviewdog can suggest code changes along with diagnostic results if a diagnostic tool supports code suggestions data. You can integrate reviewdog with any code fixing tools and any code formatter with diff input as well.

Code Suggestions Support Table

Note that not all reporters provide support for code suggestions.

-reporter Suggestion support
local NO [1]
github-check NO [2]
github-pr-check NO [2]
github-pr-review OK
gitlab-mr-discussion OK
gitlab-mr-commit NO [2]
gerrit-change-review NO [1]
bitbucket-code-report NO [2]
gitea-pr-review NO [2]
  • [1] The reporter service supports the code suggestion feature, but reviewdog does not support it yet. See #678 for the status.
  • [2] The reporter service itself doesn't support the code suggestion feature.

reviewdog config file

reviewdog can also be controlled via the .reviewdog.yml configuration file instead of "-f" or "-efm" arguments.

With .reviewdog.yml, you can run the same commands for both CI service and local environment including editor integration with ease.

.reviewdog.yml

runner:
  <tool-name>:
    cmd: <command> # (required)
    errorformat: # (optional if you use `format`)
      - <list of errorformat>
    format: <format-name> # (optional if you use `errorformat`. e.g. golint,rdjson,rdjsonl)
    name: <tool-name> # (optional. you can overwrite <tool-name> defined by runner key)
    level: <level> # (optional. same as -level flag. [info,warning,error])

  # examples
  golint:
    cmd: golint ./...
    errorformat:
      - "%f:%l:%c: %m"
    level: warning
  govet:
    cmd: go vet -all .
    format: govet
  your-awesome-linter:
    cmd: awesome-linter run
    format: rdjson
    name: AwesomeLinter
$ reviewdog -diff="git diff FETCH_HEAD"
project/run_test.go:61:28: [golint] error strings should not end with punctuation
project/run.go:57:18: [errcheck]        defer os.Setenv(name, os.Getenv(name))
project/run.go:58:12: [errcheck]        os.Setenv(name, "")
# You can use -runners to run only specified runners.
$ reviewdog -diff="git diff FETCH_HEAD" -runners=golint,govet
project/run_test.go:61:28: [golint] error strings should not end with punctuation
# You can use -conf to specify config file path.
$ reviewdog -conf=./.reviewdog.yml -reporter=github-pr-check

Output format for project config based run is one of the following formats.

  • <file>: [<tool name>] <message>
  • <file>:<lnum>: [<tool name>] <message>
  • <file>:<lnum>:<col>: [<tool name>] <message>

Reporters

reviewdog can report results both in the local environment and review services as continuous integration.

Reporter: Local (-reporter=local) [default]

reviewdog can find newly introduced findings by filtering linter results using diff. You can pass the diff command as -diff arg.

$ golint ./... | reviewdog -f=golint -diff="git diff FETCH_HEAD"

Reporter: GitHub Checks (-reporter=github-pr-check)

github-pr-check sample annotation with option 1 github-pr-check sample

github-pr-check reporter reports results to GitHub Checks.

You can change the report level for this reporter by level field in config file or -level flag. You can control GitHub status check results with this feature. (default: error)

Level GitHub Status
info neutral
warning neutral
error failure

There are two options to use this reporter.

Option 1) Run reviewdog from GitHub Actions w/ secrets.GITHUB_TOKEN

Example: .github/workflows/reviewdog.yml

- name: Run reviewdog
  env:
    REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  run: |
    golint ./... | reviewdog -f=golint -reporter=github-pr-check

See GitHub Actions section too. You can also use public reviewdog GitHub Actions.

Option 2) Install reviewdog GitHub Apps

reviewdog CLI sends a request to reviewdog GitHub App server and the server post results as GitHub Checks, because Check API is only supported for GitHub App and GitHub Actions.

  1. Install reviewdog Apps. https://github.com/apps/reviewdog
  2. Set REVIEWDOG_TOKEN or run reviewdog CLI in trusted CI providers.
  • Get token from https://reviewdog.app/gh/{owner}/{repo-name}.
$ export REVIEWDOG_TOKEN="<token>"
$ reviewdog -reporter=github-pr-check

Note: Token is not required if you run reviewdog in Travis or AppVeyor.

Caution

As described above, github-pr-check reporter with Option 2 depends on reviewdog GitHub App server. The server is running with haya14busa's pocket money for now and I may break things, so I cannot ensure that the server is running 24h and 365 days.

UPDATE: Started getting support by opencollective and GitHub sponsor. See Supporting reviewdog

You can use github-pr-review reporter or use run reviewdog under GitHub Actions if you don't want to depend on reviewdog server.

Reporter: GitHub Checks (-reporter=github-check)

It's basically the same as -reporter=github-pr-check except it works not only for Pull Request but also for commit.

sample comment outside diff

You can create reviewdog badge for this reporter.

Reporter: GitHub PullRequest review comment (-reporter=github-pr-review)

sample-comment.png

github-pr-review reporter reports results to GitHub PullRequest review comments using GitHub Personal API Access Token. GitHub Enterprise is supported too.

$ export REVIEWDOG_GITHUB_API_TOKEN="<token>"
$ reviewdog -reporter=github-pr-review

For GitHub Enterprise, set the API endpoint by an environment variable.

$ export GITHUB_API="https://example.githubenterprise.com/api/v3/"
$ export REVIEWDOG_INSECURE_SKIP_VERIFY=true # set this as you need to skip verifying SSL

See GitHub Actions section too if you can use GitHub Actions. You can also use public reviewdog GitHub Actions.

Reporter: GitHub PR Annotations (-reporter=github-pr-annotations)

github-pr-annotations uses the GitHub Actions annotation format to output errors and warnings to stdout e.g.

::error line=11,col=41,file=app/index.md::[vale] reported by reviewdog 🐶%0A[demo.Spelling] Did you really mean 'boobarbaz'?%0A%0ARaw Output:%0A{"message": "[demo.Spelling] Did you really mean 'boobarbaz'?", "location": {"path": "app/index.md", "range": {"start": {"line": 11, "column": 41}}}, "severity": "ERROR"}

This reporter requires a valid GitHub API token to generate a diff, but will not use the token to report errors.

Reporter: GitLab MergeRequest discussions (-reporter=gitlab-mr-discussion)

gitlab-mr-discussion sample

Required GitLab version: >= v10.8.0

gitlab-mr-discussion reporter reports results to GitLab MergeRequest discussions using GitLab Personal API Access token. Get the token with api scope from https://gitlab.com/profile/personal_access_tokens.

$ export REVIEWDOG_GITLAB_API_TOKEN="<token>"
$ reviewdog -reporter=gitlab-mr-discussion

The CI_API_V4_URL environment variable, defined automatically by Gitlab CI (v11.7 onwards), will be used to find out the Gitlab API URL.

Alternatively, GITLAB_API can also be defined, in which case it will take precedence over CI_API_V4_URL.

$ export GITLAB_API="https://example.gitlab.com/api/v4"
$ export REVIEWDOG_INSECURE_SKIP_VERIFY=true # set this as you need to skip verifying SSL

Reporter: GitLab MergeRequest commit (-reporter=gitlab-mr-commit)

gitlab-mr-commit is similar to gitlab-mr-discussion reporter but reports results to each commit in GitLab MergeRequest.

gitlab-mr-discussion is recommended, but you can use gitlab-mr-commit reporter if your GitLab version is under v10.8.0.

$ export REVIEWDOG_GITLAB_API_TOKEN="<token>"
$ reviewdog -reporter=gitlab-mr-commit

Reporter: Gerrit Change review (-reporter=gerrit-change-review)

gerrit-change-review reporter reports results to Gerrit Change using Gerrit Rest APIs.

The reporter supports Basic Authentication and Git-cookie based authentication for reporting results.

Set GERRIT_USERNAME and GERRIT_PASSWORD environment variables for basic authentication, and put GIT_GITCOOKIE_PATH for git cookie-based authentication.

$ export GERRIT_CHANGE_ID=changeID
$ export GERRIT_REVISION_ID=revisionID
$ export GERRIT_BRANCH=master
$ export GERRIT_ADDRESS=http://<gerrit-host>:<gerrit-port>
$ reviewdog -reporter=gerrit-change-review

Reporter: Bitbucket Code Insights Reports (-reporter=bitbucket-code-report)

bitbucket-code-report bitbucket-code-annotations

bitbucket-code-report generates the annotated Bitbucket Code Insights report.

For now, only the no-filter mode is supported, so the whole project is scanned on every run. Reports are stored per commit and can be viewed per commit from Bitbucket Pipelines UI or in Pull Request. In the Pull Request UI affected code lines will be annotated in the diff, as well as you will be able to filter the annotations by This pull request or All.

If running from Bitbucket Pipelines, no additional configuration is needed (even credentials). If running locally or from some other CI system you would need to provide Bitbucket API credentials:

  • For Basic Auth you need to set the following env variables: BITBUCKET_USER and BITBUCKET_PASSWORD
  • For AccessToken Auth you need to set BITBUCKET_ACCESS_TOKEN
$ export BITBUCKET_USER="my_user"
$ export BITBUCKET_PASSWORD="my_password"
$ reviewdog -reporter=bitbucket-code-report

To post a report to the Bitbucket Server use BITBUCKET_SERVER_URL variable:

$ export BITBUCKET_USER="my_user"
$ export BITBUCKET_PASSWORD="my_password"
$ export BITBUCKET_SERVER_URL="https://bitbucket.my-company.com"
$ reviewdog -reporter=bitbucket-code-report

Supported CI services

Example: .github/workflows/reviewdog.yml

name: reviewdog
on: [pull_request]
jobs:
  reviewdog:
    name: reviewdog
    runs-on: ubuntu-latest
    steps:
      # ...
      - uses: reviewdog/action-setup@v1
        with:
          reviewdog_version: latest # Optional. [latest,nightly,v.X.Y.Z]
      - name: Run reviewdog
        env:
          REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          reviewdog -reporter=github-pr-check -runners=golint,govet
          # or
          reviewdog -reporter=github-pr-review -runners=golint,govet
Example (github-check reporter):

.github/workflows/reviewdog

Only github-check reporter can run on the push event too.

name: reviewdog (github-check)
on:
  push:
    branches:
      - master
  pull_request:

jobs:
  reviewdog:
    name: reviewdog
    runs-on: ubuntu-latest
    steps:
      # ...
      - name: Run reviewdog
        env:
          REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          reviewdog -reporter=github-check -runners=golint,govet

Public Reviewdog GitHub Actions

You can use public GitHub Actions to start using reviewdog with ease! 🎉 ▶️ 🎉

... and more on GitHub Marketplace.

Missing actions? Check out reviewdog/action-template and create a new reviewdog action!

Please open a Pull Request to add your created reviewdog actions here ✨. I can also put your repositories under reviewdog org and co-maintain the actions. Example: action-tflint.

Graceful Degradation for Pull Requests from forked repositories

Graceful Degradation example

GITHUB_TOKEN for Pull Requests from a forked repository doesn't have write access to Check API nor Review API due to GitHub Actions restriction.

Instead, reviewdog uses Logging commands of GitHub Actions to post results as annotations similar to github-pr-check reporter.

Note that there is a limitation for annotations created by logging commands, such as max # of annotations per run. You can check GitHub Actions log to see full results in such cases.

reviewdog badge reviewdog

As github-check reporter support running on commit, we can create reviewdog GitHub Action badge to check the result against master commit for example. 🎉

Example:

<!-- Replace <OWNER> and <REPOSITORY>. It assumes workflow name is "reviewdog" -->
[![reviewdog](https://github.com/<OWNER>/<REPOSITORY>/workflows/reviewdog/badge.svg?branch=master&event=push)](https://github.com/<OWNER>/<REPOSITORY>/actions?query=workflow%3Areviewdog+event%3Apush+branch%3Amaster)

Travis CI

Travis CI (-reporter=github-pr-check)

If you use -reporter=github-pr-check in Travis CI, you don't need to set REVIEWDOG_TOKEN.

Example:

install:
  - mkdir -p ~/bin/ && export PATH="~/bin/:$PATH"
  - curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b ~/bin

script:
  - reviewdog -conf=.reviewdog.yml -reporter=github-pr-check

Travis CI (-reporter=github-pr-review)

Store GitHub API token by travis encryption keys.

$ gem install travis
$ travis encrypt REVIEWDOG_GITHUB_API_TOKEN=<token> --add env.global

Example:

env:
  global:
    - secure: <token>

install:
  - mkdir -p ~/bin/ && export PATH="~/bin/:$PATH"
  - curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b ~/bin

script:
  - >-
    golint ./... | reviewdog -f=golint -reporter=github-pr-review

Examples

Circle CI

Store REVIEWDOG_GITHUB_API_TOKEN (or REVIEWDOG_TOKEN for github-pr-check) in Environment variables - CircleCI

.circleci/config.yml sample

version: 2
jobs:
  build:
    docker:
      - image: golang:latest
    steps:
      - checkout
      - run: curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b ./bin
      - run: go vet ./... 2>&1 | ./bin/reviewdog -f=govet -reporter=github-pr-review

      # Deprecated: prefer GitHub Actions to use github-pr-check reporter.
      - run: go vet ./... 2>&1 | ./bin/reviewdog -f=govet -reporter=github-pr-check

GitLab CI

Store REVIEWDOG_GITLAB_API_TOKEN in GitLab CI variable.

.gitlab-ci.yml sample

reviewdog:
  script:
    - reviewdog -reporter=gitlab-mr-discussion
    # Or
    - reviewdog -reporter=gitlab-mr-commit

Bitbucket Pipelines

No additional configuration is needed.

bitbucket-pipelines.yml sample

pipelines:
  default:
    - step:
        name: Reviewdog
        image: golangci/golangci-lint:v1.31-alpine
        script:
          - wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | 
              sh -s -- -b $(go env GOPATH)/bin
          - golangci-lint run --out-format=line-number ./... | reviewdog -f=golangci-lint -reporter=bitbucket-code-report

Common (Jenkins, local, etc...)

You can use reviewdog to post review comments from anywhere with following environment variables.

name description
CI_PULL_REQUEST Pull Request number (e.g. 14)
CI_COMMIT SHA1 for the current build
CI_REPO_OWNER repository owner (e.g. "reviewdog" for https://github.com/reviewdog/errorformat)
CI_REPO_NAME repository name (e.g. "errorformat" for https://github.com/reviewdog/errorformat)
CI_BRANCH [optional] branch of the commit
$ export CI_PULL_REQUEST=14
$ export CI_REPO_OWNER=haya14busa
$ export CI_REPO_NAME=reviewdog
$ export CI_COMMIT=$(git rev-parse HEAD)

and set a token if required.

$ REVIEWDOG_TOKEN="<token>"
$ REVIEWDOG_GITHUB_API_TOKEN="<token>"
$ REVIEWDOG_GITLAB_API_TOKEN="<token>"

If a CI service doesn't provide information such as Pull Request ID - reviewdog can guess it by a branch name and commit SHA. Just pass the flag guess:

$ reviewdog -conf=.reviewdog.yml -reporter=github-pr-check -guess

Jenkins with GitHub pull request builder plugin

$ export CI_PULL_REQUEST=${ghprbPullId}
$ export CI_REPO_OWNER=haya14busa
$ export CI_REPO_NAME=reviewdog
$ export CI_COMMIT=${ghprbActualCommit}
$ export REVIEWDOG_INSECURE_SKIP_VERIFY=true # set this as you need

# To submit via reviewdog server using github-pr-check reporter
$ REVIEWDOG_TOKEN="<token>" reviewdog -reporter=github-pr-check
# Or, to submit directly via API using github-pr-review reporter
$ REVIEWDOG_GITHUB_API_TOKEN="<token>" reviewdog -reporter=github-pr-review
# Or, to submit directly via API using github-pr-check reporter (requires GitHub App Account configured)
$ REVIEWDOG_SKIP_DOGHOUSE=true REVIEWDOG_GITHUB_API_TOKEN="<token>" reviewdog -reporter=github-pr-check

Exit codes

By default (-fail-level=none) reviewdog will return 0 as exit code even if it finds errors. reviewdog will exit with code 1 with -fail-level=[any,info,warning,error] flag if it finds at least 1 issue with severity greater than or equal to the given level. This can be helpful when you are using it as a step in your CI pipeline and want to mark the step failed if any error found by linter.

You can also use -level flag to configure default report revel.

Filter mode

reviewdog filter results by diff and you can control how reviewdog filter results by -filter-mode flag. Available filter modes are as below.

added (default)

Filter results by added/modified lines.

diff_context

Filter results by diff context. i.e. changed lines +-N lines (N=3 for example).

file

Filter results by added/modified file. i.e. reviewdog will report results as long as they are in added/modified file even if the results are not in actual diff.

nofilter

Do not filter any results. Useful for posting results as comments as much as possible and check other results in console at the same time.

-fail-on-error also works with any filter-mode and can catch all results from any linters with nofilter mode.

Example:

$ reviewdog -reporter=github-pr-review -filter-mode=nofilter -fail-on-error

Filter Mode Support Table

Note that not all reporters provide full support for filter mode due to API limitation. e.g. github-pr-review reporter uses GitHub Review API but this API don't support posting comments outside diff context, so reviewdog will use Check annotation as fallback to post those comments [1].

-reporter \ -filter-mode added diff_context file nofilter
local OK OK OK OK
github-check OK OK OK OK
github-pr-check OK OK OK OK
github-pr-review OK OK Partially Supported [1] Partially Supported [1]
github-pr-annotations OK OK OK OK
gitlab-mr-discussion OK OK OK Partially Supported [2]
gitlab-mr-commit OK Partially Supported [2] Partially Supported [2] Partially Supported [2]
gerrit-change-review OK OK? [3] OK? [3] Partially Supported? [2][3]
bitbucket-code-report NO [4] NO [4] NO [4] OK
gitea-pr-review OK OK Partially Supported [2] Partially Supported [2]
  • [1] Report results that are outside the diff file with Check annotation as fallback if it's running in GitHub actions instead of Review API (comments). All results will be reported to console as well.
  • [2] Report results that are outside the diff file to console.
  • [3] It should work, but not been verified yet.
  • [4] Not implemented at the moment

Debugging

Use the -tee flag to show debug info.

reviewdog -filter-mode=nofilter -tee

Articles

🐦 Author

haya14busa GitHub followers

Contributors

Contributors

Supporting reviewdog

Become GitHub Sponsor for each contributor or become a backer or sponsor from opencollective.

Become a backer

action-golangci-lint's People

Contributors

ashwinspg avatar aslafy-z avatar chenrui333 avatar dependabot[bot] avatar doarakko avatar f110 avatar furusax0621 avatar github-actions[bot] avatar haya14busa avatar hazcod avatar laurencega avatar massongit avatar mgrachev avatar munagekar avatar renovate-bot avatar renovate[bot] avatar review-dog avatar sam-myers avatar sawadashota avatar shmokmt avatar shogo82148 avatar upamune avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

action-golangci-lint's Issues

golangci-lint panic on Go 1.18 doesn't fail check

There are known issues in golangci-lint around 1.18 compatibility, listed below. The real issue is that this action reports success even when the underlying code fails.

Related Issues

Config

      - name: golangci-lint
        uses: reviewdog/action-golangci-lint@master
        with:
          tool_name: golangci-lint
          golangci_lint_version: v1.44.0
          reviewdog_version: v0.13.1
          go_version: '1.18.0'
          # we're not having reviewdog cache for us because we're caching across multiple actions here
          cache: false
          level: error
          fail_on_error: true
          reporter: github-pr-review
          filter_mode: diff_context

Error Output

Running golangci-lint with reviewdog 🐶 ...
  /home/runner/work/_temp/reviewdog-gvywRD/golangci-lint-1.44.0-nz1-linux-amd64/golangci-lint run --out-format line-number
  panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt
  
  goroutine 1 [running]:
  github.com/go-critic/go-critic/checkers.init.22()
  	/home/dlaird/go/pkg/mod/github.com/go-critic/[email protected]/checkers/embedded_rules.go:46 +0x4b4
  /home/runner/work/_temp/reviewdog-gvywRD/reviewdog -f=golangci-lint -name=golangci-lint -reporter=github-pr-review -filter-mode=diff_context -fail-on-error=true -level=error

image

Error with version v1.15.0 and go modules

Hello,

The action-golangci-lint worked correctly with version 1.14.1.
With version 1.15.0, I have the error message below and lint is no longer working:

Run reviewdog/[email protected]
  with:
    github_token: ***
    golangci_lint_flags: --config=.golangci.yml
    fail_on_error: true
    tool_name: golangci
    level: error
    reporter: github-pr-check
    filter_mode: added
    workdir: .
🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog
 Installing golangci-lint ... https://github.com/golangci/golangci-lint
 Running golangci-lint with reviewdog 🐶 ...
  level=error msg="Running error: context loading failed: failed to load packages: failed to load with go/packages: err: exit status 1: stderr: build flag -mod=vendor only valid when using modules\n"
  2021/01/01 20:49:27 [golangci] reported: https://github.com/smutel/terraform-provider-netbox/runs/1634636986 (conclusion=success)

Thanks.

Severity is not being passed from golangci-lint into reviewdog

When we do --out-format line-number the word error, warning, etc doesn’t appear. So golangci-lint is not telling reviewdog the severity of any issues, and setting default severity: warning in the golangci-lint config doesn’t have any effect.

The work around is to use the “checkstyle” format. Which is an XML format supported by both reviewdog and golangci-lint that includes a severity=“XXX” field.

['run', '--out-format', 'line-number', ...flags.parse(golangciLintFlags)],

Please allow specifying the version of golangci-lint

Hello, the recent change to pin golangci-lint to v1.31.0 led to some of our code passing our linting locally (because we were still on version 1.27.0) but suddenly failing in review. This is unexpected for us because it essentially "broke" our master branch (if you check it out, make a dummy commit, and send a PR, it fails our linting CI!) without us realizing. Would you please make it possible for us to specify a pinned version of golangci-lint in our github action yaml file, so that such upgrades don't sneak up on us?

Commenting feature doesn't seem to work

The linter runs and finds issues, but it doesn't seem to actually comment on my pull request. Here's how my workflow is setup:

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: docker://reviewdog/action-golangci-lint:v1.0.3 # Pre-built image
        with:
          github_token: ${{ secrets.github_token }}
          golangci_lint_flags: "--config=.github/.golangci.yml -v"
        env:
          GO111MODULE: on
          REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}

And here's my .golangci.yml:

run:
  modules-download-mode: vendor

  skip-dirs:
    - gen$

  skip-files:
    - ".*\\.pb\\.go"
    - ".*\\.gen\\.go"

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

Then here's the output of the action:

/usr/bin/docker run --name reviewdogactiongolangcilintv103_6740e8 --label 04bb81 --workdir /github/workspace --rm -e GO111MODULE -e REVIEWDOG_GITHUB_API_TOKEN -e INPUT_GITHUB_TOKEN -e INPUT_GOLANGCI_LINT_FLAGS -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/go-app/go-app":"/github/workspace" reviewdog/action-golangci-lint:v1.0.3
level=info msg="[config_reader] Used config file .github/.golangci.yml"
level=info msg="[lintersdb] Active 33 linters: [bodyclose deadcode depguard dupl errcheck funlen gochecknoglobals gochecknoinits goconst gocritic gocyclo gofmt goimports golint gosec gosimple govet ineffassign interfacer lll maligned misspell nakedret prealloc scopelint staticcheck structcheck stylecheck typecheck unconvert unparam unused varcheck]"
level=info msg="[lintersdb] Optimized sublinters [staticcheck gosimple unused stylecheck] into metalinter megacheck"
level=info msg="[loader] Go packages loading at mode 991 (imports|name|syntax|types|types_info|compiled_files|deps|types_sizes|files) took 1.379475969s"
level=info msg="[loader] SSA repr building timing: packages building 9.560552ms, total 127.168374ms"
level=info msg="[loader] Packages that do not compile: [github.com/ecobee/go-app/testdata]"
level=info msg="[runner] worker.1 took 21.074096ms with stages: unparam: 11.860542ms, dupl: 8.737957ms, gosec: 270.999µs, megacheck: 34.9µs, scopelint: 30.799µs, typecheck: 14.8µs, gocyclo: 14.3µs, prealloc: 13.7µs, errcheck: 10.4µs, funlen: 7.2µs, unconvert: 6.9µs, deadcode: 6.8µs, nakedret: 6.3µs, gochecknoglobals: 5.4µs, varcheck: 3.5µs, gofmt: 3.4µs, maligned: 2.3µs, ineffassign: 2.3µs, lll: 2.099µs, structcheck: 1.9µs, gochecknoinits: 1.8µs, goconst: 1.8µs"
level=info msg="[runner] worker.2 took 29.960253ms with stages: misspell: 21.372995ms, interfacer: 8.225859ms, gocritic: 194.699µs, govet: 95.4µs, golint: 15µs, depguard: 3.4µs, bodyclose: 2.8µs, goimports: 1.7µs"
level=info msg="[runner] Workers idle times: #1: 14.317829ms"
level=info msg="[runner] Issues before processing: 4, after processing: 2"
level=info msg="[runner] processing took 1.211594ms with stages: skip_files: 584.597µs, max_from_linter: 201.999µs, identifier_marker: 122.299µs, source_code: 106.1µs, skip_dirs: 54.299µs, nolint: 40.2µs, autogenerated_exclude: 29.5µs, filename_unadjuster: 28.6µs, cgo: 16.2µs, path_prettifier: 10.6µs, uniq_by_line: 8.9µs, path_shortener: 3.1µs, max_per_file_from_linter: 2.6µs, max_same_issues: 900ns, exclude: 700ns, diff: 600ns, exclude-rules: 400ns"
level=info msg="File cache stats: 2 entries of total size 308B"
level=info msg="Memory: 18 samples, avg is 120.6MB, max is 202.4MB"
level=info msg="Execution took 1.601896905s"
2019/09/25 11:20:13 [golangci-lint] reported: https://github.com/ecobee/go-app/runs/235583494

On the checks section, I do see 2 failures, but no in-line comments in the PR
Screen Shot 2019-09-25 at 7 29 44 AM

Action crashes when golangci-lint output is big

Action crashes with the error:

 Error: write EPIPE
      at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:98:16)

Here is failed action run: https://github.com/percona/pmm/actions/runs/3176304281/jobs/5175445409
Here is CI config: https://github.com/percona/pmm/blob/49a4a13bb1ea85f4dcee71d9166eed8e315fe551/.github/workflows/common.yml#L111-L120

I guess problem caused by huge output of golangci-lint, because everything works fine when there are just few linter warnings.

Problems with typecheck after release v1.20.0

I got this messages with go 1.16 after the new release v1.20.0:

  • ReadFile not declared by package os (typecheck)
  • ReadAll not declared by package io (typecheck)

Running golangci-lint locally works fine. Do I have to set go version somewhere explicitly to fix this problem?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/codeql-analysis.yml
  • actions/checkout v4
  • github/codeql-action v3
  • github/codeql-action v3
  • github/codeql-action v3
.github/workflows/release.yml
  • actions/checkout v4
  • haya14busa/action-bumpr v1
  • haya14busa/action-update-semver v1
  • haya14busa/action-cond v1
  • actions/checkout v4
  • haya14busa/action-bumpr v1
.github/workflows/reviewdog.yml
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • reviewdog/action-actionlint v1
  • actions/checkout v4
  • actions/setup-node v4
  • reviewdog/action-eslint v1
.github/workflows/test.yml
  • actions/checkout v4
  • actions/setup-node v4
gomod
go.mod
  • go 1.19
npm
package.json
  • @actions/cache 3.2.4
  • @actions/core 1.10.1
  • @actions/exec 1.1.1
  • @actions/http-client 2.2.1
  • @actions/tool-cache 2.0.1
  • semver 7.6.2
  • @types/jest 29.5.12
  • @types/node ^20.6.0
  • @types/semver 7.5.8
  • @typescript-eslint/parser 7.18.0
  • @vercel/ncc 0.38.1
  • eslint 8.57.0
  • eslint-plugin-import 2.29.1
  • eslint-plugin-jest 28.8.0
  • jest 29.7.0
  • js-yaml 4.1.0
  • prettier 3.3.3
  • ts-jest 29.2.4
  • typescript 5.4.5
  • node >=20.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

Running error: context loading failed: failed to load program with go/packages: could not determine GOARCH and Go compiler

Hi,
I'm trying to use the linter with one of my private github go projects.

on: [pull_request]
jobs:
  golangci-lint:
    name: runner / golangci-lint
    runs-on: ubuntu-latest
    steps:
      - name: Install Go
        uses: actions/setup-go@v1
        with:
          go-version: 1.13
      - name: Check out code into the Go module directory
        uses: actions/checkout@v1
      - name: Configure git for private modules
        env:
          TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
        run: git config --global url."https://MY_USER:${TOKEN}@github.com".insteadOf "https://github.com"
      - name: vendor 
        run: go mod vendor
        env:
          GOPRIVATE: github.com/MYORG/*
      - name: golangci-lint
        uses: reviewdog/action-golangci-lint@v1
        with:
          github_token: ${{ secrets.github_token }}
          golangci_lint_flags: "--config=.golangci.yml -v"

My .golangci.yml file:

run:
  modules-download-mode: vendor

This project uses Go Modules, and references a private repo in Github

the golangci-lint step fails with this error:

level=warning msg="Failed to discover go env: failed to run 'go env': exit status 2"
level=info msg="[lintersdb] Active 10 linters: [deadcode errcheck gosimple govet ineffassign staticcheck structcheck typecheck unused varcheck]"
level=info msg="[loader] Go packages loading at mode 575 (imports|name|types_sizes|compiled_files|exports_file|files|deps) took 5.496611ms"
level=error msg="Running error: context loading failed: failed to load program with go/packages: could not determine GOARCH and Go compiler"```

Path of go.mod for cache key

The hash for the cache key is calculated by hashFiles(path.join(cwd, "go.sum")); and $cwd points to workdir user specified. Therefore, path will be $workdir/go.sum.

const hash = await hashFiles(path.join(cwd, "go.sum"));

However, I think path for the cache key should be <dir of $go_version_file>/go.sum (sibling of go.mod) if go_version_file is specified.

My situation is that single go.mod/go.sum but multi project. And each project has own GitHub Actions with reviewdog/action-golangci-lint setting workdir to project_a / project_b.

  • /root
    • go.mod
    • go.sum
    • /project_a
      • go files
    • /project_b
      • go files

Fix: update download url of reviewdog

Action crashes with the error:

🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog
  finding a release for latest
Error: Error: unable to find 'latest' - use 'latest' or see https://github.com/reviewdog/reviewdog/releases for details

Same issue reviewdog/reviewdog#1380.

As discussed within issune above, the cause seems to be silent updates on GitHub.

So I have created a PR to change download url url for that.

#495

Module Plugin System support

Just wanted to check how to use this action with golangci-lint's Module Plugin System?

More context:

I have a project that is currently using reviewdog/action-golangci-lint@v2 to run golangci-lint. Everything is fine.

  go-lint:
    name: "Lint Go"
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: versions
      id: versions
      run: |
        cat go.mod | grep "^go" | awk '{print "go="$2}' >> $GITHUB_OUTPUT
        cat go.mod | grep golangci-lint | awk '{print "golangci-lint="$2}' >> $GITHUB_OUTPUT
    - name: golangci-lint
      uses: reviewdog/action-golangci-lint@v2
      with:
        go_version: ${{ steps.versions.outputs.go }}
        golangci_lint_version: ${{ steps.versions.outputs.golangci-lint }}
        reporter: github-pr-review
        filter_mode: nofilter
        golangci_lint_flags: '--config=.golangci.yml --timeout=9m --new-from-rev=HEAD~1'
        fail_on_error: true

Now I'm integrating uber-go/nilaway into our golangci-lint as per documentation here.

So locally, instead of simply use golangci-lint run ./..., I will need to use a custom gcl like this:

  • golangci-lint custom
  • ./custom-gcl run ./...

How can I utilize reviewdog/action-golangci-lint to run custom-gcl on GitHub Actions?

Can't use golangci-lint new-from-rev option

I want to use the golangci-lint new-from-rev option (details). However, I encounter this issue

Run reviewdog/action-golangci-lint@v2
Installing Go ...
go env

🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog
Installing golangci-lint ... https://github.com/golangci/golangci-lint
Restoring cache ...
Running golangci-lint ...
  /home/runner/work/_temp/reviewdog-0dbL9P/golangci-lint-1.58.1-linux-amd[64](https://github.com/PixoPH/pdax-imm-internal-market-making/actions/runs/9016044362/job/24771840077#step:3:66)/golangci-lint run --out-format line-number --config=.golangci-lint.yaml --new-from-rev=develop
  level=warning msg="The linter 'execinquery' is deprecated (since v1.58.0) due to: The repository of the linter has been archived by the owner. "
  level=warning msg="[runner] Can't process result by diff processor: can't prepare diff by revgrep: could not read git repo: error executing \"git diff --color=never --no-ext-diff --default-prefix --relative develop --\": exit status 128: fatal: bad revision 'develop'\n"

Here's my action file

    name: lint
    runs-on: ubuntu-latest
    steps:
      - name: Check out code into the Go module directory
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Run lint check
        uses: reviewdog/action-golangci-lint@v2
        with:
          reporter: github-pr-review
          golangci_lint_flags: "--config=.golangci-lint.yaml --new-from-rev=${{ github.base_ref }}"

Is there any suggestion to make it work? Thanks

Allow specify cache key when caching

Hey there. Hope everyone is well and safe.

We've been using reviewdog in our company, and it has been working really great.

But we are facing a challenge. We are using pull_request_target for our specific purpose, which leads to some concurrency problems when saving / restoring caches.

Because pull_request_target runs under base branch, when we have multiple PRs pointing to base branch, it causes some conflicts.

The way we see it might solve our specific problem is allowing us to control which is the cache key value, instead of using the generated one: https://github.com/reviewdog/action-golangci-lint/blob/master/src/cache.ts#L17

I am wondering if that is a desired feature for reviewdog action-golangci-lint.

If it is, I can test a solution within my company and provide further pull request here.

502 Server Error

Hello,

Currently I have this issue on my repo.
I don't understand where the error is.
Could you please help me understand this ?

https://github.com/smutel/terraform-provider-netbox/runs/571961907

Run reviewdog/[email protected]
  with:
    github_token: ***
    tool_name: golangci
    level: error
    reporter: github-pr-check
/usr/bin/docker run --name d00b33823f6f6ee2af4d7fb7d3ff1187414627_6d30ba --label d00b33 --workdir /github/workspace --rm -e INPUT_GITHUB_TOKEN -e INPUT_GOLANGCI_LINT_FLAGS -e INPUT_TOOL_NAME -e INPUT_LEVEL -e INPUT_REPORTER -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/terraform-provider-netbox/terraform-provider-netbox":"/github/workspace" d00b33:823f6f6ee2af4d7fb7d3ff1187414627
reviewdog: post failed for golangci: fail to parse diff: GET https://api.github.com/repos/smutel/terraform-provider-netbox/pulls/1: 502 Server Error []

Thanks.

no go files to analyze

Running on the chainlink repo we get:

level=error msg="Running error: context loading failed: no go files to analyze"
level=error msg="Timeout exceeded: try increasing it by passing --timeout option"

Is this a bug or a misconfiguration?

on: [push] - reviewdog this is not a PullRequest build.

Hi, how can this action be run on other events than pull_request ?

Screenshot 2021-02-15 at 18 24 00

Rubens-MBP:crc16 ruben$ cat .github/workflows/reviewdog.yaml 
name: reviewdog
on: [push, 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:
          golangci_lint_flags: "--enable-all --exclude-use-default=false"

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Downloaded binaries are not removed

In script.sh, reviewdog and golangci-lint binaries are downloaded, but not removed.
They take about 35MB of disk space, and since temp directory name is used they are duplicated on every build.
Can they be deleted as the last step in the script?

Failed golangci-lint run does not cause check to fail

If golangci-lint fails to run for any reason, then I would like the GitHub check to end with a failure also.
Is there a way to achieve that?

Output of reviewdog:

Running golangci-lint with reviewdog 🐶 ...
  level=error msg="Running error: buildir: analysis skipped: errors in package: [/home/runner/work/redacted.go:346:17: Broken not declared by package context]"
  2021/02/09 12:11:20 [golangci] reported: https://github.com/redacted/runs/1862870704 (conclusion=success)

Configuration:

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
            - uses: actions/setup-go@v2
              with:
                  go-version: "^1.15.7"
            - name: golangci-lint
              uses: reviewdog/action-golangci-lint@v1
              with:
                  filter_mode: nofilter

fail_on_error does not work for golangci-lint

Hi,
My github action yml is simple:

name: reviewdog
on: [push, pull_request]
jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
fail_on_error: true

In Github actions I see the result:
But test looks as passed - it's green

111

I need to notify user that linter catch the error and commit is bad.
How can I make it Red?

Gitlab compatibility

Is possible to use this action on gitlab?

After a brief reading of the code seems to be designed only for github

Reviewdog crashes with error: `reviewdog: environment variable $REVIEWDOG_GITHUB_API_TOKEN is not set`

Reviewdog crashes with error: reviewdog: environment variable $REVIEWDOG_GITHUB_API_TOKEN is not set

Workflow:

name: Code analysis

on: [pull_request]

jobs:
  golangci-lint:
    runs-on: ubuntu-latest
    steps:
      - name: Check out code into the Go module directory
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Linting with golangci-lint
        uses: reviewdog/action-golangci-lint@v2
        with:
          github_token: ${{ secrets.ACCESS_TOKEN }}
          reporter: github-pr-review
        env:
          REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.ACCESS_TOKEN }}

Action log: https://github.com/pterm/pterm/actions/runs/5423793140/jobs/9862524142?pr=507

exec user process caused

I'm seeing this error for a dozen containers I tried.

docker run reviewdog/action-golangci-lint:v1.8
standard_init_linux.go:219: exec user process caused: no such file or directory

The error points to line endings from windows. Where is the dockerfile? I see a few branches, but it's not clear which one is being used to generate the docker images.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.