fallow config
fallow config prints the resolved configuration and the path of the config file that fallow loaded.
Print the resolved configuration as JSON, and the path of the config file that fallow loaded.
For how fallow finds and merges config files, read Configuration overview.
Synopsis
fallow config [OPTIONS]
Options
Output
| Option | Description |
|---|---|
--path | Print only the config file path (one line, no JSON) |
--resolved | Print each decision of a run and its cause as JSON: for each analysis whether it runs and its production mode, and the run settings, each with the flag, environment variable, config key or default that gave it. Environment variables show by name only |
Run
| Option | Description |
|---|---|
--for <COMMAND> | The command whose rules --resolved applies. Without it, the rules of the bare fallow run apply. Values: combined, audit, dead-code, dupes, health. |
--only <ONLY> | With --resolved: run only these analyses, as --only of the bare run or of fallow audit does. Values: dead-code (alias check), dupes, health, architecture. |
--skip <SKIP> | With --resolved: skip these analyses, as --skip of the bare run or of fallow audit does. Values: dead-code (alias check), dupes, health, architecture. |
--production-dead-code | With --resolved: run dead-code analysis in production mode |
--production-health | With --resolved: run health analysis in production mode |
--production-dupes | With --resolved: run duplication analysis in production mode |
The global options are in these groups: Project, Output, Scope, Baselines, Gates, Duplication, Type-aware, Performance.
Fallow looks for .fallowrc.json, .fallowrc.jsonc, fallow.toml and .fallow.toml, in that order, from the project root up to the workspace root. The first match wins, and fallow resolves extends. With the global option --config, fallow loads that file and does not search. The output is JSON for each --format. Add --pretty to indent it.
Output
fallow config | jq '.boundaries.zones[0]'
{
"name": "services",
"patterns": [
"src/services/**"
]
}
The JSON holds each config key with its resolved value, also the defaults. Fallow prints loaded config: <absolute path> on stderr, so stdout holds only the JSON. Without a config file, the stderr line is no config file found, using defaults. With --path, the output is one line with the absolute path of the config file.
Show the settings of a run
fallow config --resolved shows what a run will do and why. For each analysis, the output shows whether it runs and its production mode. It also shows the run settings, such as the thread count, the cache directory, the type-aware setting and the base ref of an audit. Each value has a source: a flag, an environment variable, a config key with its file, or a default.
fallow config --resolved --for audit --base main
{
"schema_version": 1,
"kind": "resolved-run",
"command": "audit",
"config_file": { "value": ".fallowrc.json", "source": { "kind": "derived", "from": "discovery" }, "scope": "global" },
"analyses": {
"dead_code": {
"selection": { "value": "run", "source": { "kind": "default", "rule": "runs-by-default" }, "scope": "analysis" },
"production": { "value": true, "source": { "kind": "config-file", "file": ".fallowrc.json", "key": "production" }, "scope": "global" }
},
...
},
"settings": {
"threads": { "value": 10, "source": { "kind": "default", "rule": "available-parallelism" }, "scope": "global" },
"type_aware": { "value": false, "source": { "kind": "default", "rule": "type-aware-off" }, "scope": "global" },
"audit_base": { "value": "main", "source": { "kind": "given", "origin": { "kind": "flag", "name": "--base" } }, "scope": "global" },
...
},
"env": { "read": [], "ignored": [] },
"fell_back": false
}
- The JSON goes to stdout for each output format.
docs/output-schema.jsonin the fallow repository describes it as theResolvedRunViewdefinition. settings.audit_baseis the base that--baseorFALLOW_AUDIT_BASEnames. It isnullwhen the audit detects the base. It has a value only with--for audit.settings.type_awareisnullwhenFALLOW_TYPE_AWAREorFALLOW_TYPE_AWARE_REQUIREhas a value that the run cannot use.- The output names each environment variable and never shows its value. A variable with a value that fallow cannot read is in
env.ignored. The human format also prints a note for it on stderr. --onlyand--skipapply to--for combinedand--for auditonly. With another--forcommand, they exit with code2.- A config that does not resolve exits with code
2and a structured error.
fallow config without --resolved does not change.
Exit codes
| Code | Meaning |
|---|---|
0 | Fallow printed the config, or the defaults when the project has no config file. |
2 | A config file does not parse, or the file that --config names does not exist. |
3 | With --path: the project has no config file. |
See Exit codes.
Examples
# Print the resolved config
fallow config --pretty
# Show which config file applies in a workspace package
cd packages/app && fallow config --path
# Print the duplication settings that apply
fallow config | jq '.duplicates'
# Print the config of another file
fallow --config ./configs/fallow.json config
Related
- Configuration overview: the config file names and how fallow merges them.
- Configuration reference: each config key and its default.
fallow config-schema: the JSON schema of the config file.