fixturetest

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 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 fixturetest runs each rule against its fire/pass fixture trees and asserts findings match declared expectations exactly (spec §7).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvalIn

func EvalIn(r *config.Rule, dir string, workers int) ([]finding.Finding, *scan.FileSet, error)

EvalIn evaluates one rule over the fixture tree rooted at dir, returning its findings PRE-suppression together with the walked FileSet. The caller passes a rule whose checker is already the one it wants exercised (see runFixture's Fresh below); EvalIn owns only what a fixture run must not inherit from the repo, so that policy lives in exactly one place rather than once per caller.

Allowlists are repo-scoped: their entries are repo-relative paths, but fixture trees have their own, unrelated path namespace (fixture-root- relative). A colliding path must not be suppressed here. Markers stay active — fixtures legitimately exercise marker suppression.

scan.ignore is likewise repo-scoped: its globs are repo-root-relative, but this walk's root is the fixture dir. Applying them here would be the same namespace collision the allowlist nil exists to prevent — a fixture that happens to contain vendor/ must still be checked. The same holds for scan.gitignore, and more sharply: the paths a consumer's .gitignore covers (build/, .dart_tool/, node_modules/) are exactly the ones fixture trees like to use, so a repo-level prune would blind fire fixtures that live there — and a fire fixture that stops firing reports as a passing rule. Pinned by TestFixtureRunsAreScanIgnoreFree + TestFixtureRunsAreGitignoreFree.

Second consumer: lint's prefilter-load-bearing fixture differential (#133), which evaluates a rule and its prefilter-stripped twin over these same trees. It needs the identical walk semantics — a repo-level prune there would hide exactly the fire fixture that proves a prefilter load-bearing.

func Run

func Run(cfg *config.Config, allRuleIDs []string, root string, workers int, w io.Writer) (int, error)

Run evaluates every rule's fixtures under root/.formwork/fixtures and writes verdicts to w. It returns the number of rules with failing fixtures; infrastructure problems (unreadable dirs, bad manifests, un-refreshable rules, fixture dirs no rule can ever reach) return an error instead — never a silent pass.

allRuleIDs is the FULL corpus id set, collected before any --rule scoping narrows cfg: the orphan check must know every legitimate fixture-dir name, or a scoped run would read sibling rules' fixtures as orphans (#58).

Types

This section is empty.

Jump to

Keyboard shortcuts

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