v3.0.02026-10-01
新增CUE语法校验(.cue),校验器现在能识别这类文件;reporter支持把外部SARIF扫描结果合并进同一份报告,方便在CI里统一汇总;CLI还加入了watch模式,文件一有变动就自动重新校验。
修复集中在格式化与跨平台问题上:JSON/JSONC默认保留键序,JSONC维持原有尾逗号风格;Windows下本地schema路径改按file URL编码;yamlfmt把序列项前的注释与破折号对齐,tomlfmt默认改用零缩进;XML的DTD校验改为可选,--help之后命令也会正常退出。官网修掉了5个npm依赖漏洞,解除流水线阻塞。
依赖方面整体升级,包括actions/setup-go7.0.0、actions/setup-node7.0.0、cuelang.org/go0.17.1等,同时移除了Go Report Card徽章及其工作流。
v3.0.0-rc.3预发布2026-08-28
本版以修复为主,共解决19处格式化问题,覆盖YAML、JSON、TOML、XML的幂等性与一致性缺陷,与prettier、taplo的输出吻合度达到99.3%。JSONC现在会保留行内注释,同时正确处理UTF-8 BOM;cfv format新增标准输入支持,管道送入内容即可直接拿到格式化结果。忽略文件方面,会读取.prettierignore、taplo exclude配置和.yamlfmtignore。$schema不再参与内联解析,schema只认通过--schema-map或SchemaStore声明的来源。另有5项CLI加固,涉及HTTP超时、无效glob检测、参数冲突检测以及prettier配置告警。
v3.0.0-rc.2预发布2026-07-30
cfv v3更新:cfv check整合为统一检查,一次运行完成语法校验、schema强制与格式检查;新增的--fix会在同一趟里同时做安全修复(尾随逗号、类型强转)和格式化。配置解析逻辑重写:存在.cfv.toml时它是唯一权威,否则按格式读取各工具自己的配置文件。三个开关被移除——--no-prettier-config、--no-taplo-config、--no-yamlfmt-config,要关闭配置发现改用--no-config;该选项语义也随之变化,现在会禁用全部配置发现,不再只针对.cfv.toml。README、指南和参考文档已按v3重写。
v3.0.0-rc.1预发布2026-07-17
cfv v3首个候选版本发布,这是一次预发布,go install ...@latest仍指向v2.3.0。
破坏性变更:命令行改为子命令结构,cfv check、cfv format取代原来的扁平参数;二进制从validator更名为cfv;模块路径也迁到github.com/Boeing/config-file-validator/v3,升级时需同步改导入路径与调用方式。
新增格式化引擎:cfv format .可扫描全部配置文件的格式问题,--fix就地修复,--diff则只预览改动、不落盘。底层为9种格式(JSON、JSONC、YAML、TOML、XML、HCL、INI、Properties、ENV)实现了基于AST的格式化器,支持YAML、JSON等6类文件按键名排序,具体行为可在.cfv.toml中按格式单独配置。其中YAML走yaml.v3的Node树打印,输出与pretier/yamlfmt一致;TOML、XML、Properties/INI采用CST方案,能保住注释。cfv check --fix .还能自动修掉尾逗号、类型强转等常见校验问题。全部格式化器均通过模糊测试的语义等价断言。
安装:go install github.com/Boeing/config-file-validator/v3/cmd/cfv@v3.0.0-rc.1,问题请提交至项目Issues。
v2.3.02026-06-25
config-file-validator v2.3.0:新增--ignore-file选项,可在校验时按忽略文件过滤掉指定路径,避免对无关配置重复检查;修复方面移除了go-just嵌套模块,并集中升级依赖以修复已知安全漏洞。其余为常规维护:CI动作升至actions/checkout 7.0.0、codeql-action 4.36.2,基础镜像换到alpine 3.24,Go依赖同步更新到最新版。
v2.2.22026-05-28
v2.2.2新增对KDL文件的校验支持,配置校验器现在可以直接检查这类文件。schema-map在遇到无法识别的校验器时会给出警告,而不是静默跳过;TOML文件若存在重复键会被直接判为校验失败,避免漏检。输出方面做了几处收尾:groupby支持递归分组,报告器不再允许写入同一个输出文件,重复项会被拒绝。命令行对断裂符号链接的处理也更合理——它们会计入失败结果,而不是中断整个校验流程。finder内部拆分了排除文件类型的缓存,属性能层面的重构。CI方面,发布流程改用SLSA provenance证明构建来源,同时升级了golangci-lint、setup-node、deploy-pages、codeql-action等若干依赖。
v2.2.12026-05-23
本版为v2.2.1,主要是一轮修复与文档建设。修复方面,exclude-file-types参数对已知文件类型的排除此前失效,现已更正;reporter(报告输出器)也不再拒绝重复的输出路径。功能上新增GitHub Actions工作流命令reporter,校验结果可直接以工作流注释形式呈现在PR中;同时加入了自动更新github/linguist语言库的工作流。文档部分搭建了独立的Docusaurus站点并精简了README,另补了AGENTS.md。CI方面改用Node22构建文档以绕开npm在20.20.2上的bug,并按OpenSSF Scorecard建议改进了签名发布、漏洞修复与分支保护。依赖方面升级了go-toml、ini、go-git、harden-runner、codeql-action等库。
v2.2.02026-04-28
This is a big one. v2.2.0 brings project-level configuration, smarter file detection, and a bunch of quality-of-life improvements we've been wanting to ship for a while.
Project configuration with .cfv.toml
You can now drop a .cfv.toml file in your project root and stop repeating CLI flags. The validator auto-discovers it by walking up from the current directory, so monorepos and nested projects just work. Every flag has a config equivalent — exclude dirs, file types, schema mappings, reporter settings, all of it. The config file itself is validated against an embedded schema, so typos get caught immediately instead of silently ignored.
Justfile validation
We added syntax validation for Justfiles (.just, justfile, .justfile) using an embedded Go parser. Unlike Makefiles, Justfiles have a real grammar, which means we can actually give you useful error messages.
--gitignore support
Pass --gitignore and the validator will skip anything your .gitignore covers — including nested .gitignore files, .git/info/exclude, and your global git config. No more noise from nodemodules/, dist/, or vendored files showing up in your results. Works as a CLI flag, env var (CFVGITIGNORE), or in .cfv.toml.
Smarter file detection
The validator now recognizes ~90 common config filenames automatically, sourced from GitHub Linguist. Files like .babelrc, tsconfig.json, Pipfile, pom.xml, and .gitconfig are detected and validated without any configuration. This also means tsconfig.json is correctly treated as JSONC (not strict JSON), and SchemaStore lookups work for extensionless files like .clangd.
JSONC as a first-class type
JSONC (JSON with comments and trailing commas) is now its own file type with full syntax and schema validation. JSON and JSONC are treated as a family — --file-types=json includes both, and --exclude-file-types=json excludes both.
SchemaStore, no clone required
--schemastore now fetches schemas over HTTPS using an embedded catalog — no local clone needed. Schemas are cached locally with a 24-hour TTL. For air-gapped setups, --schemastore-path still works with a local clone.
Stdin support
You can now pipe content directly into the validator: echo '{}' | validator --file-types=json -. Handy for quick checks or integrating with other tools.
Other improvements
- Pre-commit hooks are available — config-file-validator for changed files, config-file-validator-full for CI
- Exit codes are now granular: 0 for success, 1 for validation errors, 2 for config/runtime errors
- .tf and .tfvars are recognized as HCL
- Internal refactor moved package-level globals into the CLI struct for better concurrency safety
Breaking change
--schemastore is now a boolean flag for remote lookup. If you were passing a path to it, use --schemastore-path instead.
v2.1.02026-04-10
2.1.0版围绕错误定位与拆分做了不少改进。SARIF输出现在为每条结果附上region(含startLine/startColumn),GitHub Actions据此可在PR的对应行上直接标注问题;JSON、YAML、TOML、XML、HCL、CSV、ENV、HOCON、TOON、PList这10个校验器返回结构化位置信息,INI、EditorConfig、Properties、SARIF暂无位置,退回文件级标注。配套新增ValidationError类型,用可选的Line/Column字段承载位置。
此前多个schema错误会被拼进一个字符串,现在各输出格式分别处理:标准输出每个错误独占一行,JSON改用errors数组,SARIF每个错误单列一条result,JUnit在<failure>内分行显示。同时新增SchemaErrors类型,用于从JSONSchemaValidate、ValidateXSD等校验流程中传递单条错误。
错误信息现在统一加上syntax:或schema:前缀,并提供-groupby error-type选项,按错误类型分组输出,可与-groupby error-type,filetype等组合使用。XSD校验改用helium的ErrorCollector输出详细诊断,不再只报一句xsd: validation failed,格式也简化为line 5: ...。README新增GitHub Action章节,指向Boeing/validate-configs-action@v2.0.0,groupby文档同步补上了error-type的说明。
v2.0.02026-04-09
config-file-validator v2.0.0带来几处不兼容改动。最大的变化是新增schema校验,JSON、TOML、TOON、YML、XML这五种格式都能按schema规则检查内容;另加入--type-map参数,可将glob模式映射到指定文件类型,文件识别规则更灵活。同时移除了--check-format参数与FormatValidator接口,依赖它做自定义校验的调用方需要改写。测试体系也做了整顿:为ToonValidator补上fuzz测试,接入SARIF输出,重构单元测试并清空全部fixture与golden文件,还新增了功能测试套件。go-toml等依赖同步升级。