Releases: ocaml-ppx/ocamlformat
Releases · ocaml-ppx/ocamlformat
0.26.2
0.26.1
CHANGES:
Changed
- Compatible with OCaml 5.1.0 (#2412, @Julow)
The syntax of let-bindings changed sligthly in this version. - Improved ocp-indent compatibility (#2428, @Julow)
- * Removed extra break in constructor declaration with comment (#2429, @Julow)
- * De-indent the
object
keyword in class types (#2425, @Julow) - * Consistent formatting of arrows in class types (#2422, @Julow)
Fixed
- Fix dropped attributes on a begin-end in a match case (#2421, @Julow)
- Fix dropped attributes on begin-end in an if-then-else branch (#2436, @gpetiot)
- Fix non-stabilizing comments before a functor type argument (#2420, @Julow)
- Fix crash caused by module types with nested
with module
(#2419, @Julow) - Fix ';;' formatting between doc-comments and toplevel directives (#2432, @gpetiot)
0.26.0
CHANGES:
Removed
Deprecated
Bug fixes
- Fix crash caused by
let f (type a) :> a M.u = ..
(#2399, @Julow) - Fix crash caused by
module T = (val (x : (module S)))
(#2370, @Julow) - Fix invalid formatting of
then begin end
(#2369, @Julow) - Protect match after
fun _ : _ ->
(#2352, @Julow) - Fix invalid formatting of
(::)
(#2347, @Julow) - Fix indentation of module-expr extensions (#2323, @gpetiot)
- Remove double parentheses around tuples in a match (#2308, @Julow)
- Remove extra parentheses around module packs (#2305, @Julow, @gpetiot)
- Fix indentation of trailing double-semicolons (#2295, @gpetiot)
- Fix formatting of comments in "disable" chunks (#2279, @gpetiot)
- Fix non-stabilizing comments attached to private/virtual/mutable keywords (#2272, #2307, @gpetiot, @Julow)
Changes
- Improve formatting of doc-comments (#2338, #2349, #2376, #2377, #2379, #2378, @Julow)
Remove unnecessary escaping and preserve empty lines.
- Don't print warnings related to odoc code-blocks when '--quiet' is set (#2336, #2373, @gpetiot, @Julow)
- Improve formatting of module arguments (#2322, @Julow)
- Don't indent attributes after a let/val/external (#2317, @Julow)
- Consistent indentation of
@@ let+ x = ...
(#2315, #2396, @Julow)
It was formatted differently than@@ let x = ...
.
- Improve formatting of class expressions and signatures (#2301, #2328, #2387, @gpetiot, @Julow)
- Consistent indentation of
fun (type a) ->
followingfun x ->
(#2294, @Julow) - Restore short-form formatting of record field aliases (#2282, #2388, @gpetiot, @Julow)
- Restore short-form for first-class modules:
((module M) : (module S))
is formatted as(module M : S)
) (#2280, #2300, @gpetiot, @Julow) - Improve indentation of
~label:(fun ...
(#2271, #2291, #2293, #2298, #2398, @Julow)
Thefun
keyword is docked where possible and the arguments are indented to avoid confusion with the body.
- JaneStreet profile: treat comments as doc-comments (#2261, #2344, #2354, #2365, #2392, @gpetiot, @Julow)
- Tweaks the JaneStreet profile to be more consistent with ocp-indent (#2214, #2281, #2284, #2289, #2299, #2302, #2309, #2310, #2311, #2313, #2316, #2362, #2363, @gpetiot, @Julow)
New features
0.25.1
0.25.0
CHANGES:
Library
- The declaration of options is a regular module instead of a functor. (#2193, @EmileTrotignon)
Bug fixes
- Fix indentation when ocamlformat is disabled on an expression (#2129, @gpetiot)
- Reset max-indent when the
max-indent
option is not set (#2131, @hhugo, @gpetiot) - Add missing parentheses around immediate objects having attributes attached in 4.14 (#2144, @gpetiot)
- Fix dropped comment attached to the identifier of an open-expression (#2155, @gpetiot)
- Correctly format chunks of file in presence of
enable
/disable
floating attributes (#2156, @gpetiot) - Remove abusive normalization in docstrings references (#2159, #2162, @EmileTrotignon)
- Fix parentheses around symbols in if-then-else branches (#2169, @gpetiot)
- Preserve position of comments around variant identifiers (#2179, @gpetiot)
- Fix parentheses around symbol identifiers (#2185, @gpetiot)
- Fix alignment inconsistency between let-binding and let-open (#2187, @gpetiot)
- Fix reporting of operational settings origin in presence of profiles (#2188, @EmileTrotignon)
- Fix alignment inconsistency of if-then-else in apply (#2203, @gpetiot)
- Fix automated Windows build (#2205, @nojb)
- Fix spacing between recursive module bindings and recursive module declarations (#2217, @gpetiot)
- ocamlformat-rpc: use binary mode for stdin/stdout (#2218, @rgrinberg)
- Fix interpretation of glob pattern in
.ocamlformat-ignore
under Windows (#2206, @nojb) - Remove conf mutability, and correctly display the conventional profile when using print-config (#2233, @EmileTrotignon)
- Preserve position of comments around type alias (#2239, @EmileTrotignon)
- Preserve position of comments around constructor record (#2237, @EmileTrotignon)
- Preserve position of comments around external declaration strings (#2238, @EmileTrotignon, @gpetiot)
- Preserve position of comments around module pack expressions (#2234, @EmileTrotignon, @gpetiot)
- Correctly parenthesize array literals with attributes in argument positions (#2250, @ccasin)
Changes
- Indent 2 columns after
initializer
keyword (#2145, @gpetiot) - Preserve syntax of generative modules (
(struct end)
vs()
) (#2135, #2146, @trefis, @gpetiot) - Preserve syntax of module unpack with type constraint (
((module X) : (module Y))
vs(module X : Y)
) (#2136, @trefis, @gpetiot) - Normalize location format for warning and error messages (#2139, @gpetiot)
- Preserve syntax and improve readability of indexop-access expressions (#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 (#2151, @gpetiot)
- Improve formatting of odoc links (#2152, @gpetiot)
- Preserve sugared extension node attached to an
if
carrying attributes (#2167, @trefis, @gpetiot) - Remove unnecessary parentheses around partially applied infix operators with attributes (#2198, @gpetiot)
- JaneStreet profile: doesn't align infix ops with open paren (#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 (#2219, @gpetiot)
- The
ocamlformat
package now only contains the binary, the library is available through theocamlformat-lib
package (#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 byocp-indent-compat
. (#2149, @gpetiot) - Format
.mld
files as odoc documentation files (#2008, @gpetiot) - New value
vertical
for optionif-then-else
(#2174, @gpetiot) - New value
vertical
for optionbreak-cases
(#2176, @gpetiot) - New value
wrap-or-vertical
for optionbreak-infix
that only wraps high precedence infix ops (#1865, @gpetiot)
0.24.1
0.24.0
0.23.0
CHANGES:
Removed
Bug fixes
- Preserve comments around object open/close flag (#2097, @trefis, @gpetiot)
- Preserve comments around private/mutable/virtual keywords (#2098, @trefis, @gpetiot)
- Closing parentheses of local open now comply with
indicate-multiline-delimiters
(#2116, @gpetiot) - emacs: fix byte-compile warnings (#2119, @syohex)
Changes
0.22.4
CHANGES:
Removed
- Profiles
compact
andsparse
are now removed (#2075, @gpetiot) - Options
align-cases
,align-constructors-decl
andalign-variants-decl
are now removed (#2076, @gpetiot) - Option
disable-outside-detected-project
is now removed (#2077, @gpetiot)
Deprecated
Bug fixes
- emacs: Remove temp files in the event of an error (#2003, @gpetiot)
- Fix unstable comment formatting around prefix op (#2046, @gpetiot)
Changes
- Qtest comments are not re-formatted (#2034, @gpetiot)
- ocamlformat-rpc is now distributed through the ocamlformat package (#2035, @Julow)
- Doc-comments code blocks with a language other than 'ocaml' (set in metadata) are not parsed as OCaml (#2037, @gpetiot)
- More comprehensible error message in case of version mismatch (#2042, @gpetiot)
- The global configuration file (
$XDG_CONFIG_HOME
or$HOME/.config
) is only applied when no project is detected,--enable-outside-detected-project
is set, and no applicable.ocamlformat
file has been found. Global and local configurations are no longer used at the same time. (#2039, @gpetiot) - Set
ocaml-version
to a fixed version (4.04.0) by default to avoid reproducibility issues and surprising behaviours (#2064, @kit-ty-kate) - Split option
--numeric=X-Y
into--range=X-Y
and--numeric
(flag). For now--range
can only be used with--numeric
. (#2073, #2082, @gpetiot)
New features
- New syntax
(*= ... *)
for verbatim comments (#2028, @gpetiot) - Preserve the begin-end construction in the AST (#1785, @hhugo, @gpetiot)
- Preserve position of comments located after the semi-colon of the last element of lists/arrays/records (#2032, @gpetiot)
- Option
--print-config
displays a warning when an .ocamlformat file defines redundant options (already defined by a profile) (#2084, @gpetiot)
0.22.3
CHANGES:
Removed
- Profiles
compact
andsparse
are now removed (#2075, @gpetiot) - Options
align-cases
,align-constructors-decl
andalign-variants-decl
are now removed (#2076, @gpetiot) - Option
disable-outside-detected-project
is now removed (#2077, @gpetiot)
Deprecated
Bug fixes
- emacs: Remove temp files in the event of an error (#2003, @gpetiot)
- Fix unstable comment formatting around prefix op (#2046, @gpetiot)
Changes
- Qtest comments are not re-formatted (#2034, @gpetiot)
- ocamlformat-rpc is now distributed through the ocamlformat package (#2035, @Julow)
- Doc-comments code blocks with a language other than 'ocaml' (set in metadata) are not parsed as OCaml (#2037, @gpetiot)
- More comprehensible error message in case of version mismatch (#2042, @gpetiot)
- The global configuration file (
$XDG_CONFIG_HOME
or$HOME/.config
) is only applied when no project is detected,--enable-outside-detected-project
is set, and no applicable.ocamlformat
file has been found. Global and local configurations are no longer used at the same time. (#2039, @gpetiot) - Set
ocaml-version
to a fixed version (4.04.0) by default to avoid reproducibility issues and surprising behaviours (#2064, @kit-ty-kate) - Split option
--numeric=X-Y
into--range=X-Y
and--numeric
(flag). For now--range
can only be used with--numeric
. (#2073, #2082, @gpetiot)
New features
- New syntax
(*= ... *)
for verbatim comments (#2028, @gpetiot) - Preserve the begin-end construction in the AST (#1785, @hhugo, @gpetiot)
- Preserve position of comments located after the semi-colon of the last element of lists/arrays/records (#2032, @gpetiot)
- Option
--print-config
displays a warning when an .ocamlformat file defines redundant options (already defined by a profile) (#2084, @gpetiot)