summaryrefslogtreecommitdiff
path: root/yaml_cheat_sheet.md
blob: b00e78b0f7d9353ff0566a285546228208bc8790 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# YAML Cheat Sheet

### YAML example

```yaml
# Comments in YAML look like this

key: value
another_key: Another value goes here.
a_number_value: 100

# Nesting uses indentation. 2 space indent is preferred (but not required).
a_nested_map:
  key: value
  another_key: Another Value
  another_nested_map:
    hello: hello

# Sequences (equivalent to lists or arrays) look like this
# (note that the '-' counts as indentation):
a_sequence:
  - Item 1
  - Item 2

# Since YAML is a superset of JSON, you can also write JSON-style maps and sequences:
json_map: {"key": "value"}
json_seq: [3, 2, 1, "takeoff"]
```

Checking YAML files' formatting can be done using `yamllint`