sách gpt4 ai đã đi

YamlLint 验证

In lại 作者:行者123 更新时间:2023-12-02 21:00:39 34 4
mua khóa gpt4 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

1 Câu trả lời

如果您想在不进行转换的情况下验证 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/

34 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com