-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[new release] ocamlformat, ocamlformat-rpc-lib and ocamlformat-lib (0.25.0) #23407
Conversation
…camlformat-bench (0.25.0) CHANGES: ### Library - The declaration of options is a regular module instead of a functor. (ocaml-ppx/ocamlformat#2193, @EmileTrotignon) ### Bug fixes - Fix indentation when ocamlformat is disabled on an expression (ocaml-ppx/ocamlformat#2129, @gpetiot) - Reset max-indent when the `max-indent` option is not set (ocaml-ppx/ocamlformat#2131, @hhugo, @gpetiot) - Add missing parentheses around immediate objects having attributes attached in 4.14 (ocaml-ppx/ocamlformat#2144, @gpetiot) - Fix dropped comment attached to the identifier of an open-expression (ocaml-ppx/ocamlformat#2155, @gpetiot) - Correctly format chunks of file in presence of `enable`/`disable` floating attributes (ocaml-ppx/ocamlformat#2156, @gpetiot) - Remove abusive normalization in docstrings references (ocaml-ppx/ocamlformat#2159, ocaml-ppx/ocamlformat#2162, @EmileTrotignon) - Fix parentheses around symbols in if-then-else branches (ocaml-ppx/ocamlformat#2169, @gpetiot) - Preserve position of comments around variant identifiers (ocaml-ppx/ocamlformat#2179, @gpetiot) - Fix parentheses around symbol identifiers (ocaml-ppx/ocamlformat#2185, @gpetiot) - Fix alignment inconsistency between let-binding and let-open (ocaml-ppx/ocamlformat#2187, @gpetiot) - Fix reporting of operational settings origin in presence of profiles (ocaml-ppx/ocamlformat#2188, @EmileTrotignon) - Fix alignment inconsistency of if-then-else in apply (ocaml-ppx/ocamlformat#2203, @gpetiot) - Fix automated Windows build (ocaml-ppx/ocamlformat#2205, @nojb) - Fix spacing between recursive module bindings and recursive module declarations (ocaml-ppx/ocamlformat#2217, @gpetiot) - ocamlformat-rpc: use binary mode for stdin/stdout (ocaml-ppx/ocamlformat#2218, @rgrinberg) - Fix interpretation of glob pattern in `.ocamlformat-ignore` under Windows (ocaml-ppx/ocamlformat#2206, @nojb) - Remove conf mutability, and correctly display the conventional profile when using print-config (ocaml-ppx/ocamlformat#2233, @EmileTrotignon) - Preserve position of comments around type alias (ocaml-ppx/ocamlformat#2239, @EmileTrotignon) - Preserve position of comments around constructor record (ocaml-ppx/ocamlformat#2237, @EmileTrotignon) - Preserve position of comments around external declaration strings (ocaml-ppx/ocamlformat#2238, @EmileTrotignon, @gpetiot) - Preserve position of comments around module pack expressions (ocaml-ppx/ocamlformat#2234, @EmileTrotignon, @gpetiot) - Correctly parenthesize array literals with attributes in argument positions (ocaml-ppx/ocamlformat#2250, @ccasin) ### Changes - Indent 2 columns after `initializer` keyword (ocaml-ppx/ocamlformat#2145, @gpetiot) - Preserve syntax of generative modules (`(struct end)` vs `()`) (ocaml-ppx/ocamlformat#2135, ocaml-ppx/ocamlformat#2146, @trefis, @gpetiot) - Preserve syntax of module unpack with type constraint (`((module X) : (module Y))` vs `(module X : Y)`) (ocaml-ppx/ocamlformat#2136, @trefis, @gpetiot) - Normalize location format for warning and error messages (ocaml-ppx/ocamlformat#2139, @gpetiot) - Preserve syntax and improve readability of indexop-access expressions (ocaml-ppx/ocamlformat#2150, @trefis, @gpetiot) + Break sequences containing indexop-access assignments + Remove unnecessary parentheses around indices - Mute warnings for odoc code blocks whose syntax is not specified (ocaml-ppx/ocamlformat#2151, @gpetiot) - Improve formatting of odoc links (ocaml-ppx/ocamlformat#2152, @gpetiot) - Preserve sugared extension node attached to an `if` carrying attributes (ocaml-ppx/ocamlformat#2167, @trefis, @gpetiot) - Remove unnecessary parentheses around partially applied infix operators with attributes (ocaml-ppx/ocamlformat#2198, @gpetiot) - JaneStreet profile: doesn't align infix ops with open paren (ocaml-ppx/ocamlformat#2204, @gpetiot) - Re-use the type let_binding from the parser instead of value_binding, improve the spacing of let-bindings regarding of having extension or comments (ocaml-ppx/ocamlformat#2219, @gpetiot) - The `ocamlformat` package now only contains the binary, the library is available through the `ocamlformat-lib` package (ocaml-ppx/ocamlformat#2230, @gpetiot) ### New features - Add a `break-colon` option to decide whether to break before or after the `:` symbol in value binding declarations and type constraints. This behavior is no longer ensured by `ocp-indent-compat`. (ocaml-ppx/ocamlformat#2149, @gpetiot) - Format `.mld` files as odoc documentation files (ocaml-ppx/ocamlformat#2008, @gpetiot) - New value `vertical` for option `if-then-else` (ocaml-ppx/ocamlformat#2174, @gpetiot) - New value `vertical` for option `break-cases` (ocaml-ppx/ocamlformat#2176, @gpetiot) - New value `wrap-or-vertical` for option `break-infix` that only wraps high precedence infix ops (ocaml-ppx/ocamlformat#1865, @gpetiot)
The tests for all three packages fail with:
|
packages/ocamlformat-lib/ocamlformat-lib.0.25.0/ocamlformat-lib.patch
Outdated
Show resolved
Hide resolved
The tests are still failing |
I'm guessing this is a work in progress for a future re-release? I would be personally against the inclusion of a patch this big in opam-repository. |
Yes sorry, I converted as a draft. It's taking more time than I expected (and would like) to get right. |
Superseded by #23464 |
Auto-formatter for OCaml code
CHANGES:
Library
Bug fixes
max-indent
option is not set (Reset max-indent when 'max-indent' is not set ocaml-ppx/ocamlformat#2131, @hhugo, @gpetiot)enable
/disable
floating attributes (Correctly format chunks of file in presence of enable/disable floating attributes ocaml-ppx/ocamlformat#2156, @gpetiot).ocamlformat-ignore
under Windows (Fix interpretation of glob patterns in .ocamlformat-ignore under Windows ocaml-ppx/ocamlformat#2206, @nojb)Changes
initializer
keyword (Indent 2 columns after 'initializer' keyword ocaml-ppx/ocamlformat#2145, @gpetiot)(struct end)
vs()
) (Preserve syntax of generative modules '(struct end)' vs '()' ocaml-ppx/ocamlformat#2135, Fix non-stabilization of comment in generative module when the line breaks ocaml-ppx/ocamlformat#2146, @trefis, @gpetiot)((module X) : (module Y))
vs(module X : Y)
) (Preserve syntax of module unpack with type constraint ('((module X) : (module Y))' vs '(module X : Y)') ocaml-ppx/ocamlformat#2136, @trefis, @gpetiot)if
carrying attributes (Preserve sugared extension node attached to an 'if' carrying attributes ocaml-ppx/ocamlformat#2167, @trefis, @gpetiot)ocamlformat
package now only contains the binary, the library is available through theocamlformat-lib
package (Distribute the library in a separate ocamlformat-lib package ocaml-ppx/ocamlformat#2230, @gpetiot)New features
break-colon
option to decide whether to break before or after the:
symbol in value binding declarations and type constraints. This behavior is no longer ensured byocp-indent-compat
. (Add a 'break-colon' option to decide whether to break before or after the colon in value binding declarations and type constraints ocaml-ppx/ocamlformat#2149, @gpetiot).mld
files as odoc documentation files (Format .mld files as odoc documentation files ocaml-ppx/ocamlformat#2008, @gpetiot)vertical
for optionif-then-else
(New value 'vertical' for option 'if-then-else' ocaml-ppx/ocamlformat#2174, @gpetiot)vertical
for optionbreak-cases
(New value 'vertical' for option 'break-cases' ocaml-ppx/ocamlformat#2176, @gpetiot)wrap-or-vertical
for optionbreak-infix
that only wraps high precedence infix ops (Define 'break-infix=wrap-or-vertical' that only wraps high precedence infix ops ocaml-ppx/ocamlformat#1865, @gpetiot)