goc
github.com/barryz/goci
go get github.com/barryz/goci
goc

github.com/barryz/goci

goci is a command-line tool for checking the code quality of Go locally.

by 0xfade

v0.0.0-20181226153559-518a77e02a2b (see all)License:Apache-2.0
go get github.com/barryz/goci
Readme

Go Report Card GoCI Build Status Apache 2 licensed

goci is a CI linter for Go(lang) source code.

It supports:

  • build project build
  • gofmt gofmt checking
  • govet code quality checking
  • golint code style checking
  • test go test or unit test
  • race race condition test

Requirements

  • Go1.10.x
  • Go1.11 (go module support)

Installation

$go get -u github.com/barryz/goci

Run

$goci -c goci.yml
or
$goci # use default configurations

Configuration

Create a file which named goci.yml. This file should include fields as below:

fieldstypecomment
buildstringCommand or script that used for build project. Scripts should use the relative path. eg: ./
teststringCommand for testing
excludesarrayThe directories which in excludes will not be gofmt, golint or gover
racestructExecute race condition testing
lintstructConfigurations for golint
skipsarraySteps which to skipped
race struct fields
fieldstypecomment
mainstringentry-point file for project, eg:main.go
main_cmdstringcommand for execution
scriptstringtest script eg: sh race_test.sh
timeoutinttimeout for race condition execution
lint struct fields
fieldstypecomment
ignore_no_comment_errorboolfalse(default)

Example:

build: go build
test: go test
excludes:
    - templates # except templates
    - vendor # except vendor
race:
    # go run -race main.go
    main: ./main.go
    # kill the above after 20 seconds
    timeout: 20
    # run this script to interact with the above running process (as a test)
    script: ./ab.sh
    # after 20 seconds, if no race detected, the goci/race passs
skips:
    - fmt

GitHub Stars

11

LAST COMMIT

3yrs ago

MAINTAINERS

0

CONTRIBUTORS

2

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
v0.0.0-20181226153559-518a77e02a2b
9mos ago
No alternatives found
No tutorials found
Add a tutorial