展示HN:YAML验证器 - 一款基于Docker的简单YAML检查工具
嗨,HN,
我制作了一个名为 YAML Validator 的小工具,可以通过一个 Docker 命令检查你的 YAML 文件——无需安装,无需设置,无需借口。
它的功能包括:
- 语法检查
- yamllint 代码检查
- checkov 安全扫描
- 所有功能都在一个轻量级、零配置的容器中
---------------------------------------------------------
使用方法:
```bash
docker run -v "$(pwd):/data" pooyanazad/yaml-checker <yaml-file>
```
可选别名(用于 .bashrc / .zshrc):
```bash
alias ytest='docker run -v "$(pwd):/data" pooyanazad/yaml-checker'
```
然后只需调用:
```bash
ytest sample.yaml
```
YAML 是 CI/CD、配置和基础设施的核心,破坏它太容易了。这个工具旨在尽早捕捉语法、风格和安全问题,减少摩擦。
我很想听取反馈、想法或测试的边缘案例。
---------------------------------------------------------
GitHub: [https://github.com/pooyanazad/YAML-validator](https://github.com/pooyanazad/YAML-validator)
---------------------------------------------------------
感谢阅读!
Pooyan
查看原文
Hi HN,<p>I made a tiny tool called YAML Validator that checks your YAML files with one Docker command — no installs, no setup, no excuses.<p>It does:<p>- Syntax checks<p>- yamllint linting<p>- checkov security scanning<p>- All in one lightweight, zero-config container<p>---------------------------------------------------------<p>How to use:<p>docker run -v "$(pwd):/data" pooyanazad/yaml-checker <yaml-file><p>Optional alias (for .bashrc / .zshrc):<p>alias ytest='docker run -v "$(pwd):/data" pooyanazad/yaml-checker'<p>Then simply call:<p>ytest sample.yaml<p>YAML powers CI/CD, configs, infra ,and breaking it is too easy. This aims to catch syntax, style, and security issues early with minimal friction.<p>I’d love feedback, ideas, or edge cases to test.<p>---------------------------------------------------------<p>GitHub: <a href="https://github.com/pooyanazad/YAML-validator" rel="nofollow">https://github.com/pooyanazad/YAML-validator</a><p>---------------------------------------------------------<p>Thanks for reading!<p>Pooyan