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

Remove indentations and newlines in final-argument continuations #723

Merged
merged 4 commits into from
Sep 4, 2024

Conversation

nbacquey
Copy link
Member

@nbacquey nbacquey commented Sep 3, 2024

Description

This PR tweaks the OCaml formatting rules around the concatenation operators (e.g. @@) and anonymous function definitions, such that it is possible to write final-argument continuations without unnecessary indentations or newlines.

Closes #718

Checklist

Checklist before merging:

  • CHANGELOG.md updated
  • README.md up-to-date

@nbacquey nbacquey added the language: ocaml OCaml formatting issues label Sep 3, 2024
@nbacquey
Copy link
Member Author

nbacquey commented Sep 3, 2024

Although the PR solves the specific use-case of the issue, and leaves the rest of the test file (almost) intact, the tweak to the rule feels a bit artificial, and probably won't scale if we have similar cases in the future.

Copy link
Member

@Xophmeister Xophmeister left a comment

Choose a reason for hiding this comment

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

I think this is good and, regarding:

the tweak to the rule feels a bit artificial, and probably won't scale if we have similar cases in the future.

...I'd go with a "cross that bridge when we come to it" argument 🙂

Maybe it's worth adding a comment somewhere relevant in ocaml.scm that links back to this PR and/or the issue so, if similar things do come up in the future, the context/solution can be quickly (re)established.

@nbacquey nbacquey merged commit f8b7e14 into main Sep 4, 2024
8 checks passed
@nbacquey nbacquey deleted the nb/ocaml_final_argument_continuations branch September 4, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language: ocaml OCaml formatting issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OCaml: too much indentation and newlines around final-argument continuations
2 participants