checks

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Air = &doctor.Check{
	Key:       "air",
	Section:   "build",
	Title:     "Air",
	Summary:   "Used to recompile the project when files change",
	URL:       "https://github.com/cosmtrek/air",
	UsedBy:    "[bin/dev.sh]",
	Platforms: []string{"!windows"},
	Core:      true,
	Fn: simpleOut(".", "air", []string{"--help"}, func(_ context.Context, r *doctor.Result, out string) *doctor.Result {
		if strings.Contains(out, "Command 'air' not found") {
			return r.WithError(doctor.NewError("missing", "[air] is not present on your computer"))
		}
		return r
	}),
	Solve: solveAir,
}
View Source
var Choco = &doctor.Check{
	Key:       "choco",
	Section:   "build",
	Title:     "Chocolatey",
	Summary:   "Used to install other dependencies",
	URL:       "https://chocolatey.org",
	UsedBy:    "Package manager for Windows",
	Platforms: []string{"windows"},
	Core:      true,
	Fn:        simpleOut(".", "choco", []string{"--help"}, noop),
	Solve:     solveChoco,
}
View Source
var ESLint = &doctor.Check{
	Key:     "eslint",
	Section: "icons",
	Title:   "ESLint",
	Summary: "Lints the TypeScript codebase",
	URL:     "https://eslint.org",
	UsedBy:  "bin/check-client.sh",
	Fn:      simpleOut(".", "eslint", []string{"--help"}, checkESLint),
	Solve:   solveESLint,
}
View Source
var Git = &doctor.Check{
	Key:     "git",
	Section: "build",
	Title:   "Git",
	Summary: "It's source control, it should really be installed",
	URL:     "https://git-scm.com",
	UsedBy:  "[bin/build/release.sh]",
	Fn:      simpleOut(".", "git", []string{"version"}, noop),
	Solve:   solveGit,
}
View Source
var Gofumpt = &doctor.Check{
	Key:     "gofumpt",
	Section: "build",
	Title:   "gofumpt",
	Summary: "Formats the code; stricter than [go fmt]",
	URL:     "https://github.com/mvdan/gofumpt",
	UsedBy:  "[bin/format.sh]",
	Fn:      simpleOut(".", "gofumpt", nil, noop),
	Solve:   solveGofumpt,
}
View Source
var Golang = &doctor.Check{
	Key:     "golang",
	Section: "build",
	Title:   "Go",
	Summary: "The main programming language",
	URL:     "https://golang.org",
	UsedBy:  "All builds",
	Core:    true,
	Fn: simpleOut(".", "go", []string{"version"}, func(_ context.Context, r *doctor.Result, out string) *doctor.Result {
		if r.Status == util.KeyError {
			return r
		}
		startIdx := strings.Index(out, "go1.")
		if startIdx == -1 {
			return r.WithError(&doctor.Error{Code: util.KeyUnknown, Message: "can't parse result of [go version]"})
		}
		endIdx := strings.LastIndex(out, " ")
		if endIdx == -1 || endIdx <= startIdx {
			return r.WithError(&doctor.Error{Code: util.KeyUnknown, Message: "can't parse end result of [go version]"})
		}
		v := "v" + out[startIdx+2:endIdx]
		if semver.Compare(v, golangVersion) < 0 {
			return r.WithError(&doctor.Error{Code: "minversion", Message: "Go version [" + v + "] must be equal or higher than [" + golangVersion + "]"})
		}
		return r
	}),
	Solve: solveGo,
}
View Source
var Golangcilint = &doctor.Check{
	Key:     "golangcilint",
	Section: "build",
	Title:   "golangci-lint",
	Summary: "Check for style and linting errors",
	URL:     "https://golangci-lint.run",
	UsedBy:  "[bin/check.sh]",
	Fn:      simpleOut(".", "golangci-lint", nil, noop),
	Solve:   solveGolangcilint,
}
View Source
var Gotestsum = &doctor.Check{
	Key:     "gotestsum",
	Section: "test",
	Title:   "gotestsum",
	Summary: "Runs the tests and displays the results",
	URL:     "https://github.com/gotestyourself/gotestsum",
	UsedBy:  "[bin/test.sh]",
	Fn:      simpleOut(".", "gotestsum", nil, noop),
	Solve:   solveGotestsum,
}
View Source
var Homebrew = &doctor.Check{
	Key:       "homebrew",
	Section:   "build",
	Title:     "Homebrew",
	Summary:   "Used to install other dependencies",
	URL:       "https://brew.sh",
	UsedBy:    "Package manager for macOS",
	Platforms: []string{"darwin"},
	Core:      true,
	Fn:        simpleOut(".", "brew", []string{"--help"}, noop),
	Solve:     solveHomebrew,
}
View Source
var Imagemagick = &doctor.Check{
	Key:     "imagemagick",
	Section: "icons",
	Title:   "ImageMagick",
	Summary: "Renders SVGs for the icon pipeline",
	URL:     "https://imagemagick.org",
	UsedBy:  "SVG icon pipeline",
	Fn:      simpleOut(".", "magick", []string{"-version"}, checkImageMagick),
	Solve:   solveImageMagick,
}
View Source
var Inkscape = &doctor.Check{
	Key:     "inkscape",
	Section: "icons",
	Title:   "Inkscape",
	Summary: "Renders SVGs for the icon pipeline",
	URL:     "https://inkscape.org",
	UsedBy:  "SVG icon pipeline",
	Fn:      simpleOut(".", "magick", []string{"-version"}, checkInkscape),
	Solve:   solveInkscape,
}
View Source
var Make = &doctor.Check{
	Key:       "make",
	Section:   "build",
	Title:     "Make",
	Summary:   "Compiles the project",
	URL:       "https://www.gnu.org/software/make",
	UsedBy:    "Main server build",
	Platforms: []string{"!windows"},
	Core:      true,
	Fn:        simpleOut(".", "make", []string{"--version"}, noop),
	Solve:     solveMake,
}
View Source
var NPM = &doctor.Check{
	Key:     "node",
	Section: "build",
	Title:   "NPM.js",
	Summary: "Download JavaScript dependencies",
	URL:     "https://www.npmjs.com/",
	UsedBy:  "Build of [client] TypeScript project and css pipeline",
	Core:    true,
	Fn:      simpleOut(".", "npm", []string{"-v"}, noop),
	Solve:   solveNPM,
}
View Source
var Node = &doctor.Check{
	Key:     "node",
	Section: "build",
	Title:   "Node.js",
	Summary: "Builds our web assets",
	URL:     "https://nodejs.org",
	UsedBy:  "Build of [client] TypeScript project and css pipeline",
	Core:    true,
	Fn:      simpleOut(".", "node", []string{"-v"}, noop),
	Solve:   solveNode,
}
View Source
var PF = &doctor.Check{
	Key:     util.AppKey,
	Section: "app",
	Title:   util.AppName,
	Summary: "Confirms that [" + util.AppKey + "] is available on the path",
	URL:     util.AppURL,
	UsedBy:  util.AppName,
	Fn:      simpleOut(".", "projectforge", []string{"--help"}, noop),
	Solve:   solvePF,
}
View Source
var Project = &doctor.Check{
	Key:     "project",
	Section: "app",
	Title:   "Project",
	Summary: "Verifies the Project Forge project in the working directory",
	URL:     util.AppURL,
	UsedBy:  util.AppName,
	Fn:      checkProject,
	Solve:   solveProject,
}
View Source
var QTC = &doctor.Check{
	Key:     "qtc",
	Section: "build",
	Title:   "Quicktemplate",
	Summary: "Compiles HTML and SQL templates at build time",
	URL:     "https://github.com/valyala/quicktemplate/qtc",
	UsedBy:  "Main server build",
	Core:    true,
	Fn:      simpleOut(".", "qtc", []string{"--help"}, noop),
	Solve:   solveQTC,
}
View Source
var Repo = &doctor.Check{
	Key:     "repo",
	Section: "release",
	Title:   "Git Repo",
	Summary: "Verifies the git repository in the working directory",
	URL:     "https://git-scm.com",
	UsedBy:  "bin/build/release.sh",
	Fn:      checkRepo,
	Solve:   solveRepo,
}

Functions

func CheckAll

func CheckAll(ctx context.Context, modules []string, logger util.Logger, exclude ...string) doctor.Results

func Core added in v0.10.28

func Core(core bool) doctor.Checks

func ForModules

func ForModules(modules []string) doctor.Checks

func GetCheck

func GetCheck(key string) *doctor.Check

func SetModules added in v1.0.1

func SetModules(deps map[string][]string, dangerous []string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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