pairconsistency

package
v0.17.12 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 15 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 pairconsistency implements the `pair-consistency` rule type (spec §5): a `trigger` match obliges a `requires` match within the same UNIT. `where: same-file` (the default) makes the unit one file, and the rule is then a pure per-file Checker. `where: same-dir` makes the unit the containing directory — the package, for Go — which needs a cross-file finalizer and is therefore a whole-tree invariant. `where: same-func` makes the unit one function-grain span: a top-level Go function body (go/parser spans, so a multi-line signature cannot blind the unit the way the retired shell brace-depth accumulators did — a defect the validating port hit, lifted upstream in #77), a Dart function/method body, or a proto message/enum/service/rpc block (brace-depth units, added for the first production corpus).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Unit

type Unit struct {
	Name  string
	Start int // byte offset of the unit's first byte
	End   int // byte offset one past the unit's last byte
	Line  int // 1-based line of the unit's first byte
}

Unit is the exported view of one same-func unit, for instruments that must reason about the engine's OWN unit geometry rather than re-derive it — the consumer's vacuity census asks, per companion, which unit holds it, and a second walker there would drift from this one (#51's fix is the measured case: the census's Dart approximation disagreed with the engine).

func SameFuncUnits

func SameFuncUnits(path string, content []byte) ([]Unit, error)

SameFuncUnits returns path's function-grain units exactly as where: same-func evaluates them: .go, .dart and .proto, and none for any other extension.

Jump to

Keyboard shortcuts

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