mage

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GoLicenserImportPath controls the import path used to install go-licenser.
	GoLicenserImportPath = "github.com/elastic/go-licenser"

	// GoNoticeGeneratorImportPath controls the import path used to install go-licence-detector.
	GoNoticeGeneratorImportPath = "go.elastic.co/go-licence-detector"
)

Functions

func GenerateNotice added in v0.2.0

func GenerateNotice(overrides, rules, noticeTemplate string) error

func InstallGoLicenser added in v0.2.0

func InstallGoLicenser() error

InstallGoLicenser target installs go-licenser

func InstallGoNoticeGen added in v0.2.0

func InstallGoNoticeGen() error

InstallGoLicenser target installs go-licenser

func UpdateGoVersion

func UpdateGoVersion() error

UpdateGoVersion makes required changes in order to switch to a new version of Go set in `./.go-version`.

Types

type Deps

type Deps mg.Namespace

Deps contains targets related to checking dependencies

func (Deps) CheckModuleTidy

func (Deps) CheckModuleTidy() error

CheckModuleTidy checks if `go mod tidy` was run before the last commit.

type Linter

type Linter mg.Namespace

Linter contains targets related to linting the Go code

func (Linter) All

func (l Linter) All() error

All runs the linter against the entire codebase

func (Linter) CheckConfig

func (Linter) CheckConfig() error

CheckConfig makes sure that the `.golangci.yml` does not have uncommitted changes

func (Linter) Install

func (Linter) Install() error

Install installs golangci-lint (https://golangci-lint.run) to `./build` using the official installation script downloaded from GitHub. If the linter binary already exists does nothing.

func (Linter) LastChange

func (l Linter) LastChange() error

LastChange runs the linter against all files changed since the fork point from `main`. If the current branch is `main` then runs against the files changed in the last commit.

func (Linter) UpdateGoVersion

func (Linter) UpdateGoVersion() error

UpdateGoVersion updates the linter configuration with the new version of Go.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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