configfilevalidator

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

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

Go to latest
Published: Jul 16, 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

Validate and format every config file in your repository. One tool, one command, 18 formats.

What it does

cfv check .       # Validate syntax + schema across all config files
cfv check --fix . # Fix what it can: trailing commas, type coercion
cfv format .      # Show formatting issues
cfv format --fix  # Fix formatting in-place

cfv replaces the per-format tools you're wiring together today — prettier, yamlfmt, taplo, terraform fmt, xmllint, jsonlint, v8r — with a single static binary.

Install

Homebrew

brew install config-file-validator

Go Install

go install github.com/Boeing/config-file-validator/v3/cmd/cfv@latest
More install options

Winget

winget install Boeing.config-file-validator

MacPorts

sudo port install config-file-validator

Scoop

scoop install config-file-validator

Binary releases

Download pre-built binaries for macOS, Linux, and Windows from GitHub Releases.

Usage

Config File Validator output showing pass/fail results

Preview what formatting would change:

cfv format --diff .

See the CLI reference for all options.

Features

Validation

  • Syntax checking across 18 file formats
  • Schema validation via JSON Schema, XSD, and automatic SchemaStore lookup
  • Duplicate key detection

Formatting

  • Normalizes indentation, spacing, and trailing newlines across 9 formats (JSON, JSONC, YAML, TOML, HCL, XML, INI, Properties, ENV)
  • Sort keys alphabetically (YAML, JSON, JSONC, TOML, Properties, INI)
  • --diff preview without modifying files
  • AST-driven YAML formatting — matches prettier and yamlfmt output
  • Per-format config via .cfv.toml

Integrations

Supported Formats

Format Validate Format Schema
JSON
JSONC
YAML
TOML
XML
HCL
INI
Properties
ENV
HOCON
CSV
EDITORCONFIG
Justfile
KDL
CUE
PList
TOON
SARIF

Documentation

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

Contributing

We welcome contributions! See the contributing guide.

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