bandeps

package
v1.76.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 14 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker interface {
	// Check runs bandeps in the current directory with the configuration.
	Check(
		ctx context.Context,
		envStdioContainer app.EnvStdioContainer,
		externalConfig ExternalConfig,
	) ([]Violation, error)
}

Checker is a checker.

func NewChecker

func NewChecker(logger *slog.Logger) Checker

NewChecker returns a new Checker.

type ExternalBanConfig

type ExternalBanConfig struct {
	// Packages are the package expressions to get dependencies for.
	Packages ExternalPackageConfig `json:"packages" yaml:"packages,omitempty"`
	// Deps are package expressions that cannot be depended on for Packages.
	Deps ExternalPackageConfig `json:"deps" yaml:"deps,omitempty"`
	// Note is a note to print out regarding why this ban exists.
	Note string `json:"note,omitempty" yaml:"note,omitempty"`
}

ExternalBanConfig is an external ban configuration.

type ExternalConfig

type ExternalConfig struct {
	Bans []ExternalBanConfig `json:"bans,omitempty" yaml:"bans,omitempty"`
}

ExternalConfig is an external configuration.

type ExternalPackageConfig

type ExternalPackageConfig struct {
	// Use are the package expressions to list with go list.
	Use []string `json:"use,omitempty" yaml:"use,omitempty"`
	// Except are the package expressions that should be excluded from Use.
	Except []string `json:"except,omitempty" yaml:"except,omitempty"`
}

ExternalPackageConfig is an external package configuration.

type Violation

type Violation interface {
	fmt.Stringer

	Package() string
	Dep() string
	Note() string
	// contains filtered or unexported methods
}

Violation is a violation.

Directories

Path Synopsis
cmd
bandeps command

Jump to

Keyboard shortcuts

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