Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

More formatting with ocp-indent #345

Merged
merged 1 commit into from
Dec 1, 2020
Merged

More formatting with ocp-indent #345

merged 1 commit into from
Dec 1, 2020

Conversation

mjambon
Copy link
Member

@mjambon mjambon commented Dec 1, 2020

This extends #344. I indented all the ml and mli files with ocp-indent, using the usual config (.ocp-indent file) that I've been using in ocaml-tree-sitter and spacegrep among others.

ocp-indent, unlike reformatting tools like ocamlformat or refmt, will only touch the indentation of existing lines. The current config doesn't even indent the contents of comments, for maximum freedom. Benefits:

  • In emacs, tuareg-mode will use it instead of its own mechanism
  • It's usable from vim as well (?)
  • We can run it as a pre-commit hook (not in this PR but I can set this up)
  • Everyone ends up using the same indentation style
  • It won't modify the code generated by ocaml-tree-sitter significantly or at all, making maintenance/merges easier

@mjambon mjambon requested a review from aryx December 1, 2020 04:03
@mjambon mjambon changed the base branch from develop to formatting December 1, 2020 04:04
@@ -15,7 +15,7 @@ module J = JSON
*
* related:
* - https://astexplorer.net/, supports many languages, many parsers
*)
*)
Copy link
Member Author

Choose a reason for hiding this comment

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

I know this is one is weird. I filed an issue. I might fix it myself. See OCamlPro/ocp-indent#312

@aryx aryx merged commit a6d8772 into formatting Dec 1, 2020
@aryx aryx deleted the ocp-indent branch December 1, 2020 09:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants