基于ruamel.yaml的固执己见的yaml形成剂

yamkix的Python项目详细描述


为什么?

什么?

> ./yamkix -h
usage: yamkix [-h] -i INPUT [-t TYP][-o OUTPUT][-n][-e][-q][-f][-d]

Format yaml input file. By default, explicit_start is `On`, explicit_end is
`Off` and array elements are pushed inwards the start of the matching
sequence. Comments are preserved thanks to default parsing mode `rt`.

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        the file to parse
  -t TYP, --typ TYP     the yaml parser mode. Can be `safe` or `rt`
  -o OUTPUT, --output OUTPUT
                        the name of the file to generate (same as input file
                        if not specied)
  -n, --no-explicit-start
                        by default, explicit start of the yaml doc is `On`,
                        you can disable it with this option
  -e, --explicit-end    by default, explicit end of the yaml doc is `Off`, you
                        can enable it with this option
  -q, --no-quotes-preserved
                        by default, quotes are preserverd you can disable this
                        with this option
  -f, --default-flow-style
                        enable the default flow style `Off` by default. In
                        default flow style (with typ=`rt`), maps and lists are
                        written like json
  -d, --no-dash-inwards
                        by default, dash are pushed inwards use `--no-dash-inwards` to have the dash start at the sequence level

配置

  • defaut显式启动yaml文档 (您可以使用--no-explicit-start禁用它)
  • 默认保留引号 (您可以使用--no-quotes-preserved禁用它)
  • 默认情况下,数组元素向内推 (您可以使用--no-dash-inwards禁用它)
  • 默认情况下,输出文件是输入文件
  • 默认情况下,由于 ruamel.yamlround_trip 模式(您可以使用--typ safe禁用它)

“Yamkix”这个名字是从哪里来的?

用法

  • 使用pip install --user yamkix
  • 安装包
  • 示例vscode任务:
{"taskName":"format yaml with yamkix","type":"shell","command":"yamkix --input ${file}","group":"build","presentation":{"reveal":"always","panel":"shared"},"problemMatcher":[]}

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Docker&SeleniumJava:无法在Docker容器上运行的chrome浏览器中上载图像/文件   在python中运行java命令   Java垃圾收集器异常行为   java java是否根据底层操作系统执行字节码级优化?   java是否可以休眠自定义查询返回映射而不是列表?   java Spring引导RabbitMQ接收器Jackson反序列化到POJO   apache flex在ActionScript3中创建对象相等“HashMap”作为java HashMap   java如何在Eclipse集成中切换JProfiler启动器   缓存JSP页面结果的java最佳实践?   java集成jaxb绑定文件,使用CXF生成基于WSDL的客户端   java为什么在上传操作结束之前,客户端没有检测到HttpServletResponse的PrintWriter内容?   java在接口内创建类和在类内创建接口有什么用   java向文件写入错误Android Studio   java合并多个RealmList并对结果列表排序?   谷歌API视觉java。lang.NoSuchMethodError   java如何使用逗号分别存储每个值,然后将它们存储到单独的数组中?