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

Make IDL commas whitespace and newlines optional #772

Merged
merged 1 commit into from
Apr 21, 2021

Conversation

mtdowling
Copy link
Member

Commas are now treated as whitespace to reduce visual noise in models,
reduce diff noise when changes are made to models, and prevent modelers
from worrying about tricks like trailing commas. Commas are still
allowed because they do make traits and JSON-like node values defined on
a single line easier to read; however, they should be omitted everywhere
else.

The IDL previously required a newline after various statements. This
wasn't grammatically necessary, but was done to force good practice in
models. However, it added complexity to the grammar and parser. While
models should still define all statements on different lines, to simplify
parsers and the grammar, a new line after statements is no longer
required.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

docs/source/1.0/spec/core/http-traits.rst Outdated Show resolved Hide resolved
docs/source/1.0/spec/core/idl.rst Show resolved Hide resolved
@mtdowling mtdowling force-pushed the optional-commas-and-brs branch from 29f700f to 7d06e74 Compare April 12, 2021 17:58
Copy link
Contributor

@kstich kstich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the example in the README get updated as well?

docs/source/1.0/guides/style-guide.rst Show resolved Hide resolved
docs/source/1.0/guides/style-guide.rst Outdated Show resolved Hide resolved
@mtdowling mtdowling force-pushed the optional-commas-and-brs branch from 7d06e74 to ee5c3c4 Compare April 16, 2021 00:29
@mtdowling mtdowling requested a review from kstich April 16, 2021 00:30
Commas are now treated as whitespace to reduce visual noise in models,
reduce diff noise when changes are made to models, and prevent modelers
from worrying about tricks like trailing commas. Commas are still
allowed because they do make traits and JSON-like node values defined on
a single line easier to read; however, they should be omitted everywhere
else.

The IDL previously required a newline after various statements. This
wasn't grammatically necessary, but was done to force good practice in
models. However, it added complexity to the grammar and parser. While
models should still define all statements on different lines, to simplify
parsers and the grammar, a new line after statements is no longer
required.
@mtdowling mtdowling force-pushed the optional-commas-and-brs branch from ee5c3c4 to 0eed31b Compare April 16, 2021 20:52
@mtdowling mtdowling changed the base branch from main to idl-1.1 April 21, 2021 04:59
@mtdowling mtdowling merged commit 78bbe72 into idl-1.1 Apr 21, 2021
@mtdowling mtdowling deleted the optional-commas-and-brs branch April 21, 2021 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants