staticcheck

a collection of static analysis tools for working with Go code.

Version

2020.1.3

Runtime

Go Versions

Supported Languages

Go

Official Documentation

https://staticcheck.io/

YAML Configuration

staticcheck:

  • input:

    Patterns to include in execution and reports.

    Note: Inspecode runs staticcheck for each Go package and the input patterns are used for selecting Go packages containing input files. Therefore, the files excluded by the patterns are processed if they are contained in Go packages that also contain input files, and you may even see logs related to the excluded files in the job console. However, Inspecode eventually ignores any issues detected on the excluded files when generating job reports.

  • ignore:

    Patterns to exclude from execution and reports.

    Note: Just like input:, the ignore patterns may not be applied completely when running staticcheck.

  • auto-fix:

    N/A

  • config-file:

    N/A

  • machine:

    • cpu:

      Amount of CPU. The default machine has 0.75 CPU with 2880 MiB RAM.

  • options:

    Below is the list of options that are supported:

     -checks checks
          Comma-separated list of checks to enable. (default "inherit")
     -go version
          Target Go version in the format '1.x' (default 1.13)
     -show-ignored
          Don't filter ignored problems
     -tags build tags
          List of build tags
     -tests
          Include tests (default true)
     -unused.whole-program
          Run unused in whole program mode
    
  • thresholds:

    • num-issues:

      No tool specific severity levels are available.

  • incremental:

    N/A

    Note: The incremental analysis cannot be supported for staticcheck. This is because staticcheck requires a set of buildable files or packages to work and the results on unchanged files can be affected by changed files.

  • experimental:

    No tool specific experimental options are available.

YAML Examples

  • With default options:

    inspecode:
      tools:
        staticcheck: default
    
  • With custom machine:

    inspecode:
      tools:
        staticcheck:
          machine:
            cpu: 1.5 # 1.5 CPU, 5760 MiB RAM
    
  • With custom options:

    inspecode:
      tools:
        staticcheck:
          options:
            -go: 1.12
    

Resolving Dependencies

staticcheck requires all the dependencies to build, so Inspecode resolves the dependencies in the same manner as go test. See the go test page for the details.

results matching ""

    No results matching ""