Pcornel
Automation · Scripting

Configuration Files

Cheat sheet · https://pcornel.dk/topic.php?topic=5224

Back to the Topic

Answer

Configuration Files separate environment- or deployment-specific values from script logic. Reliability depends on schema, precedence, provenance, permissions, parsing and validation of the effective configuration.

Remember

  • Config parsed ≠ config correct; syntactic validity does not prove required keys, ranges or target relevance.
  • File exists ≠ intended file loaded; working directory and search path can select a different file.
  • Config in version control ≠ active config; local overrides or environment values may win at runtime.
  • Human-readable file ≠ safe secret store; file permissions, repository history and backups may expose credentials.

First checks

  • yq . config.yaml — validate YAML
  • jq . config.json — validate JSON
  • Config file permissions — protection

Commands

git diff -- <config-file>
Bounded read-only observation/validation for line-level uncommitted changes for one explicitly selected configuration f…

Verify in this order

config file → parsed/validated → script

Where it usually breaks

Successful parsing proves only that syntax is readable; it does not prove the correct file, correct precedence, safe values or successful target behavior.

Script/input → command/module binding → local/remoting session → request accepted → command result → target object read-back → effective runtime state → workload.

Configuration Files scripting boundary map

BoundaryHealthy evidenceSuspicious evidence
Input / runtimeEffective inputs, runtime, working context and dependency versions are explicitHidden defaults, stale environment, wrong interpreter/path or unvalidated input
Logic / executionBranch/function/module decisions and external actions expose per-operation resultsSwallowed failures, shell reinterpretation, blind retries or last-result-wins behavior
Result / proofExit/exception/log evidence is correlated with independent target read-backProcess success or printed output treated as target success
Recovery / troubleshootingFirst failed boundary is preserved, changed minimally and retestedRandom edits, catch-all suppression or evidence destroyed before diagnosis

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5224

Confirmation

Confirm action

Continue?