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

Format list in comments #403

Closed
dinosaure opened this issue Sep 7, 2018 · 5 comments
Closed

Format list in comments #403

dinosaure opened this issue Sep 7, 2018 · 5 comments

Comments

@dinosaure
Copy link

Currently, ocamlformat compacts list in comments like:

https://github.com/mirage/ocaml-git/pull/311/files#diff-944afc38bfb1daa5cbe9926891267f3dL497

It could be interesting to format lists in comments or keep what the user did.

@gpetiot
Copy link
Collaborator

gpetiot commented Sep 7, 2018

Smaller example:

val read: state -> Hash.t -> (value, error) result Lwt.t
  (** [read state hash] can retrieve a git {i packed} object from any
      {i PACK} files available in the current git repository
      [state]. It just inflates the git object and informs some
      meta-data (like kind, CRC-32 check-sum, length, etc.) about
      it. Then, the client can use the related decoder to get the
      OCaml value. THIS LINE IS VERY VERY VERY VERY VERY VERY VERY VERY VERY LONG AND SHOULD WRAP
      This function allocates 2 {Cstruct.t} needed to re-construct the
      git {i packed} object in any case (if it is delta-ified or not)
      and a certain amount of little buffer (sized by 0x7F bytes) to
      help the construction only when the requested object is
      delta-ified.

      Can return an {!error}:
      {ul
      {- {!FS.File.error} or {!FS.Dir.error} or
      {!FS.Mapper.error} when we retrieve a file-system error}
      {- {!PACKDecoder.error} when we retrieve an error about the
      decoding of the {i packed} git object in the founded {i PACK}i
      file}
      {- {!IDXDecoder.error} when we retrieve an error about the
      decoding of an {i IDX} file}
      {- [`Not_found] when the requested object is not {i packed}}} *)

@hhugo
Copy link
Collaborator

hhugo commented Sep 7, 2018

We should support more than just list #268

@jberdine
Copy link
Collaborator

jberdine commented Sep 8, 2018

I am hesitant to start down the path of essentially parsing docstrings / comments. Using an existing/canonical docstring parser, and writing a formatter for its parsed form, sounds like a much more robust and maintainable approach. So my inclination is to close this in favor of #268. Thoughts?

@gpetiot
Copy link
Collaborator

gpetiot commented Sep 19, 2018

Closed in favor of #268

@gpetiot gpetiot closed this as completed Sep 19, 2018
@gpetiot
Copy link
Collaborator

gpetiot commented Oct 17, 2018

PR #460 should address this issue, I'm interested in getting some feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants