A Golang tool that does static analysis, unit testing, code review and generate code quality report. This is a tool that concurrently runs a whole bunch of those linters and normalises their output to a report:
- Supported linters
- Supported template
- Todo List
- Installing
- Run it
- Credits
- Quickstart
- Example
- Report-example
- Credits
- unittest - Golang unit test status.
- deadcode - Finds unused code.
- gocyclo - Computes the cyclomatic complexity of functions.
- varcheck - Find unused global variables and constants.
- structcheck - Find unused struct fields.
- aligncheck - Warn about un-optimally aligned structures.
- errcheck - Check that error return values are used.
- copycode(dupl) - Reports potentially duplicated code.
- gosimple - Report simplifications in code.
- staticcheck - Statically detect bugs, both obvious and subtle ones.
- godepgraph - Godepgraph is a program for generating a dependency graph of Go packages.
- misspell - Correct commonly misspelled English words... quickly.
- html template file which can be loaded via
-t <file>
.
- Develop more linter, such as code line count statistics, function statistics, project information layer structure display, etc.
- There are still many shortcomings in the presentation of the report, showing that the model is not perfect, and hope that someone can help optimize it.
There are two options for installing goreporter.
-
- Install a stable version, eg.
go get -u github.com/wgliang/goreporter/tree/version-1.0.0
. I will generally only tag a new stable version when it has passed the Travis regression tests. The downside is that the binary will be calledgoreporter.version-1.0.0
.
- Install a stable version, eg.
-
- Install from HEAD with:
go get -u github.com/wgliang/goreporter
. This has the downside that changes to goreporter may break.
- Install from HEAD with:
Install goreporter (see above).
$ goreporter -p [projectRelativePath] -r [reportPath] -e [exceptPackagesName] -f [json/html] {-t templatePathIfHtml}
- -p Must be a valid golang project path.
- -r Save the path to the report.
- -e Exceptional packages (multiple separated by commas, for example: "linters/aligncheck,linters/cyclo" ).
- -f report formate json OR html.
- -t Template path,if not specified, the default template will be used.
By default, the default template is used to generate reports in html format.
$ goreporter -p ../goreporter -d ../goreporter -t ./templates/template.html
you can see result detail:Example-Report
Templates is designed by liufeifei
Logo is designed by xuri