基于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第三方库


热门话题
Java RMI客户端访问被拒绝   java让JavaFX事件监听器与我的方法对话   java与xml spring配置相关   java当我在字符串中插入这个XML Soap请求时,为什么Eclipse会给我一个错误?   音频音频合成   java创建了一个Tic-Tac-Toe应用程序,我有一个bug,它每次在同一个正方形上声明一个平局   java为返回的字符串值设置参数   Java中的ClassFormatError   java在启动后更改Spring云配置服务器uri   用Java中的自定义类替换默认字符串类   java junit测试套件:ClassNotFoundException   java自定义对象集包含相同的对象   通过关系查找的java Spring数据CRUDepository   java将数据存储到aerospike中   java使用itextpdf将添加内容的pdf转换为安卓中的位图   java正在遍历队列的concurrentHashMap,以查看是否所有队列都是空的,而其他线程可能会添加到队列中   java Hibernate:未找到本机查询异常   java Mockito准确地验证所有参数   java我可以在它自己的类中声明一个对象吗?