展示HN:YAML验证器 - 一款基于Docker的简单YAML检查工具

2作者: pooyanazad大约 1 个月前原帖
嗨,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 &quot;$(pwd):&#x2F;data&quot; pooyanazad&#x2F;yaml-checker &lt;yaml-file&gt;<p>Optional alias (for .bashrc &#x2F; .zshrc):<p>alias ytest=&#x27;docker run -v &quot;$(pwd):&#x2F;data&quot; pooyanazad&#x2F;yaml-checker&#x27;<p>Then simply call:<p>ytest sample.yaml<p>YAML powers CI&#x2F;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:&#x2F;&#x2F;github.com&#x2F;pooyanazad&#x2F;YAML-validator" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pooyanazad&#x2F;YAML-validator</a><p>---------------------------------------------------------<p>Thanks for reading!<p>Pooyan