Skip to content

Bug: break after Psig_include depending on presence of docstring #1114

@jberdine

Description

@jberdine

Describe the bug
In a signature, a break sometimes follows include depending on whether or not there is a docstring.

How to Reproduce
Note how in the following code, the first include does not break, while the second does, and the only difference is the presence of a docstring (that must be long enough).

$ cat include_w_docstring.mli
include M with type t := t

include
  M with type t := t
(** Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod *)
$ ocamlformat --version
277a34a

(that is, master)

$ ocamlformat --no-version-check --print-config include_w_docstring.mli
profile=ocamlformat (file ../.ocamlformat:1)
quiet=false (profile ocamlformat (file ../.ocamlformat:1))
max-iters=10 (profile ocamlformat (file ../.ocamlformat:1))
comment-check=true (profile ocamlformat (file ../.ocamlformat:1))
wrap-fun-args=true (profile ocamlformat (file ../.ocamlformat:1))
wrap-comments=false (profile ocamlformat (file ../.ocamlformat:1))
type-decl-indent=2 (profile ocamlformat (file ../.ocamlformat:1))
type-decl=compact (profile ocamlformat (file ../.ocamlformat:1))
stritem-extension-indent=0 (profile ocamlformat (file ../.ocamlformat:1))
space-around-variants=false (profile ocamlformat (file ../.ocamlformat:1))
space-around-records=false (profile ocamlformat (file ../.ocamlformat:1))
space-around-lists=false (profile ocamlformat (file ../.ocamlformat:1))
space-around-arrays=false (profile ocamlformat (file ../.ocamlformat:1))
single-case=compact (profile ocamlformat (file ../.ocamlformat:1))
sequence-style=separator (profile ocamlformat (file ../.ocamlformat:1))
sequence-blank-line=compact (profile ocamlformat (file ../.ocamlformat:1))
parse-docstrings=false (profile ocamlformat (file ../.ocamlformat:1))
parens-tuple-patterns=multi-line-only (profile ocamlformat (file ../.ocamlformat:1))
parens-tuple=always (profile ocamlformat (file ../.ocamlformat:1))
parens-ite=false (profile ocamlformat (file ../.ocamlformat:1))
ocp-indent-compat=false (profile ocamlformat (file ../.ocamlformat:1))
nested-match=wrap (profile ocamlformat (file ../.ocamlformat:1))
module-item-spacing=sparse (profile ocamlformat (file ../.ocamlformat:1))
max-indent=68 (profile ocamlformat (file ../.ocamlformat:1))
match-indent-nested=never (profile ocamlformat (file ../.ocamlformat:1))
match-indent=0 (profile ocamlformat (file ../.ocamlformat:1))
margin=100 (file ../.ocamlformat:4)
let-open=preserve (profile ocamlformat (file ../.ocamlformat:1))
let-module=compact (profile ocamlformat (file ../.ocamlformat:1))
let-binding-spacing=sparse (file ../.ocamlformat:3)
let-binding-indent=2 (profile ocamlformat (file ../.ocamlformat:1))
let-and=compact (profile ocamlformat (file ../.ocamlformat:1))
leading-nested-match-parens=false (profile ocamlformat (file ../.ocamlformat:1))
infix-precedence=indent (profile ocamlformat (file ../.ocamlformat:1))
indicate-nested-or-patterns=space (profile ocamlformat (file ../.ocamlformat:1))
indicate-multiline-delimiters=space (profile ocamlformat (file ../.ocamlformat:1))
indent-after-in=0 (profile ocamlformat (file ../.ocamlformat:1))
if-then-else=compact (profile ocamlformat (file ../.ocamlformat:1))
function-indent-nested=never (profile ocamlformat (file ../.ocamlformat:1))
function-indent=2 (profile ocamlformat (file ../.ocamlformat:1))
field-space=tight (profile ocamlformat (file ../.ocamlformat:1))
extension-sugar=preserve (profile ocamlformat (file ../.ocamlformat:1))
extension-indent=2 (profile ocamlformat (file ../.ocamlformat:1))
exp-grouping=parens (profile ocamlformat (file ../.ocamlformat:1))
escape-strings=preserve (profile ocamlformat (file ../.ocamlformat:1))
escape-chars=preserve (profile ocamlformat (file ../.ocamlformat:1))
dock-collection-brackets=false (profile ocamlformat (file ../.ocamlformat:1))
doc-comments-tag-only=default (profile ocamlformat (file ../.ocamlformat:1))
doc-comments-padding=2 (profile ocamlformat (file ../.ocamlformat:1))
doc-comments=after (profile ocamlformat (file ../.ocamlformat:1))
disambiguate-non-breaking-match=false (profile ocamlformat (file ../.ocamlformat:1))
disable=false (profile ocamlformat (file ../.ocamlformat:1))
cases-matching-exp-indent=compact (profile ocamlformat (file ../.ocamlformat:1))
cases-exp-indent=4 (profile ocamlformat (file ../.ocamlformat:1))
break-struct=force (profile ocamlformat (file ../.ocamlformat:1))
break-string-literals=auto (profile ocamlformat (file ../.ocamlformat:1))
break-sequences=false (profile ocamlformat (file ../.ocamlformat:1))
break-separators=before (profile ocamlformat (file ../.ocamlformat:1))
break-infix-before-func=true (profile ocamlformat (file ../.ocamlformat:1))
break-infix=wrap (profile ocamlformat (file ../.ocamlformat:1))
break-fun-sig=wrap (profile ocamlformat (file ../.ocamlformat:1))
break-fun-decl=wrap (profile ocamlformat (file ../.ocamlformat:1))
break-collection-expressions=fit-or-vertical (profile ocamlformat (file ../.ocamlformat:1))
break-cases=nested (profile ocamlformat (file ../.ocamlformat:1))
break-before-in=fit-or-vertical (file ../.ocamlformat:2)
assignment-operator=end-line (profile ocamlformat (file ../.ocamlformat:1))
align-variants-decl=false (profile ocamlformat (file ../.ocamlformat:1))
align-constructors-decl=false (profile ocamlformat (file ../.ocamlformat:1))
align-cases=false (profile ocamlformat (file ../.ocamlformat:1))

include M with type t := t

include
  M with type t := t
(** Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod *)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions