Skip to content

Switched to using cfengine format instead of prettier for syntax-description.json#90

Merged
olehermanse merged 2 commits intocfengine:mainfrom
olehermanse:prettier
Apr 24, 2026
Merged

Switched to using cfengine format instead of prettier for syntax-description.json#90
olehermanse merged 2 commits intocfengine:mainfrom
olehermanse:prettier

Conversation

@olehermanse
Copy link
Copy Markdown
Member

@olehermanse olehermanse commented Apr 24, 2026

Prettier is by design not deterministic - in some cases
it will split objects across multiple lines, while not doing the reverse,
collapsing them if they fit on one line.

From our perspective it is desirable to have deterministic formatting.

See:
prettier/prettier#8324
https://github.com/prettier/prettier/blob/76efb33e75365aceab508b0504f0e6f5ba2dd540/docs/rationale.md#multi-line-objects

@olehermanse olehermanse requested a review from larsewi April 24, 2026 15:11
@olehermanse olehermanse marked this pull request as ready for review April 24, 2026 15:11
@olehermanse olehermanse removed the request for review from larsewi April 24, 2026 15:16
@olehermanse olehermanse force-pushed the prettier branch 2 times, most recently from 6191799 to 912ce66 Compare April 24, 2026 15:50
@olehermanse olehermanse changed the title GH Action: Made prettier formatting of syntax-description.json deterministic Switched to using cfengine format instead of prettier for syntax-description.json Apr 24, 2026
…ription.json

Prettier is by design not deterministic - in some cases
it will split objects across multiple lines, while not doing the reverse,
collapsing them if they fit on one line.

From our perspective, deterministic formatting is more desirable.

See:
prettier/prettier#8324
https://github.com/prettier/prettier/blob/76efb33e75365aceab508b0504f0e6f5ba2dd540/docs/rationale.md#multi-line-objects

Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
@olehermanse olehermanse merged commit 92e2f54 into cfengine:main Apr 24, 2026
5 checks passed
@olehermanse olehermanse deleted the prettier branch April 24, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants