gomin

command module
v0.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 1 Imported by: 0

README

🏋️‍♀️ GOmin 🏋️

Raise the bar for your code quality and unit test coverage.

Warning: This library is still under development and may contain unresolved bugs.

Example Usage

go get github.com/ethanperry1/gomin
results, err := evaluator.Evaluate(
	0.4,
	v0.Min( // Rule #1
		0.9,
		v0.AllFiles(),
	),
	v0.Min( // Rule #2
		0.1,
		v0.AllPackages().Filter("pkg/").Functions().Filter("New"),
	),
	v0.Fallback( // Rule #3
		0.95,
		v0.AllFunctions(),
	),
	v0.Exclude(
		v0.AllPackages().Filter("v0"),
		v0.AllPackages().Filter("visitor"),
		v0.AllPackages().Filter("declarations"),
	),
)

What is this doing?

  1. Validating that all files have at least 90% unit test coverage.
  2. Validating that functions which matches "New" in any package which matches "pkg/" have at least 10% coverage.
  3. For all functions which have not yet had rules applied, validate that these have at least 95% coverage.
  4. Exclude any packages matching v0, visitor, or declarations from the global unit test coverage calculation.

In this example, the global coverage threshold was 40%, which is set with the first parameter.

View an example generated report.. Reports will begin with a green circle when successful and red in failure conditions.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
package v0 processes files, subtracting away only the functions declared in the file.
package v0 processes files, subtracting away only the functions declared in the file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL