General
Decimal values¶
Omit leading and trailing zeros in decimal values.
Before
After
Tip
This rule is inverted on JSON5.
Double quotes¶
Double quotes for strings. Quotes are optional in YAML, but must not be single quotes, unless the string itself contains double quotes.
Before
After
Warning
Expressions in GitHub Actions must be wrapped in single quotes.
Duplicate blank line¶
No more than one consecutive blank line.
Before
After
Tip
In JSON, no blank lines are allowed at all.
Indent style¶
Spaces over hard tabs for indentation, default 2 spaces.
Before
After
Line length¶
The column limit is 80 characters.
Before
After
Tip
There are some exceptions:
- URLs are allowed to exceed the limit in most formats.
- In Markdown, headings, tables and inline HTML are also fine.
- Ignored in JSON.
Trailing comma¶
In languages that support trailing commas, they should be used in multi-line structures.
Before
After
Trailing newline¶
Files should end with a single newline character.
Before
After
Trailing space¶
No trailing spaces at the end of lines.
Before
After
Unnecessary leading blank line¶
Files should not start with blank lines.
Before
After