classify

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 6 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 classify unwraps an argv into simple commands and applies refuse rules (spec 6.7).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(rules []config.RefuseRule, argv []string, c Context) (reason string, refused bool)

Check applies rules (host rules first, then repo rules, as merged) to every simple command.

Types

type Context

type Context struct {
	Cwd        string
	LogicalCwd string
	Worktree   string
}

Context locates the call for repo-wide checks; all paths canonical.

type Simple

type Simple struct {
	Argv   []string
	Script string
}

Simple is one simple command found inside an argv. Script is the script name when the command runs a package-manager script (npm/pnpm/yarn), else "".

func Unwrap

func Unwrap(argv []string) ([]Simple, []string)

Unwrap returns the simple commands argv runs (spec 6.7). notes are debug notes (an unparsable sh -c string is checked only by its leading simple command).

Directories

Path Synopsis
Package classifytest holds the classifier fixtures shared by unit and conformance tests.
Package classifytest holds the classifier fixtures shared by unit and conformance tests.

Jump to

Keyboard shortcuts

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