Skip to content

Commit 663d839

Browse files
authored
Document yaml[line-length] rule (#3653)
1 parent fdf030f commit 663d839

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ansiblelint/rules/yaml.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Some of the detailed error codes that you might see are:
5353
- `yaml[empty-lines]` - _too many blank lines (...> ...)_
5454
- `yaml[indentation]` - _Wrong indentation: expected ... but found ..._
5555
- `yaml[key-duplicates]` - _Duplication of key "..." in mapping_
56+
- `yaml[line-length]` - _Line too long (... > ... characters)_
5657
- `yaml[new-line-at-end-of-file]` - _No new line character at the end of file_
5758
- `yaml[octal-values]`: forbidden implicit or explicit [octal](#octals) value
5859
- `yaml[syntax]` - YAML syntax is broken
@@ -72,6 +73,11 @@ for it does check these. If for some reason, you do not want to follow our
7273
defaults, you can create a `.yamllint` file in your project and this will take
7374
precedence over our defaults.
7475

76+
## Additional Information for Multiline Strings
77+
78+
Adhering to yaml[line-length] rule, for writing multiline strings we recommend using Block Style Indicator: literal style indicated by a pipe (|) or folded style indicated by a right angle bracket (>), instead of escaping the newlines with backslashes.
79+
Reference [guide] for writing multiple line strings in yaml.
80+
7581
## Problematic code
7682

7783
```yaml
@@ -95,3 +101,4 @@ bar: ... # Correct comment indentation.
95101
[1.2.0]: https://yaml.org/spec/1.2.0/
96102
[1.2.2]: https://yaml.org/spec/1.2.2/
97103
[yaml specification]: https://yaml.org/
104+
[guide]: https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html#yaml-basics

0 commit comments

Comments
 (0)