TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Config-file-validator – CLI tool to validate all your config files

33 点作者 treebeard5440超过 1 年前

7 条评论

jmholla超过 1 年前
I was expecting this to validate the configuration files are also valid for their use cases, not just valid JSON, TOML, etc.<p>If you&#x27;re looking for that and Python is your jam, the library cerberus[0] is very good at it.<p>[0]: <a href="https:&#x2F;&#x2F;github.com&#x2F;pyeve&#x2F;cerberus">https:&#x2F;&#x2F;github.com&#x2F;pyeve&#x2F;cerberus</a>
评论 #37707994 未加载
评论 #37712241 未加载
dangets超过 1 年前
It doesn&#x27;t include validators for TOML and INI, but if you&#x27;re doing JSON and YAML, I would take a look at using or building upon CUE (<a href="https:&#x2F;&#x2F;cuelang.org&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;cuelang.org&#x2F;</a>). It is a different take on schema definition (plus more), and is surprising terse and powerful model.
评论 #37714120 未加载
treebeard5440超过 1 年前
I’m one of the maintainers of the project. We’re a DevOps team and maintain a lot of different types of configuration files for all the different tools and services we support - often in the same repo. Rather than using a lot of different validators for each config format we wanted a single tool to validate all types. This enabled us to include config validation as a quality gate in our CI&#x2F;CD to detect config file syntax issues early before they failed in functional testing. We open-sourced it to help other teams with similar workflows. Please let me know if you have any comments or suggestions!
评论 #37709526 未加载
评论 #37707798 未加载
jdwyah超过 1 年前
I&#x27;ve been thinking about this a bunch. It&#x27;s weird that we our apps are typesafe in lots of ways and then just hope that some magic string config &amp; env vars are available, and there isn&#x27;t even a comprehensive list of what our apps expect.<p>Anyone else think a property spec like the specker thing, than maybe some code gen on top of that that enforces the code is actually using it is interesting?
CableNinja超过 1 年前
I recently made a python library that does this. You build up specs (a json&#x2F;dict), and at each layer that descends, you add a `spec_chain` entry, and build another spec for the next level. Once the specs are built, you can validate, as well as get config defaults from it.<p><a href="https:&#x2F;&#x2F;pypi.org&#x2F;project&#x2F;specker" rel="nofollow noreferrer">https:&#x2F;&#x2F;pypi.org&#x2F;project&#x2F;specker</a>
评论 #37706784 未加载
评论 #37710249 未加载
ripperdoc超过 1 年前
For validating the actual values and types in config files, I&#x27;ve been planning to use JSON Schema to define the configuration data and then validate files against it. But I haven&#x27;t seen others talk about that a lot - is it something I&#x27;m missing?
treebeard5440超过 1 年前
Anyone else have any suggestions for improvements or things that you&#x27;d expect to see in a tool like this? I&#x27;ll take anything you&#x27;ve got :D All feedback so far has been added as Github issues.