Comment spaces#

Comments must have no space before and exactly one space after #.

Before ❌

 #You are reading a comment

After ✅

# You are reading a comment

Comment style#

Use # for comments.

Before ❌

! You are reading a comment

After ✅

# You are reading a comment

Invalid escape#

Entries with invalid escape sequences. This includes short unicode escapes (e.g. \u123), invalid octal escapes (e.g. \8), and invalid single-character escapes (e.g. \x).

Before ❌

unicode=\u123

After ✅

unicode=\u1234

Missing separator#

Entries must have either = or : separators.

Before ❌

key value

After ✅

key=value

Unterminated line continuation#

Entries with unterminated line continuations. Line continuations must end with a backslash (\) followed by a newline.

Before ❌

multiline=line1\

escape=this is backslash \

After ✅

multiline=line1\
line2

escape=this is backslash \\

Duplicate key#

Duplicate keys are not allowed.

Before ❌

item=value
item=other

After ✅

item1=value
item2=other

Key name#

Keys can follow snake_case, camelCase or kebab-case, but not UPPERCASE.

Before ❌

ITEM=value

DATABASE_USER=admin

After ✅

item=value

database.user=admin

Missing key#

Entries must have a key.

Before ❌

=value

After ✅

item=value

Missing value#

Entries must have a value.

Before ❌

item=

After ✅

item=value

Duplicate blank line#

Multiple consecutive blank lines are not allowed.

Before ❌

item1=value


item2=other

After ✅

item1=value

item2=other

No leading blank line#

File cannot start with a blank line.

Before ❌


item=value

After ✅

item=value

Trailing newline#

File must end with a newline character.

Before ❌

item=value

After ✅

item=value
↵

Untrimmed entry#

Entries cannot have leading or trailing whitespace in keys or values.

Before ❌

 item = value

After ✅

item=value