Skip to content

Verticality vs Horizontality v2 #17

@EttyKitty

Description

@EttyKitty

I'm not exactly sure if this is the same thing, so I decided to not necro the other issue and instead write my question here. Sorry if that's wrong.

So, to start - your formatter is a godsend. After switching from a JS one, it's a breath of fresh air. Thank you.

But, I (not sure if I should say "my team", but I think we mostly agree on this) have a slight issue:
Your formatter allows choosing the max print width. I don't use it (set it to 9999), because it can cause condition checks (if (something || something2) {) or other similar things to get split into multiple lines, which I don't prefer ever (probably not the place to expand on why).
I try to keep almost all code horizontal, without arbitrary line splits.

What I'm okay with, are vertical arrays and structs. Totally fine, moreover I actually prefer these to be vertical, as, imo, they are much more readable.
But setting width to 9999 causes these to turn into unreadable one line monsters, especially structs. I'm not even sure if that's an expected behavior.

In the end I'm faced with a choice:

  • Set width to 99999 and face extremely unreadable structs and/or arrays.
  • Set width to something sane and get some condition checks split.

None of these is acceptable for me, and I end up having to manually tweak the code after each gobo pass, by reverting array/struct formatting and manually passing them through a JS formatter.

I saw it being mentioned that this formatter follows the Prettier option philosophy and I understand that asking for an option may be pointless, so I'm not sure what I want from you. A word of advice on what to do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions