projcheck

package
v0.159.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

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

Overview

Package projcheck finds the commands a repository already uses to check itself: its Makefile targets, its package.json scripts, and the stock commands of the toolchains it declares (go.mod, Cargo.toml, pyproject.toml).

It exists for the Tasks screen's templates. A task is done only when its done_criteria exit 0, so a template that prefills `go test ./...` into a JavaScript repository hands the user a task that can never go green. The screen asks this package instead of guessing, and offers nothing it did not find — an empty list is an honest answer, a wrong command is not.

Detection reads files and never runs anything: no `make -n`, no package manager, no network. A target or script is reported only when the file names it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check struct {
	Command string `json:"command"`
	Kind    Kind   `json:"kind"`
	// Source is the file that names it: "Makefile", "package.json", "go.mod".
	Source string `json:"source"`
}

Check is one command the repository already has.

func Detect

func Detect(dir string) []Check

Detect returns the checks dir declares, project entry points first: a Makefile target is how the project itself says "run the tests", so it outranks the toolchain's stock command for the same kind. A missing or unreadable dir is an empty list, never an error.

type Kind

type Kind string

Kind is what a check proves. The templates ask for kinds, not commands.

const (
	KindAll       Kind = "all" // the project's own umbrella check (`make check`)
	KindTest      Kind = "test"
	KindLint      Kind = "lint"
	KindTypecheck Kind = "typecheck"
	KindBuild     Kind = "build"
)

The kinds a check can prove.

Jump to

Keyboard shortcuts

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