github.com/gregoryv/qual

Go package for quality assessment at src level


Keywords
assert, golang, quality, test
License
BSD-3-Clause
Install
go get github.com/gregoryv/qual

Documentation

Build Status codecov Maintainability

qual - Quality assessment at source code level

Quick start

go get github.com/gregoryv/qual

Add a unit test to your project

func Test_CodeQuality(t *testing.T) {
    qual.Standard(t)
}

or if you are really brave, do

func Test_CodeQuality(t *testing.T) {
    qual.High(t)
}

The predefined tests measure

  • code complexity
  • line width

where the qual.Standard test only checks your package and qual.High also includes vendored code.

Scope

This package helps to improve code readability. Note, it's not measuring the quality of features in your solution. Those are better measured with benchmarks and user experience. The quality of the source code helps developers pass on their intent of their solution to other developers. We do this in various ways

  • documenting
  • tests and examples and most importantly
  • writing readable code

If we can write readable code, documentation can be minimized and that is always good, since developers tend to prefer writing code over documentation.