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

[RFC] modifications to the conventional profile #1851

Closed
samoht opened this issue Oct 8, 2021 · 4 comments
Closed

[RFC] modifications to the conventional profile #1851

samoht opened this issue Oct 8, 2021 · 4 comments

Comments

@samoht
Copy link
Contributor

samoht commented Oct 8, 2021

The conventional profile works very well for the MirageOS project, we are very happy about it but it still has a few quirks.

I would like to propose the following changes to that profile:

version = 0.19.0
profile = conventional
break-infix = fit-or-vertical
parse-docstrings = true
module-item-spacing = compact

We are also considering strongly enabling wrap-comments = true in all of our repositories but we don't have much feedback on this yet. It seems to act a bit weirdly on lists of instances.

@jberdine
Copy link
Collaborator

jberdine commented Oct 8, 2021

See #1848 re module-item-spacing = compact.

It would be helpful to also have your feedback on #1810 re wrap-comments.

@gpetiot
Copy link
Collaborator

gpetiot commented Oct 8, 2021

break-infix

Instead of making fit-or-vertical the default I think we need to take care of #1080, to get something that behaves like fit-or-vertical or wrap depending on the precedence of operator, and hopefully this will be good enough to replace both current values for the option, and we can deprecate the option at the same time.
I will work on this before releasing 0.20.0.

parse-docstrings

I'm not sure this one is reliable enough yet, I mean maybe the error messages are not very helpful when the formatting doesn't preserve a doc-string, and there are still some discussions about some constructs #1736

There is already an issue about documenting the accepted odoc language that needs to be tackled before this option would be set by default: #1347

module-item-spacing

I've open a PR for this one: #1848, we were thinking of making it the new default and deprecating the option.

wrap-comments

This option breaks down everything then concatenates with @ (not preserving the shape). We wanted to deprecate this option once we get a proper behavior for every use-case.
I've proposed #1810 for the "format comments as doc-strings" use-case. We didn't decide about the next step. Either:

  • we could have a special syntax for each "special behavior" we support so add a syntax for wrapping comments (assuming we want to keep the wrapping behavior), and never wrap other comments. So the default would be to have verbatim comments (and an optional syntax for the wrapping case), that would be my pick.
  • we could always wrap other comments (make it the default), but I guess this behavior would be surprising to users? We would need a special syntax for the verbatim comments, I'm not in favor of this one.

@jberdine
Copy link
Collaborator

jberdine commented Oct 8, 2021

Just to note, a new option for break-infix would need to be around for a while before deprecating other options.

I would also like there to be much better documentation for the language of docstrings that is expected, syntax and interpretation, before it is made the default.

@gpetiot
Copy link
Collaborator

gpetiot commented Nov 8, 2021

Every remaining point is linked to a specific issue: #1080, #1347, #1810

I think we can close this issue now, please follow up on the linked issues.

@gpetiot gpetiot closed this as completed Nov 8, 2021
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

3 participants