Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the common tools of YAML

Shulou Source: shulou.com Published: 2022-06-03 07:18:11 10月02日 Update

This article mainly explains "what are the common tools of YAML". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn what are the common tools of YAML.

Grammar fundamentals comment line

Use the pound sign (#) to comment lines; single-line comments are supported, not multiple-line comments.

Document opener-Array-elementl- element2- element3 dictionary, complex dictionary # simple dictionary key: value# complex dictionary martin: name: Martin Developer job: Developer skill: Elite array and dictionary nesting-martin: name: Martin D'vloper job: Developer skills:-python-perl-pascal- tabitha: name: Tabitha Bitumen job: Developer skills:-lisp-fortran-erlang considerations

1) if you include a colon (:) in the value, you need to use quotation marks: foo: "bar: example"

2) if the value begins with curly braces ({), use quotation marks: foo: "{barexample}"

Common tools yamllint-A linter for YAML files

This tool is used to check whether the format of the YAML file is correct and to verify the YAML.

The tool can be installed by executing the following command:

# CentOS:yum install yamllint.noarch# Debianapt-get install yamllint

A simple example of use:

Yamllint / path/to/foo.yml

For other information, you can view the GitHub project home page and the command manual.

Yq (GitHub/kislyuk/yq), Python (recommended)

Project address: kislyuk/yq: Command-line YAML and XML processor-jq wrapper for YAML/XML documents

Official document: https://kislyuk.github.io/yq/

YAML-> JSON, a tool for converting YAML to JSON. The tool is packaged with jq, so you need to install the jq command first.

Install the yq command:

1) install the jq command: jq

2) install the yq command:

Pip3 install yqyq (GitHub/mikefarah/yq) = > Go

Project address: mikefarah/yq: yq is a portable command-line YAML processor

YAML-> JSON, a tool for converting YAML to JSON, developed by the Go language.

We did not use the command, only for the record here.

Thank you for your reading, these are the contents of "what are the common tools of YAML". After the study of this article, I believe you have a deeper understanding of what the common tools of YAML have, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Tools commands common commonly used tools dictionaries comments content projects learning complexity addresses quotes arrays documents knowledge support home pages items colons basics Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Linux MariaDB Apple MySQL