github.com/joshdk/godel@v0.0.0-20170529232908-862138a45aee/apps/okgo/README.md (about) 1 okgo 2 ==== 3 okgo is a library and CLI for running static linting checks on Go code. okgo performs the following checks: 4 5 * [deadcode](https://github.com/tsenart/deadcode) 6 * [errcheck](https://github.com/kisielk/errcheck) 7 * [extimport](https://github.com/palantir/checks/tree/develop/extimport) 8 * [go vet](https://golang.org/cmd/vet/) 9 * [golint](https://github.com/golang/lint/tree/master/golint) 10 * [ineffassign](https://github.com/gordonklaus/ineffassign) 11 * [outparamcheck](https://github.com/palantir/checks/tree/develop/outparamcheck) 12 * [unconvert](https://github.com/mdempsky/unconvert) 13 * [varcheck](https://github.com/opennota/check/tree/master/cmd/varcheck) 14 15 Documentation 16 ------------- 17 Documentation for okgo is provided in the Go code and as part of the application itself. 18 19 * Run `okgo --help` to get an overview of the commands and flags 20 * okgo is configured using a YML or JSON configuration file. Refer to the documentation in 21 `apps/okgo/config/config.go` for information on the configuration parameters that are available. 22 * Refer to `apps/okgo/config/example_test.go` for sample configuration files 23 24 Development 25 ----------- 26 Use the following commands for development. All paths in the example commands assume that they are run from the root 27 project directory of godel -- if the current working directory is `apps/okgo`, use `../../godelw` instead. 28 29 * Run `./godelw verify` to apply formatting, perform linting checks and run the gödel tests 30 * Run `./godelw test --tags=okgo` to run the okgo-specific tests (not included by default in the tests run by `./godlew verify`) 31 * Run `./godelw build` to build the okgo binary in `apps/okgo/build` 32 33 ### Add a new check 34 * In order for a check to be added, it must be a Go program that has a main package 35 * The checks are managed and packaged by [amalgomate](https://github.com/palantir/amalgomate) 36 * Add the code required for the new check (the main package and any supporting code) to the vendor directory 37 * Edit `apps/okgo/checks.yml` and add an entry for the new check 38 * Add an entry to `packages` where the key is the name of the check (no whitespace) and the value has a key named 39 `main` and the value is the import path to the main package for the formatter. For more details on the config file 40 format, refer to the documentation for amalgomate. 41 * Run `go generate` in the root directory of the project to re-generate the files in `generated_src` 42 * Add a definition for the check in `ckecks/definition.go` 43 44 ### Generate 45 Run `go generate` in the `apps/gonform` directory to create or update the `generated_src` directory and the source files 46 within it. The `go generate` task for this project requires the amalgomate command to run. The version of amalgomate 47 used to build the distribution is included as a vendored dependency.