Expand description
Configuration loading and resolution for fallow.
Owns the user-facing config model (FallowConfig and its sections),
config-file discovery and extends inheritance, validation of
user-supplied globs and patterns, and resolution into the pre-compiled
ResolvedConfig the analysis crates consume. Also hosts workspace and
package.json discovery, declarative external plugin definitions, rule
packs, and the in-place config editing used by fallow fix.
Config section structs such as RulesConfig are not #[non_exhaustive]
and gain new public fields in minor releases as rules are added, so
exhaustive struct literals in downstream code are source-breaking on
upgrade. Construct them with struct update syntax, for example
RulesConfig { unused_files: Severity::Off, ..RulesConfig::default() },
to stay source-compatible.
Modules§
- glob_
validation - Validation of user-supplied glob patterns from the config file.
- jsonc
- JSONC parsing helpers pinning the dialect fallow accepts. JSONC parsing helpers shared by every surface that reads user-authored JSONC (config files, external plugin definitions, rule packs), so they all accept exactly the same dialect.
- levenshtein
- Levenshtein-distance helpers for typo detection across config surfaces.
Structs§
- Audit
Config - The
auditconfig section: in-repo defaults forfallow audit, each overridable by its matching CLI flag. - Authored
Rule - Pre-expansion rule preserved on a
LogicalGroup. - Auto
Import Rule - A single convention-based auto-import: a bare identifier name that resolves
to an export in
sourceby framework convention, with no explicitimportstatement in the consuming file. - Boundary
Calls Config - Boundary forbidden-call policy. Applies only to files classified into a zone; unzoned files are unrestricted, matching the import rules.
- Boundary
Config - Architecture boundary configuration.
- Boundary
Coverage Config - Boundary zone coverage policy.
- Boundary
Rule - An import rule between zones.
- Boundary
Zone - A zone grouping files by directory pattern.
- Cache
Config - The
cacheconfig section: location and size ceiling of fallow’s persistent caches (default directory<root>/.fallow). - Catalog
FixConfig - The
fix.catalogsection: howfallow fixcleans up unusedpnpm-workspace.yamlcatalog entries. - Compiled
Ignore Catalog Reference Rule IgnoreCatalogReferenceRulewith the optional consumer glob pre-compiled.- Compiled
Ignore Dependency Override Rule IgnoreDependencyOverrideRuleready for matching.- Compiled
Ignore Export Rule IgnoreExportRulewith the glob pre-compiled into a matcher.- Config
Load Options - Host-controlled trust policy for loading a fallow config.
- Config
Override - Per-file override entry.
- DirManifest
Probe - A directory’s package-manifest outcome plus its Deno import map, produced
from a single
deno.json/deno.jsoncfilesystem probe. - Duplicates
Config - Configuration for code duplication detection.
- External
Plugin Def - A declarative plugin definition loaded from a standalone file or inline config.
- External
Used Export - Exports considered used for files matching a pattern.
- Fallow
Config - The user-facing fallow configuration as authored in
.fallowrc.json/.fallowrc.jsonc/fallow.toml(or thefallowkey ofpackage.json). - Finding
Ignore Matcher - Compiled project-relative patterns for hiding source-owned findings.
- FixConfig
- The
fixconfig section: settings forfallow fixapply behavior. - Flags
Config - Feature flag detection configuration.
- Forbidden
Call Rule - One forbidden-call entry: files in zone
frommay not call callees matchingcallee. - Health
Config - Configuration for complexity health metrics (
fallow health). - Health
Threshold Override - Per-file or per-function health threshold override.
- Ignore
Catalog Reference Rule - Rule for suppressing an
unresolved-catalog-referencefinding. - Ignore
Dependency Override Rule - Rule for suppressing dependency-override findings.
- Ignore
Export Rule - Rule for ignoring specific exports.
- Ignore
Exports Used InFile ByKind - Object form of
ignoreExportsUsedInFile({ "type": ..., "interface": ... }), restricting the same-file-use suppression to type-only exports. - Invalid
Forbidden Callee - One rejected
boundaries.calls.forbidden[]callee pattern. - Logical
Group - A user-declared zone that fanned out via
autoDiscover. - Manifest
Entry Rule - A rule that seeds entry points DERIVED from framework manifest files.
- Manifest
Exists Predicate - The explicit field-presence predicate accepted by
ManifestCondition. - Manifest
Field Path - A validated field path into a manifest document.
- Manifest
Path Template - A validated manifest-relative entry path with parsed
${field.path}parts. - Manifest
Seed Rule - A single entry seeded by a
ManifestEntryRule, resolved relative to the manifest’s directory. - Napi
Config - The NAPI-RS
napiblock of apackage.json, used to recognize the per-platform artifact packages a native addon generates so they are not reported as unused dependencies. All fields deserialize leniently: a wrong-typed value becomesNone/empty instead of failing manifest parsing. - Normalization
Config - Fine-grained normalization overrides.
- Ownership
Config - Configuration for ownership analysis (
fallow health --hotspots --ownership). - Package
Json - Parsed package.json with fields relevant to fallow.
- Parsed
Override Key - Parsed structure of an override key.
- Partial
Rules Config - Partial per-issue-type severity for overrides. All fields optional.
- PerAnalysis
Production Config - Object form of the
productionconfig key, scoping production mode to individual analysis families in combinedfallowandfallow audit. - Pnpm
Catalog - A single catalog (the default or a named one).
- Pnpm
Catalog Data - Structured catalog data extracted from a package manager catalog source.
- Pnpm
Catalog Entry - A single entry inside a catalog.
- Pnpm
Catalog Group - A named catalog group under
catalogs:with no package entries. - Pnpm
Override Data - Structured override data extracted from one source.
- Pnpm
Override Entry - A single override entry.
- Redundant
Root Prefix - One redundant-root-prefix pattern in a
boundaries.zones[]entry. - Regression
Baseline - Saved per-issue-type counts written by
--save-baselineand compared by--fail-on-regression. Every count defaults to0when its key is missing, so hand-trimmed baselines stay loadable. - Regression
Config - The
regressionconfig section holding the saved issue-count baseline for the--fail-on-regressiongate. - Resolve
Config - Module resolver configuration.
- Resolved
Boundary Config - Resolved boundary config with pre-compiled glob matchers.
- Resolved
Boundary Coverage Config - Resolved boundary zone coverage policy.
- Resolved
Boundary Rule - A resolved boundary rule.
- Resolved
Config - Fully resolved configuration with all globs pre-compiled.
- Resolved
Normalization - Resolved normalization flags: mode defaults merged with user overrides.
- Resolved
Override - Resolved override with pre-compiled glob matchers.
- Resolved
Zone - A zone with pre-compiled glob matchers.
- Rule
Pack Def - A declarative rule pack loaded from a standalone JSON or JSONC file listed
in the
rulePacksconfig key. - Rule
Pack Error - One rule-pack load or validation failure, anchored at the offending pack file.
- Rule
Pack Rule - One declarative policy rule inside a rule pack.
- Rules
Config - Per-issue-type severity configuration.
- Scoped
Used Class Member Rule - A heritage-constrained
usedClassMembersrule. - SdkPattern
- A custom SDK call pattern for feature flag detection.
- Security
Categories - Include/exclude lists scoping the active security categories. When
includeis set, only those categories are active;excluderemoves categories from the admitted set. Both unset admits catalogue categories.hardcoded-secretstill requires explicit inclusion. - Security
Config - Scopes
fallow securitycatalogue behavior. An absent category block admits every catalogue category.hardcoded-secretis include-required and only runs when explicitly listed insecurity.categories.include. - Similar
Code Config - Project-owned tuning for the explicit
fallow similar-codeworkflow. - Type
Aware Config - Shared opt-in configuration for TypeScript semantic analysis.
- Unknown
Zone Ref - One offending zone-name reference in a
boundaries.rules[]entry. - Unused
Component Props Config - Options for the
unused-component-propsrule. - Workspace
Config - Workspace configuration for monorepo support.
- Workspace
Diagnostic - A diagnostic about a workspace-discovery candidate.
- Workspace
Info - Discovered workspace info from package.json, deno.json, pnpm-workspace.yaml, or tsconfig.json references.
Enums§
- Analysis
Snapshot - Which revision an analysis pass describes.
- Audit
Gate - Value of
audit.gate: which findings drive thefallow auditverdict. - Auto
Import Kind - Which export shape a convention auto-import credits when its name is
referenced without an explicit
importstatement. - Boundary
Preset - Built-in architecture presets.
- Catalog
Preceding Comment Policy - Value of
fix.catalog.deletePrecedingComments: what happens to comment lines directly above a catalog entry thatfallow fixremoves. Afallow-keepmarker in the block always preserves it regardless of policy. - Config
FixPlan - Classification of whether fallow can apply config edits at
root. - Config
Write Error - Failure while editing a fallow config file in place (
fallow fixconfig actions such as appendingignoreExportsentries). - Detection
Mode - Detection mode controlling how aggressively tokens are normalized.
- Effect
Kind - Internal side-effect taxonomy derived from security catalogue rows.
- Email
Mode - Privacy mode for author emails emitted in ownership output.
- Entry
Point Role - How a plugin’s discovered entry points contribute to coverage reachability.
- Forbidden
Callee - One callee pattern or a list of patterns for a single
fromzone. - Ignore
Exports Used InFile Config - Value of the
ignoreExportsUsedInFileconfig key: whether an export referenced elsewhere in its own file is suppressed fromunused-export. - Logical
Group Status - Discovery outcome for a
LogicalGroup. - Manifest
Condition - A typed condition used by a manifest entry gate.
- Manifest
Field Segment - One validated traversal step in a
ManifestFieldPath. - Manifest
Format - Format of the manifest files a
ManifestEntryRulereads. - Manifest
Path Part - One parsed part of a manifest entry path template.
- Misconfig
Reason - Why an override entry is misconfigured.
- Output
Format - Output format for fallow results.
- Override
Source - Where an override entry was declared.
- Plugin
Detection - How to detect if a plugin should be activated.
- Production
Analysis - The analysis families production mode can be scoped to independently via
the object form of the
productionconfig key. - Production
Config - Value of the
productionconfig key: excludes test/spec/story/dev files from discovery, either globally or per analysis family. - Rule
Pack Rule Kind - Which check a rule-pack rule performs.
- Severity
- Severity level for rules.
- Type
Aware Require - Completeness policy for opt-in TypeScript semantic analysis.
- Used
Class Member Rule - A
usedClassMembersentry from config or an external plugin. - Workspace
Diagnostic Kind - Why a workspace-discovery candidate was rejected, or why a sibling directory looked workspace-like but was not declared.
- Workspace
Load Error - Workspace-discovery failures that prevent analysis from proceeding.
- Zone
Reference Kind - Which
BoundaryRulefield carries an unknown zone name. - Zone
Validation Error - Validation error from
FallowConfig::validate_resolved_boundaries.
Constants§
- DEFAULT_
MAX_ FILE_ SIZE_ BYTES DEFAULT_MAX_FILE_SIZE_MBexpressed in bytes.- DEFAULT_
MAX_ FILE_ SIZE_ MB - Default per-file size ceiling (in megabytes) for source discovery. A value chosen so hand-written source effectively never reaches it while generated API clients, vendored bundles, and minified blobs do. See issue #1086.
- KNOWN_
RULE_ NAMES - Every rule name accepted by
RulesConfigdeserialization, in kebab-case.
Functions§
- add_
ignore_ exports_ rule - Append
ignoreExportsrules to an existing fallow config file. - add_
ignore_ exports_ rule_ to_ string - Render the proposed content of a fallow config after appending
ignoreExportsrules. - add_
rule_ pack_ path - Append a rule-pack path to an existing fallow config file.
- add_
rule_ pack_ path_ to_ string - Render the proposed content of a fallow config after appending a
rulePacksentry. - append_
workspace_ diagnostics - Append
additionsto the workspace-discovery diagnostics forroot, skipping any entry whose(kind id, canonical path)is already present. - atomic_
write - Atomically write content to a file via a temporary file and rename.
- classify_
config_ fix_ plan - Classify how config-editing fixes should behave for
root. - clear_
analysis_ stage_ diagnostics - Remove all analysis-stage diagnostics (see
WorkspaceDiagnosticKind::is_analysis_stage) forrootfrom the registry, keeping every workspace-discovery and source-discovery entry. - closest_
known_ rule_ name - Find the closest known rule name to
inputwhen it is plausibly a typo. - default_
severity_ for_ kind - The default
Severityfor anIssueKindunder zero config. - dir_
has_ deno_ json - Whether
dirhas a Deno package/workspace config file. - dir_
has_ package_ manifest - Whether
dirhas either an npm or Deno package manifest. - discover_
and_ validate_ external_ plugins - Discover external plugin definitions AND validate their user-supplied glob patterns. Accumulates all errors across all loaded plugins so the user sees every problem in one run.
- discover_
external_ plugins - Discover and load external plugin definitions for a project.
- discover_
workspaces - Discover all workspace packages in a monorepo.
- discover_
workspaces_ with_ diagnostics - Discover workspace packages and return any diagnostics produced along the way.
- find_
undeclared_ workspaces - Find directories containing
package.jsonthat are not declared as workspaces. - find_
undeclared_ workspaces_ with_ ignores - Find directories containing
package.jsonthat are not declared as workspaces, excluding candidates covered by the supplied ignore globset. - is_
config_ fixable - Whether
fallow fix --yescan apply config edits atrootwith default config-creation behavior. Drives JSONauto_fixablefor config actions. - is_
deno_ without_ node_ modules - Whether the project has a root Deno config and should not warn about a
missing
node_modulesdirectory. - is_
opt_ in_ kind - Whether a rule is opt-in: its default severity is
Off, so it detects and reports nothing until a user explicitly enables it. - is_
valid_ override_ value - Check whether
valueis a valid pnpm override right-hand side, even if it is not a semver range. Returnsfalsewhen the value is empty, contains a raw newline, or is otherwise garbage. - load_
deno_ import_ map - Load sorted Deno import-map entries and their declaring config path.
- load_
dir_ package_ json - Load a directory’s package manifest as
PackageJson, preferringpackage.jsonand falling back todeno.json/deno.jsonc. - load_
member_ package_ manifest - Load package identity for a workspace member directory.
- load_
root_ deno_ workspace_ patterns - Load root Deno workspace patterns and their declaring config path.
- load_
rule_ packs - Load and validate every rule pack listed in the
rulePacksconfig key. - override_
misconfig_ reason - Convenience: is this entry effectively a misconfiguration the user should see as an error?
- override_
source_ label - Source-name string for diagnostics.
- parse_
bun_ package_ json_ resolutions - Parse the Yarn-style top-level
resolutionsobject of a rootpackage.jsonthe way bun reads it (issue #2367). bun treatsresolutionsas an alias ofoverrideswith flat string entries: a key is a bare package (left-pad,@scope/pkg,pkg@<2), a yarn dependency path (parent/child,**/child,parent/**/child, where@scope/namespans two path segments), or the pnpmparent>childform. Paths deeper than one parent and non-string values are kept as entries without a parsed key or value so the misconfigured-override detector reports them, matching the warning bun prints before skipping such entries. Keys that start with//are comments and skipped. Returns empty data when the file has noresolutionsobject or the JSON is malformed. Callers decide whether the repository installs with bun and whether anoverrideskey shadows the section. - parse_
npm_ package_ json_ overrides - Parse the top-level
overridessection of a rootpackage.json. Returns an emptyPnpmOverrideDatawhen the file has no overrides, when the JSON is malformed, or when the section is present but empty. - parse_
override_ key - Parse an override key into
parent,target, and optional version selectors. ReturnsNonewhen the key cannot be split into a recognised shape (empty key, parent or target missing). - parse_
package_ json_ catalog_ data - Parse Bun catalog sections from a root
package.jsonfile. - parse_
pnpm_ catalog_ data - Parse the catalog sections of a
pnpm-workspace.yamlfile. - parse_
pnpm_ package_ json_ overrides - Parse the
pnpm.overridessection of a rootpackage.json. Returns an emptyPnpmOverrideDatawhen the file has no overrides, when the JSON is malformed, or when the section is present but empty. - parse_
pnpm_ workspace_ overrides - Parse the
overrides:section ofpnpm-workspace.yaml. Returns an emptyPnpmOverrideDatawhen the file has no overrides or when the section is present but empty. Malformed YAML is anErrcarrying the parse error text so callers can surface a workspace diagnostic instead of silently dropping every entry. - parse_
tsconfig_ root_ dir - Parse
tsconfig.jsonat the project root and extractcompilerOptions.rootDir. - preserve_
target_ mode - Copy the target file’s existing permissions onto the temp file.
- probe_
dir_ manifest - Load a directory’s package manifest and Deno import map together, probing
and parsing
deno.json/deno.jsonconce instead of once per consumer. - record_
source_ read_ failures - Replace source-read-failure diagnostics for
rootwith the failures from the current parse while preserving every workspace and discovery diagnostic produced by other stages. - record_
workspace_ diagnostics - Append
diagnosticsto the registry forrootAND emit their deduplicated stderr warnings, for analysis-stage callers outside this crate (e.g. the pnpm catalog/override gathers infallow-core) that surface a diagnostic after config load completed.append_workspace_diagnosticsalone would reachworkspace_diagnostics[]JSON but never warn a human on stderr. - registry_
diagnostics_ to_ fold - Read the registry leg of a diagnostics FOLD: everything
workspace_diagnostics_forholds forrootEXCEPT the entries a source walk records (seeWorkspaceDiagnosticKind::is_source_walk_recorded). - replace_
source_ discovery_ diagnostics - Replace every source-discovery diagnostic for
rootwithdiagnosticsin ONE registry operation, and hand the same list back to the caller. - resolve_
boundaries_ for_ rule_ pack_ validation - Resolve boundaries in the same shape used by analysis, without loading rule packs or running discovery.
- resolve_
max_ file_ size_ bytes - Convert a user-supplied megabyte ceiling into the byte limit stored on
ResolvedConfig::max_file_size_bytes.Some(0)means “no limit” (None); any otherSome(n)isnMB in bytes;None(unset) keeps the built-inDEFAULT_MAX_FILE_SIZE_BYTES. - stash_
workspace_ diagnostics - Replace the workspace-discovery diagnostics for
rootwithdiagnostics, PRESERVING any source-discovery diagnostics (seeWorkspaceDiagnosticKind::is_source_discovery) and analysis-stage diagnostics (seeWorkspaceDiagnosticKind::is_analysis_stage) already appended for the root. - validate_
rule_ pack_ zone_ references - Validate that rule-pack
zonesreferences point at resolved boundary zones. - walkthrough_
state_ path - Path to the local
fallow review --walkthroughviewed-state ledger inside a resolved cache directory (default<root>/.fallow, already gitignored). - workspace_
diagnostics_ for - Read the workspace-discovery diagnostics produced by the most recent
stash_workspace_diagnostics+ any subsequentappend_workspace_diagnosticscalls forroot. Returns an empty vector when nothing has been stashed for this root yet (e.g. programmatic callers bypassing the standard loader). - workspace_
is_ public - Return whether a workspace package name is selected by
publicPackages.
Type Aliases§
- Config
Write Result - Result alias for config-file editing operations.