Go Meta Linter

Web Sitehttps://github.com/alecthomas/gometalinter
LanguageGo
Supported Version1.2.1

Getting Started

To start using Go Meta Linter, enable it in repository setting.

To customize Go Meta Linter, write your configuration, put it in your repository, and setup sideci.yml.

Dependencies

SideCI tries to download dependencies if your project contains glide.yaml. This is done with glide install command before analysis.

If glide.yaml contains a dependency to a library in a private repository, Please add the SSH key necessary for clone it.

Use other private repositories for analysis

Default Configuration

If your sideci.yml does not contain config option, SideCI will use the default configuration. The default configuration is available in our repository.

Configuration via sideci.yml

Put your Go Meta Linter configuration under gometalinter.

linter:
  gometalinter:
    install_path: github.com/your-org-name/your-repo-name
    options:
      config: config/settings.json
      exclude: 'REGEXP'
      include: 'REGEXP'
      skip: vendor/github.com/
      cyclo-over: 10
      min-confidence: .80
      dupl-threshold: 50
      severity: 'error'
      vendor: true
      tests: true
      errors: true
      fast: true
      disable-all: true
      enable:
        - gofmt
        - test
      disable:
        - vet

install_path

Specify the directory name under $GOPATH/src to analyze. In general, you need to specify it correctly for import resolution.

options

This option controls command line options given to gometalinter.

config

This option controls a configuration file. If you have settings file for Go Meta Linter, put it in this option.

exclude

This option controls messages to exclude by matching regular expressions you set.

include

This option controls messages to include by matching regular expressions you set.

skip

This option controls skipping directories when running Go Meta Linter.

cyclo-over

This option controls threshold of cyclomatic complexity to report. Go Meta Linter reports functions that have the complexity more than the number you set.

dupl-threshold

This option controls minimum token sequence as a clone for duplicated.

severity

This option controls the map of linter severities. You can set: warning or error.

vendor

This option controls whether to enable to support vendoring.

tests

This option controls whether to analyze test files. If you would like to include test files, set true in this option.

errors

This option controls whether to show only errors.

fast

This option controls whether to run only fast linters. If you declare true in this option, following faster linters run,
which are dupl, gas, goconst, gocyclo, gofmt, goimports, golint, gotype, ineffassign, lll, misspell, vet, and vetshadow.

disable-all

This option controls whether to disable all linters.

enable

This option controls enable linters previously disabled. Set linters as a list in this option.

disable

This option controls disable linters previously enabled. Set linters as a lint in this option.