Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow empty values in the spec #47

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
# -- Project information -----------------------------------------------------

project = 'EditorConfig Specification'
copyright = '2019--2020, EditorConfig Team'
copyright = '2019--2024, EditorConfig Team'
author = 'EditorConfig Team'

version = '0.16.0'
release = '0.16.0'
version = '0.17.0'
release = '0.17.0'

# -- General configuration ---------------------------------------------------

Expand Down
26 changes: 15 additions & 11 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,28 @@ EditorConfig organization.
File Format
===========

.. versionchanged:: 0.17.0

EditorConfig files are in an INI-like file format.
In an EditorConfig file, all beginning whitespace on each line is considered
irrelevant. Each line must be one of the following:
In an EditorConfig file, all beginning whitespace on each line is ignored.
Each line must be one of the following, once leading whitespace is removed
(and ignoring any trailing line separator):

- Blank: contains only whitespace characters.
- Blank: contains nothing.
- Comment: starts with a ``;`` or a ``#``.
- Section Header: starts with a ``[`` and ends with a ``]``.
- May not use any non-whitespace characters outside of the surrounding
brackets.
- Trailing whitespace may follow the closing ``]``.
- May contain any characters between the square brackets (e.g.,
``[`` and ``]`` and even spaces and tabs are allowed).
- Forward slashes (``/``) are used as path separators.
- Backslashes (``\\``) are not allowed as path separators (even on Windows).
- Key-Value Pair (or Pair): contains a key and a value, separated by an `=`.
- Key: The part before the first `=` (trimmed of whitespace, but including
any whitespace in the middle).
- Value: The part after the first `=` (trimmed of whitespace, but including
any whitespace in the middle).
- Key-Value Pair (or Pair): contains a key, an ``=``, and optionally a value.
- Key: The part before the first ``=`` on the line.
- Value: The part after the first ``=`` on the line.
- Keys and values are trimmed of leading and trailing whitespace, but
include any whitespace that is between non-whitespace characters.
- If there is nothing, or only whitespace, after the first ``=`` on the line,
then the value is an empty string (i.e., ``""`` in C or Python).

Any line that is not one of the above is invalid.

Expand All @@ -115,7 +119,7 @@ This specification does not define any "escaping" mechanism for

.. admonition :: Compatibility

The EditorConfig file format formerly allowed the use of `;` and `#` after the
The EditorConfig file format formerly allowed the use of ``;`` and ``;`` after the
beginning of the line to mark the rest of a line as comment. This led to
confusion how to parse values containing those characters. Old EditorConfig
parsers may still allow inline comments.
Expand Down