An open API service indexing awesome lists of open source software.

https://github.com/darkliquid/lintci

This is a linter for Go source code with some minor additions for use with CI across a team/project.
https://github.com/darkliquid/lintci

Last synced: 5 months ago
JSON representation

This is a linter for Go source code with some minor additions for use with CI across a team/project.

Awesome Lists containing this project

README

          

Golintci is a linter for Go source code with additions for doing CI

## Why are you ignoring golint?

I'm not. However I do want an environment with an enforced style and
therefore when using CI - you want to go over an entire project and ignore
some files (like stuff generated with stringer). It seems a bad layout
to separate structs/generated code all the time and ignore things by entire
package.

The idea here isn't to go against the Gold standard definitions in upstream.
It's more that in a build environment it makes sense to enforce style across
a team.

## Installation

go get -u github.com/leepa/lintci/golintci

## Usage

Invoke `golintci` with one or more filenames, a directory, or a package named
by its import path. Golint uses the same
[import path syntax](https://golang.org/cmd/go/#hdr-Import_path_syntax) as
the `go` command and therefore
also supports relative import paths like `./...`. Additionally the `...`
wildcard can be used as suffix on relative and absolute file paths to recurse
into them.

The output of this tool is a list of suggestions in Vim quickfix format,
which is accepted by lots of different editors.

## Purpose

Golint differs from gofmt. Gofmt reformats Go source code, whereas
golint prints out style mistakes.

Golint differs from govet. Govet is concerned with correctness, whereas
golint is concerned with coding style. Golint is in use at Google, and it
seeks to match the accepted style of the open source Go project.

The suggestions made by golint are exactly that: suggestions.
Golint is not perfect, and has both false positives and false negatives.
Do not treat its output as a gold standard.

## Contributions

Contributions to this project are welcome, though please send mail before
starting work on anything major. Contributors retain their copyright, so we
need you to fill out
[a short form](https://developers.google.com/open-source/cla/individual)
before we can accept your contribution.

## Vim

Add this to your ~/.vimrc:

set rtp+=$GOPATH/src/github.com/golang/lint/misc/vim

If you have multiple entries in your GOPATH, replace `$GOPATH` with the right value.

Running `:Lint` will run golint on the current file and populate the quickfix list.

Optionally, add this to your `~/.vimrc` to automatically run `golint` on `:w`

autocmd BufWritePost,FileWritePost *.go execute 'Lint' | cwindow

## Emacs

Add this to your `.emacs` file:

(add-to-list 'load-path (concat (getenv "GOPATH") "/src/github.com/golang/lint/misc/emacs"))
(require 'golint)

If you have multiple entries in your GOPATH, replace `$GOPATH` with the right value.

Running M-x golint will run golint on the current file.

For more usage, see [Compilation-Mode](http://www.gnu.org/software/emacs/manual/html_node/emacs/Compilation-Mode.html).