Awesome Go

config-file-validator

CategoryUtilities
SubcategoryUtilities
Stars517

Cross Platform tool to validate configuration files

About config-file-validator

cfv is a toolchain for configuration files. It catches syntax errors, schema violations, and formatting problems across your repo and fixes what it can. Single static binary. No runtime dependencies.

Documentation

Read the docs →

Install

brew install config-file-validator
go install github.com/Boeing/config-file-validator/v3/cmd/cfv@latest
  • Winget: winget install Boeing.config-file-validator
  • Scoop: scoop install config-file-validator
  • MacPorts: sudo port install config-file-validator
  • Binaries: GitHub Releases

Usage

Validate syntax, enforce schemas, and check formatting:

cfv check .

Fix formatting, trailing commas, and type coercion:

cfv check --fix .

Preview formatting changes as a diff:

cfv format --diff .

Exits with code 1 if any file fails.

Supported Formats

FormatExtensionsSyntaxFormatSchema
JSON.json✅✅✅
JSONC.jsonc✅✅✅
YAML.yaml, .yml✅✅✅
TOML.toml✅✅✅
XML.xml✅✅✅
TOON.toon✅—✅
SARIF.sarif✅—✅
HCL.hcl, .tf, .tfvars✅✅—
INI.ini✅✅—
Properties.properties✅✅—
ENV.env✅✅—
HOCON.hocon✅——
CSV.csv✅——
EDITORCONFIG.editorconfig✅——
Justfile.just✅——
KDL.kdl✅——
CUE.cue✅——
Apple PList XML.plist✅——

Schema validation uses JSON Schema, XSD, and automatic SchemaStore lookup. Formatting reads your existing .prettierrc, taplo.toml, .yamlfmt, and .editorconfig files. See Formatting and Schema Validation.

CI

cfv check --reporter=junit:results.xml --schemastore .

Reporters: standard, json, junit, sarif, github. The github reporter emits workflow commands so errors appear as inline PR annotations.

A GitHub Action and pre-commit hook are also available.

Contributors

License

Apache 2.0

Frequently Asked Questions

What is config-file-validator?

config-file-validator is a Utilities library for the Go programming language. Cross Platform tool to validate configuration files

How do I install config-file-validator?

Install config-file-validator with the Go module system using `go get Boeing/config-file-validator`. Check the repository for the current installation instructions.

What category does config-file-validator belong to?

config-file-validator is listed under Utilities, specifically Utilities.

← Back to Utilities