configfilevalidator

package module
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 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

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.

cfv validating config files

Documentation

Read the docs →

Install

brew install config-file-validator
go install github.com/Boeing/config-file-validator/v3/cmd/cfv@latest
Winget, Scoop, MacPorts, binary downloads
  • 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

Format Extensions Syntax Format Schema
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

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
Blank line normalization: collapses consecutive blank lines, strips blank lines after document markers and colons, and before end-of-document comments.
Blank line normalization: collapses consecutive blank lines, strips blank lines after document markers and colons, and before end-of-document comments.
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