configfilevalidator

package module
v3.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

README

Config File Validator logo

Config File Validator

Code Coverage OpenSSF Scorecard OpenSSF Best Practices Apache 2 License Awesome Go Go Reference Pipeline Status

Your code has standards. Your config files should too.

cfv is a static binary that validates, formats, and enforces schemas on configuration files.

Syntax validation JSON, JSONC, YAML, TOML, XML, HCL, INI, Properties, ENV, HOCON, CSV, Justfile, KDL, CUE, PList, EDITORCONFIG, TOON, SARIF
Schema enforcement JSON, JSONC, YAML, TOML, XML, TOON, SARIF
Formatting JSON, JSONC, YAML, TOML, HCL, XML, INI, Properties, ENV

InstallUsageDocsContributing


Install

brew install config-file-validator
go install github.com/Boeing/config-file-validator/v3/cmd/cfv@latest
More options (Winget, Scoop, MacPorts, binary downloads)
winget install Boeing.config-file-validator
scoop install config-file-validator
sudo port install config-file-validator

Pre-built binaries for macOS, Linux, and Windows: GitHub Releases.

Usage

Check all config files in the current directory:

cfv check .

Apply safe fixes (formatting, trailing commas, type coercion):

cfv check --fix .

Preview formatting changes as a diff:

cfv format --diff .

cfv check validates syntax, enforces schemas, and checks formatting in one pass. Exits with code 1 if any file fails.

CI

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

Reporters: standard, json, junit, sarif, github. See CI/CD setup.

Existing tool configs

cfv reads .prettierrc, taplo.toml, .yamlfmt, and .editorconfig files and applies their settings automatically. Projects that use a .cfv.toml get all formatting settings from that file instead.

Why cfv

You probably have some combination of prettier, yamlfmt, taplo, terraform fmt, xmllint, jsonlint, and v8r wired into your pipeline.

cfv replaces all of them. It's a single static binary with no runtime dependencies.

  • 18 formats validated (JSON, YAML, TOML, XML, HCL, INI, Properties, ENV, HOCON, CSV, Justfile, KDL, CUE, PList, EDITORCONFIG, JSONC, TOON, SARIF)
  • 9 formats formatted (JSON, JSONC, YAML, TOML, HCL, XML, INI, Properties, ENV)
  • Schema validation via JSON Schema, XSD, and automatic SchemaStore lookup
  • Duplicate key detection for JSON, YAML, and INI
  • Gitignore-aware file discovery
  • Pre-commit hook and GitHub Action with PR annotations

Documentation

Full docs at boeing.github.io/config-file-validator:

Contributors

Config File Validator contributors

License

Apache 2.0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Version

type Version struct {
	Version string
}

Version contains config-file-validator version information

func GetVersion

func GetVersion() Version

GetVersion returns the version information

func (Version) String

func (v Version) String() string

String outputs the version as a string

Directories

Path Synopsis
cmd
cfv command
cfv validates, formats, and fixes configuration files across 18 formats.
cfv validates, formats, and fixes configuration files across 18 formats.
internal
pkg
cli
filetype
Package filetype defines the supported file types and their validators.
Package filetype defines the supported file types and their validators.
fixer
Package fixer provides the fix engine for cfv.
Package fixer provides the fix engine for cfv.
formatter
Package formatter defines the interface for config file formatters.
Package formatter defines the interface for config file formatters.
formatter/envfmt
Package envfmt provides a Formatter for .env files.
Package envfmt provides a Formatter for .env files.
formatter/hclfmt
Package hclfmt provides a Formatter for HCL (HashiCorp Configuration Language) files.
Package hclfmt provides a Formatter for HCL (HashiCorp Configuration Language) files.
formatter/inifmt
Package inifmt provides a Formatter for INI files.
Package inifmt provides a Formatter for INI files.
formatter/jsoncfmt
Package jsoncfmt provides a Formatter for JSONC (JSON with Comments) files.
Package jsoncfmt provides a Formatter for JSONC (JSON with Comments) files.
formatter/jsonfmt
Package jsonfmt provides a Formatter for JSON files.
Package jsonfmt provides a Formatter for JSON files.
formatter/propfmt
Package propfmt provides a Formatter for Java .properties files.
Package propfmt provides a Formatter for Java .properties files.
formatter/tomlfmt
Package tomlfmt provides a Formatter for TOML files.
Package tomlfmt provides a Formatter for TOML files.
formatter/xmlfmt
Package xmlfmt provides a Formatter for XML files.
Package xmlfmt provides a Formatter for XML files.
formatter/yamlfmt
Package yamlfmt provides a Formatter for YAML files.
Package yamlfmt provides a Formatter for YAML files.
validator/justfile
Package justfile parses and validates justfiles.
Package justfile parses and validates justfiles.

Jump to

Keyboard shortcuts

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