All Projects → dominikh → staticcheck-action

dominikh / staticcheck-action

Licence: MIT license
Staticcheck's official GitHub Action

Projects that are alternatives of or similar to staticcheck-action

Go Tools
Staticcheck - The advanced Go linter
Stars: ✭ 4,317 (+9085.11%)
Mutual labels:  linter, static-analysis, linters, staticcheck
lints
Lint all your JavaScript, CSS, HTML, Markdown and Dockerfiles with a single command
Stars: ✭ 14 (-70.21%)
Mutual labels:  linter, static-analysis, linters
goreporter
A Golang tool that does static analysis, unit testing, code review and generate code quality report.
Stars: ✭ 3,019 (+6323.4%)
Mutual labels:  linter, static-analysis, staticcheck
Goreporter
A Golang tool that does static analysis, unit testing, code review and generate code quality report.
Stars: ✭ 2,943 (+6161.7%)
Mutual labels:  linter, static-analysis, staticcheck
inline-plz
Inline your lint messages
Stars: ✭ 32 (-31.91%)
Mutual labels:  static-analysis, linters
actionlint
Static checker for GitHub Actions workflow files
Stars: ✭ 1,385 (+2846.81%)
Mutual labels:  linter, actions
dlint
Dlint is a tool for encouraging best coding practices and helping ensure Python code is secure.
Stars: ✭ 130 (+176.6%)
Mutual labels:  linter, static-analysis
ramllint
RAML Linter
Stars: ✭ 18 (-61.7%)
Mutual labels:  linter, static-analysis
go-perfguard
CPU-guided performance analyzer for Go
Stars: ✭ 58 (+23.4%)
Mutual labels:  linter, static-analysis
sonar-css-plugin
SonarQube CSS / SCSS / Less Analyzer
Stars: ✭ 46 (-2.13%)
Mutual labels:  linter, static-analysis
mllint
`mllint` is a command-line utility to evaluate the technical quality of Python Machine Learning (ML) projects by means of static analysis of the project's repository.
Stars: ✭ 67 (+42.55%)
Mutual labels:  linter, static-analysis
eslint-config
🚀 Jetrockets Standarts | ESLint
Stars: ✭ 20 (-57.45%)
Mutual labels:  linter, linters
tryceratops
A linter to prevent exception handling antipatterns in Python (limited only for those who like dinosaurs).
Stars: ✭ 381 (+710.64%)
Mutual labels:  linter, static-analysis
Revive
🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
Stars: ✭ 3,139 (+6578.72%)
Mutual labels:  linter, static-analysis
clang-format-action
GitHub Action for clang-format checking
Stars: ✭ 48 (+2.13%)
Mutual labels:  linter, actions
D Scanner
Swiss-army knife for D source code
Stars: ✭ 221 (+370.21%)
Mutual labels:  linter, static-analysis
Protoc Gen Lint
A plug-in for Google's Protocol Buffers (protobufs) compiler to lint .proto files for style violations.
Stars: ✭ 221 (+370.21%)
Mutual labels:  linter, static-analysis
rubocop-linter-action
Rubocop Linter Action: A GitHub Action to run Rubocop against your code!
Stars: ✭ 86 (+82.98%)
Mutual labels:  linter, actions
Bellybutton
Custom Python linting through AST expressions
Stars: ✭ 196 (+317.02%)
Mutual labels:  linter, static-analysis
Spotbugs
SpotBugs is FindBugs' successor. A tool for static analysis to look for bugs in Java code.
Stars: ✭ 2,569 (+5365.96%)
Mutual labels:  linter, static-analysis

staticcheck-action

This action runs Staticcheck to find bugs and other problems in your Go code.

Usage

At its simplest, just add dominikh/staticcheck-action as a step in your existing workflow. A minimal workflow might look like this:

name: "CI"
on: ["push", "pull_request"]

jobs:
  ci:
    name: "Run CI"
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 1
    - uses: dominikh/[email protected]
      with:
        version: "2022.1"

A more advanced example that runs tests, go vet and Staticcheck on multiple OSs and Go versions looks like this:

name: "CI"
on: ["push", "pull_request"]

jobs:
  ci:
    name: "Run CI"
    strategy:
      fail-fast: false
      matrix:
        os:  ["windows-latest", "ubuntu-latest", "macOS-latest"]
        go:  ["1.16.x", "1.17.x"]
        dir: ["server", "client"]
    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 1
    - uses: WillAbides/[email protected]
      with:
        go-version: ${{ matrix.go }}
    - run: "go test ./..."
    - run: "go vet ./..."
    - uses: dominikh/[email protected]
      with:
        version: "2022.1"
        install-go: false
        cache-key: ${{ matrix.go }}
        working-directory: ${{ matrix.dir }}

Please see GitHub's documentation on Actions for extensive documentation on how to write and tweak workflows.

Options

version

Which version of Staticcheck to use. Because new versions of Staticcheck introduce new checks that may break your build, it is recommended to pin to a specific version and to update Staticheck consciously.

It defaults to latest, which installs the latest released version of Staticcheck.

min-go-version

Minimum version of Go to support. This affects the diagnostics reported by Staticcheck, avoiding suggestions that are not applicable to older versions of Go.

If unset, this will default to the Go version specified in your go.mod.

See https://staticcheck.io/docs/running-staticcheck/cli/#go for more information.

build-tags

Go build tags that get passed to Staticcheck via the -tags flag.

install-go

Whether the action should install a suitable version of Go to install and run Staticcheck. If Staticcheck is the only action in your job, this option can usually be left on its default value of true. If your job already installs Go prior to running Staticcheck, for example to run unit tests, it is best to set this option to false.

The latest release of Staticcheck works with the last two minor releases of Go. The action itself requires at least Go 1.16.

cache-key

String to include in the cache key, in addition to the default, which is runner.os. This is useful when using multiple Go versions.

working-directory

Relative path to the working directory Staticcheck should be executed in. This is useful when dealing with multiple projects within one repository.

Can be easily combined with a directory matrix, see the advanced example above.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].