Skip to content

implement adjustable bracestyle - #3

Open
dolumchei wants to merge 2 commits into
EttyKitty:mainfrom
dolumchei:main
Open

implement adjustable bracestyle#3
dolumchei wants to merge 2 commits into
EttyKitty:mainfrom
dolumchei:main

Conversation

@dolumchei

@dolumchei dolumchei commented Jul 26, 2026

Copy link
Copy Markdown

im not quite sure why this isnt already here in the original repo or the fork?
i also wouldve implemented something like "minimal"

`
// Without Minimal
if (value == 0)
{
do_thing();
}

// With Minimal
if (value == 0)
do_thing();
`


Summary by cubic

Adds an adjustable brace style setting to the Playground so users can choose how braces are formatted. Persists the selection by serializing BraceStyle in FormatOptions.

  • New Features
    • Added a Brace Style selector in the Playground with Same Line and New Line options.
    • Made FormatOptions.BraceStyle bindable/serializable by removing JsonIgnore and assigning explicit enum values (SameLine = 0, NewLine = 1).

Written for commit 889a38f. Summary will update on new commits.

Review in cubic

im not quite sure why this isnt already here in the original repo or the fork?
@EttyKitty

EttyKitty commented Jul 27, 2026

Copy link
Copy Markdown
Owner

@dolumchei, the reason is simple: the formatter positions itself as an opinionated, like prettier and csharpier. These formatters don't allow for options at all, beyond some extremely basic ones. That's the point of opinionated.

The author of the formatter picks one format they like and everyone using it have to comply or pick a different one formatter.

The official doc explicitly mentions that the control flow structures are always formatted in one way:
image

At this point, I'm not ready to add this option, because it feels like opening a pandora box for the rest of the formatting logic.

Even the options I do provide right now, are mostly there for backward compatibility with my own project that uses this formatter, just so I don't explode the entire codebase in one go.


P.S. I also want to note, that having no braces, per your example, in a JS-ES3-eske language (not Python or something) looks like a coding warcrime, and I don't condone that. That's precisely why this formatter exists. That's what I personally think. I like my JS hugged with cozy-brackets.

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.

2 participants