gocheck

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(cfg *config.Config) []checker.CheckRegistration

Register returns all Go check registrations.

Types

type BuildCheck

type BuildCheck struct{}

BuildCheck verifies that the project compiles successfully.

func (*BuildCheck) ID

func (c *BuildCheck) ID() string

func (*BuildCheck) Name

func (c *BuildCheck) Name() string

func (*BuildCheck) Run

func (c *BuildCheck) Run(path string) (checker.Result, error)

type CoverageCheck

type CoverageCheck struct {
	Threshold float64 // Minimum coverage percentage (default 80.0)
}

CoverageCheck verifies that test coverage meets a threshold.

func DefaultCoverageCheck

func DefaultCoverageCheck() *CoverageCheck

DefaultCoverageCheck returns a CoverageCheck with the default 80% threshold.

func (*CoverageCheck) ID

func (c *CoverageCheck) ID() string

func (*CoverageCheck) Name

func (c *CoverageCheck) Name() string

func (*CoverageCheck) Run

func (c *CoverageCheck) Run(path string) (checker.Result, error)

func (*CoverageCheck) SetCoverageThreshold added in v0.6.4

func (c *CoverageCheck) SetCoverageThreshold(t float64)

type CyclomaticCheck added in v0.1.2

type CyclomaticCheck struct {
	Threshold int // Default: 15
}

CyclomaticCheck measures cyclomatic complexity of Go functions.

func (*CyclomaticCheck) ID added in v0.1.2

func (c *CyclomaticCheck) ID() string

func (*CyclomaticCheck) Name added in v0.1.2

func (c *CyclomaticCheck) Name() string

func (*CyclomaticCheck) Run added in v0.1.2

func (c *CyclomaticCheck) Run(path string) (checker.Result, error)

type DeadcodeCheck added in v0.6.4

type DeadcodeCheck struct{}

DeadcodeCheck detects unreachable code using the deadcode tool.

func (*DeadcodeCheck) ID added in v0.6.4

func (c *DeadcodeCheck) ID() string

func (*DeadcodeCheck) Name added in v0.6.4

func (c *DeadcodeCheck) Name() string

func (*DeadcodeCheck) Run added in v0.6.4

func (c *DeadcodeCheck) Run(path string) (checker.Result, error)

type DepsCheck

type DepsCheck struct{}

DepsCheck scans for known vulnerabilities using govulncheck.

func (*DepsCheck) ID

func (c *DepsCheck) ID() string

func (*DepsCheck) Name

func (c *DepsCheck) Name() string

func (*DepsCheck) Run

func (c *DepsCheck) Run(path string) (checker.Result, error)

type DepsFreshnessCheck added in v0.6.4

type DepsFreshnessCheck struct{}

DepsFreshnessCheck detects outdated Go module dependencies.

func (*DepsFreshnessCheck) ID added in v0.6.4

func (c *DepsFreshnessCheck) ID() string

func (*DepsFreshnessCheck) Name added in v0.6.4

func (c *DepsFreshnessCheck) Name() string

func (*DepsFreshnessCheck) Run added in v0.6.4

func (c *DepsFreshnessCheck) Run(path string) (checker.Result, error)

type FormatCheck

type FormatCheck struct{}

FormatCheck verifies that all Go code is properly formatted.

func (*FormatCheck) ID

func (c *FormatCheck) ID() string

func (*FormatCheck) Name

func (c *FormatCheck) Name() string

func (*FormatCheck) Run

func (c *FormatCheck) Run(path string) (checker.Result, error)

type FunctionComplexity added in v0.1.2

type FunctionComplexity struct {
	Name       string
	File       string
	Line       int
	Complexity int
}

FunctionComplexity holds complexity info for a single function.

type LoggingCheck added in v0.1.2

type LoggingCheck struct{}

LoggingCheck verifies proper logging practices in Go code.

func (*LoggingCheck) ID added in v0.1.2

func (c *LoggingCheck) ID() string

func (*LoggingCheck) Name added in v0.1.2

func (c *LoggingCheck) Name() string

func (*LoggingCheck) Run added in v0.1.2

func (c *LoggingCheck) Run(path string) (checker.Result, error)

type ModuleCheck

type ModuleCheck struct{}

ModuleCheck verifies that go.mod exists and has a valid Go version.

func (*ModuleCheck) ID

func (c *ModuleCheck) ID() string

func (*ModuleCheck) Name

func (c *ModuleCheck) Name() string

func (*ModuleCheck) Run

func (c *ModuleCheck) Run(path string) (checker.Result, error)

type RaceCheck

type RaceCheck struct{}

RaceCheck runs tests with the race detector enabled to find data races.

func (*RaceCheck) ID

func (c *RaceCheck) ID() string

func (*RaceCheck) Name

func (c *RaceCheck) Name() string

func (*RaceCheck) Run

func (c *RaceCheck) Run(path string) (checker.Result, error)

type TestsCheck

type TestsCheck struct{}

TestsCheck runs go test to verify all tests pass.

func (*TestsCheck) ID

func (c *TestsCheck) ID() string

func (*TestsCheck) Name

func (c *TestsCheck) Name() string

func (*TestsCheck) Run

func (c *TestsCheck) Run(path string) (checker.Result, error)

type VetCheck

type VetCheck struct{}

VetCheck runs go vet to find suspicious constructs.

func (*VetCheck) ID

func (c *VetCheck) ID() string

func (*VetCheck) Name

func (c *VetCheck) Name() string

func (*VetCheck) Run

func (c *VetCheck) Run(path string) (checker.Result, error)

Jump to

Keyboard shortcuts

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