-
Notifications
You must be signed in to change notification settings - Fork 16
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
Update ocp-indent to ocamlformat and replace action with rule stanza #13
Conversation
…create a fmt target to format the files using ocamlformat and also update the foramtting of each file
where SUBCOMMAND is one of:\n\ | ||
%s\n\n\ | ||
For help on a specific subcommand, try:\n\ | ||
\ %s SUBCOMMAND --help\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's happening here with the leading backslash?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll let you take a look in case it's a bug with ocamlformat that needs reporting or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know what, nevermind. I'll just fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I didn't notice this 😅, Thanks for fixing this!
test_sub1 | ||
test_sub2 | ||
)) | ||
(libraries alcotest test_sub1 test_sub2)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like to have one thing per line so that the diff make sense when we add/remove items later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was something that was auto-generated by ocamlformat and as we are going to use ocamlformat in the future I thought leaving the formatted code in would be better here
let tests = | ||
[ | ||
("string", `Quick, test_string); ("string, hasty", `Quick, test_string_hasty); | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of this formatting style for lists but I'll get used to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was autogenerated by ocamlformat :D
@@ -1,2 +0,0 @@ | |||
#use "topfind";; | |||
open Printf;; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intent of .ocamlinit
was to have these commands loaded when running utop
locally. Also, it's a stub letting the user know they can add their own #require ...
or open
directives for working with the project. Now I see opam installs a ~/.ocamlinit
containing #use "topfind";;
. Is this why you removed it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I thought this file would be redundant
Thanks a lot for the contribution! I haven't used ocamlformat just yet, so this is very much appreciated. |
What this PR attempts to do:
replace
ocp-indent
toocamlformat
(mentioned in Put a sample ocamlformat too #10)Update the dune version to 2.8. This change generated the following error when running
make
.Modify the dune file in
test/dune
to use a rule stanza.Add a
fmt
target in the Makefile to format the files using ocamlformat