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 left-associative operators not to go at the end of a line #817

Open
Niols opened this issue Dec 29, 2024 · 0 comments
Open

Allow left-associative operators not to go at the end of a line #817

Niols opened this issue Dec 29, 2024 · 0 comments
Labels

Comments

@Niols
Copy link
Member

Niols commented Dec 29, 2024

As of f35eee4, Topiary formats:

foo
  bar
  baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz
  % int_of_string

and

foo
  bar
  baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz
  %
  int_of_string

as:

foo
  bar
  baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz %
  int_of_string

Note how the left-associative % operator goes at the end of the very long argument baaa[...]aaaz, making it much harder to spot and making it easier to mistake int_of_string for an argument of foo. I understand the rules about left- and right-associativity of operators making them go at the beginning/end of the lines, so maybe the very first snippet should not be allowed, but maybe we should allow operators standalone on their lines? Really not sure about this, so I marked this as feature request and not bug.

@Niols Niols added type: feature request language: ocaml OCaml formatting issues labels Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant