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

Indented most of the source code #409

Merged
merged 12 commits into from
Jun 15, 2017
Merged

Indented most of the source code #409

merged 12 commits into from
Jun 15, 2017

Conversation

Richard-Degenne
Copy link
Contributor

This PR is a follow-up of PR #400 about issue #393.

Most of the ml files of the source folder have undergone an ocp-indent command, followed by a quick review. Some remarks about this:

  • Globally, the indentation was consistant within files, but varied a bit between files;
  • Most of the changes are on pattern matches;
  • I've left core/lwt.ml and unix/lwt_unix.cppo.ml untouched, so as not to cause conflicts with ongoing PRs;
  • ocp-indenting mli files wasn't really necessary, and it kept breaking comments indentation;
  • ocp-indent got the camlp4 and ppx files pretty wrong, and I indented them mostly by hand. Since they are quite obscure to me, these ones may require some extra attention.

@raphael-proust
Copy link
Collaborator

AFAIAC, there are no PRs locking unix/lwt_unix.cppo.ml right now.

There are probably going to be some changes in the short term (e.g., #408) but there are no PR for these.

@aantron
Copy link
Collaborator

aantron commented Jun 15, 2017

Thanks! I'll review this in a bit. Just want to say that I'm minutes or hours away from submitting a PR for #408, but it won't touch the .ml file, at least for now. So, I think you can add lwt_unix.cppo.ml as @raphael-proust suggests (thanks again) :)

Thread.join worker.thread
end;
Lwt.return_unit)
if worker.reuse then
Copy link
Collaborator

Choose a reason for hiding this comment

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

IMO ocp-indent gets this kind of thing wrong. It shouldn't cause an extra space if you have to add a ( to a function (or any other expression). Is it easy to fix in the ocp-indent settings? If not, it's fine – no need to go through all these files. The PR does much more good than harm, even with this nit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I guess it does this to align everything two spaces after the fun keyword, which is one column after the beginning of the line. I agree it looks kinda wrong. I'll see what I can do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Available configuration doesn't seem to provide an option for this behavior.

Is it worth opening an issue on their side?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure, they might be able to answer it, fix it, or teach me/us why the ocp-indent way is the right way :) Also cc @vasilisp for any experience with this.

I don't think this blocks the PR though, unless you want to wait for it.

in
make
~output:(fun section level lines ->
Lwt_mutex.with_lock mutex
Lwt_mutex.with_lock mutex
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm really glad things like this are getting fixed.

let f = open_out "src/jbuild-ignore" in
(if !use_camlp4 = Some(true) then () else Printf.fprintf f "camlp4");
close_out f
let f = open_out "src/unix/lwt_config" in
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like ocp-indent got this wrong. I wonder why? I don't think this should be indented more than the previous line (am I missing something?).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a similar issue reported here. I'll keep an eye on it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks, subscribed to that issue.

@aantron
Copy link
Collaborator

aantron commented Jun 15, 2017

So most of it looks good – thanks for doing this. The only other nit I have is that the glib commit should be titled something like Fixed `glib` indentation like all the others are, so people can click past it in blame.

@aantron
Copy link
Collaborator

aantron commented Jun 15, 2017

Ok, looks great. I'm happy to have this in. I'll merge once the builds finish, but they will, of course, succeed.

@aantron aantron merged commit ba56700 into ocsigen:master Jun 15, 2017
@Richard-Degenne Richard-Degenne deleted the more-prettification branch June 22, 2017 13:19
aantron added a commit that referenced this pull request Jul 8, 2017
Builds on work by Richard Degenne (@Richard-Degenne) in #400 and #409.
This commit indents some of the test suite. Some indentation done
manually.
@aantron aantron mentioned this pull request Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants