gpt4 book ai didi

YamlLint 验证

转载 作者:行者123 更新时间:2023-12-02 21:00:39 33 4
gpt4 key购买 nike

我有一个像这样的 Yaml 文件

    name: hhh_aaa_bbb 
arguments:
- !argument
name: inputsss
description: hhh aaa bbb
required: true
- !argument
name: lll
description: lll
required: true
- !argument
name: ccc
description: ccc
required: true
source:
!!com.abc.bbc.sss
uri: !arg input

但是当我使用 Yaml Lint 验证 yamllint 中的这个 yaml 文件时,它删除了所有的“!”或者 ”!!”用户参数。为什么会发生这种情况?

这是验证后我从 yaml lint 获得的输出

    --- 
arguments:
-
description: "hhh aaa bbb"
name: inputsss
required: true
-
description: lll
name: lll
required: true
-
description: ccc
name: ccc
required: true
name: hhh_aaa_bbb
source:
uri: input

最佳答案

如果您想在不进行转换的情况下验证 YAML 文件,请使用 yamllint (linter,而不是网站 - yamllint.com 不是 linter)。

对于您的具体输入,它将给出:

$ yamllint file.yaml
file.yaml
1:1 warning missing document start "---" (document-start)
1:18 error trailing spaces (trailing-spaces)
4:9 error wrong indentation: expected 6 but found 8 (indentation)
8:9 error wrong indentation: expected 6 but found 8 (indentation)
12:9 error wrong indentation: expected 6 but found 8 (indentation)
17:9 error wrong indentation: expected 4 but found 8 (indentation)

关于YamlLint 验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38454142/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com