Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
0.21.0 (2022-02-25)
Bug fixes
Add missing parentheses around variant class arguments (#1967, @gpetiot)
Fix indentation of module binding RHS (#1969, @gpetiot)
Fix position of := when assignment-operator=end-line (#1985, @gpetiot)
Fix position of comments attached to constructor decl (#1986, @gpetiot)
Do not wrap docstrings, wrap-comments should only impact non-documentation comments, wrapping invalid docstrings would cause the whole file to not be formatted (#1988, @gpetiot)
Do not break between 2 module items when the first one has a comment attached on the same line. Only a comment on the next line should induce a break to make it clear to which element it is attached to (#1989, @gpetiot)
Preserve position of comments attached to the last node of a subtree (#1667, @gpetiot)
Do not override the values of the following non-formatting options when a profile is set: comment-check, disable, max-iters, ocaml-version, and quiet (#1995, @gpetiot).
Remove incorrect parentheses around polymorphic type constraint (#2002, @gpetiot)
Handle cases where an attribute is added to a bind expression, e.g. (x >>= (fun () -> ())) [@a] (#2013, @emillon)
Fix indentation of constraints of a package type pattern (#2025, @gpetiot)
Changes
More expressions are considered "simple" (not inducing a break e.g. as an argument of an application):
Variants with no argument (#1968, @gpetiot)
Empty or singleton arrays/lists (#1943, @gpetiot)
Print odoc code block delimiters on their own line (#1980, @gpetiot)
Make formatting of cons-list patterns consistent with cons-list expressions, (::) operators are aligned when possible, comments position also improved (#1983, @gpetiot)
Apply 'sequence-style' to add a space before ';;' between toplevel items, consistently with the formatting of ';' in sequences (#2004, @gpetiot)
New features
Format toplevel phrases and their output (#1941, @Julow, @gpetiot). This feature is enabled with the flag --parse-toplevel-phrases. Toplevel phrases are supported when they are located in doc-comments blocks and cinaps comments. Whole input files can also be formatted as toplevel phrases with the flag --repl-file.
RPC
ocamlformat-rpc-lib is now functorized over the IO (#1975, @gpetiot). Now handles Csexp.t types instead of Sexplib0.Sexp.t.
RPC v2 (#1935, @panglesd): Define a 'Format' command parameterized with optionnal arguments to set or override the config and path, to format in the style of a file.
Prevent RPC to crash on version mismatch with .ocamlformat (#2011, @panglesd, @Julow)
0.20.1 (2021-12-13)
New features
Update to odoc-parser 1.0.0 (#1843, @Julow). New syntax: code blocks can carry metadata, e.g.: {@ocaml kind=toplevel env=e1[ code ]}
0.20.0 (2021-12-06)
Deprecated
Profiles compact and sparse are now deprecated and will be removed by version 1.0 (#1803, @gpetiot)
Options that are not set by the preset profiles are now deprecated and will be removed by version 1.0:
align-cases, align-constructors-decl and align-variants-decl (#1793, @gpetiot)
Fix quadratic behavior when certain constructs are nested. This corresponds to the cases where a partial layout is triggered to determine if a construct fits on a single line for example. (#1750, #1766, @emillon)
Fix non stabilizing comments after infix operators (*, %, #-ops) (#1776, @gpetiot)
Fix excessive break and wrong indentation after a short-open when indicate-multiline-delimiters=closing-on-separate-line (#1786, @gpetiot)
Add parentheses around type alias used as type constraint (#1801, @gpetiot)
Fix alignment of comments inside a tuple pattern and remove incorrect linebreak. Fix formatting of labelled arguments containing comments. (#1797, @gpetiot)
Emacs: only hook ocamlformat mode on tuareg/caml modes when ocamlformat is not disabled (#1814, @gpetiot)
Fix boxing of labelled arguments, avoid having a linebreak after a label when the argument has a comment attached (#1830, #1885, @gpetiot)
Add missing parentheses around application of prefix op when applied to other operands (#1825, @gpetiot)
Fix application of a monadic binding when 'break-infix-before-func=false' (#1849, @gpetiot)
Fix dropped comments attached to a sequence in a sugared extension node (#1853, @gpetiot)
Fix formatting of exception types, and add missing parentheses (#1873, @gpetiot)
Fix indentation of with-type constraints (#1883, @gpetiot)
Preserve sugared syntax of extension points with attributes (#1913, @gpetiot)
Improve comment attachment when followed but not preceded by a linebreak (#1926, @gpetiot)
Fix position of comments preceding Pmod_ident (#1939, @gpetiot)
Make the formatting of attributes and docstrings more consistent (#1929, @gpetiot)
Fix stabilization of comments inside attributes (#1942, @gpetiot)
Changes
Set 'module-item-spacing=compact' in the default/conventional profile (#1848, @gpetiot)
Preserve bracketed lists in the Parsetree (#1694, #1876, #1914, @gpetiot)
Line directives now cause OCamlFormat to emit an error, they were previously silently ignored (#1845, @gpetiot)
Apply option 'module-item-spacing' on mutually recursive type declarations for more consistency (#1854, @gpetiot)
New features
Handle merlin typed holes (#1698, @gpetiot)
Handle punned labelled arguments with type constraint in function applications. For example, function application of the form foo ~(x:int) instead of the explicit foo ~x:(x:int). (ocaml#10434) (#1756, #1759, @gpetiot) This syntax is only produced when the output syntax is at least OCaml 4.14.
Allow explicit binders for type variables (ocaml#10437) (#1757, @gpetiot)
Add a new ocaml-version option to select the version of OCaml syntax of the output (#1759, @gpetiot)
Allow disambiguated global identifiers (like t/2) so they can be formatted by tools like OCaml-LSP (#1716, @let-def)
Handle let operator punning uniformly with other punning forms. Normalizes let operator to the punned form where possible, if output syntax version is at least OCaml 4.13.0. (#1834, #1846, @jberdine)
Remove unnecessary surrounding parentheses for immediate objects. This syntax is only produced when the output syntax is at least OCaml 4.14. (#1934, @gpetiot)
0.19.0 (2021-07-16)
Bug fixes
Fix formatting of odoc tags: the argument should be on the same line, indent description that wraps (#1634, #1635, @gpetiot)
Consistently format let bindings and monadic let bindings, do not drop comments before monadic bindings (#1636, @gpetiot)
Fix dropped comments attached to pattern constrained by polynewtype (#1645, @gpetiot)
Fix comment attachment on infix operators (#1643, @gpetiot)
Add missing parens around function at RHS of infix op (#1642, @gpetiot)
Preserve begin-end keywords delimiting match cases (#1651, @gpetiot)
Fix alignment of closing paren on separate line for anonymous functions (#1649, @gpetiot)
Preserve begin-end keywords around infix operators (#1652, @gpetiot)
Preserve begin%ext syntax for infix opererator expressions (#1653, @gpetiot)
Consistently format comments attached to let-and bindings located at toplevel (#1663, @gpetiot)
Remove double parens around a functor in a module application (#1681, @gpetiot)
Improve breaking of comments to avoid violating the margin (#1676, @jberdine)
Fix parentheses around successive unary operations (#1696, @gpetiot)
Add missing break between pattern and attribute (#1711, @gpetiot)
Add missing parentheses around expression having attributes or comments inside a shorthand let-open clause (#1708, @gpetiot)
Do not consider leading star '*' when checking the diff of doc comments (#1712, @hhugo)
Fix formatting of multiline non-wrapping comments (#1723, @gpetiot)
Fix position of comments following a record field (#1945, @gpetiot)
Changes
Improve the diff of unstable docstrings displayed in error messages (#1654, @gpetiot)
Use UTF8 length of strings, not only in wrapped comments (#1673, @jberdine)
Improve position of ;; tokens (#1688, @gpetiot)
Depend on odoc-parser instead of odoc (#1683, #1713, @kit-ty-kate, @jonludlam, @julow) The parser from odoc has been split from the main odoc package and put into its own package, odoc-parser.
Revert infix-form list formatting to pre-0.17.0 (#1717, @gpetiot)
New features
Implement OCaml 4.13 features
Named existentials in pattern-matching (ocaml#9584)
Let-punning (ocaml#10013)
Module type substitutions (ocaml#10133) (#1680, @gpetiot)
Emacs integration (disabled for ocamlformat < 0.19.0):
Indent a line or a region with ocamlformat when pressing
Break the line and reindent the cursor when pressing (#1639, #1685, @gpetiot) (#1687, @bcc32)
Add 'line-endings=lf|crlf' option to specify the line endings used in the formatted output. (#1703, @nojb)
Internal
A script tools/build-mingw64.sh is provided to build a native Windows binary of ocamlformat using mingw64 toolchain under Cygwin.
0.18.0 (2021-03-30)
Bug fixes
Fix extraneous parenthesis after let open with closing-on-separate-line (#1612, @Julow)
Add missing break between polytype quantification and arrow-type body (#1615, @gpetiot)
Changes
Use dune instrumentation backend for bisect_ppx (#1550, @tmattio)
Format objects and classes consistently with structure and signature items (#1569, @bikallem)
New features
Expose a RPC interface through a new binary ocamlformat-rpc and a new library ocamlformat-rpc-lib (#1586, @gpetiot, @voodoos)
0.17.0 (2021-02-15)
Removed
Remove the 'let-open' option, deprecated since 0.16.0 (#1563, @gpetiot)
Remove support for OCaml 4.06 and 4.07, minimal version requirement bumped to OCaml 4.08 (#1549, @gpetiot)
Remove the 'extension-sugar' option, deprecated since 0.14.0 (#1588, @gpetiot)
Bug fixes
Fix parsing of invalid file wrt original source handling (#1542, @hhugo)
Preserve the syntax of infix set/get operators (#1528, @gpetiot) String.get and similar calls used to be automatically rewritten to their corresponding infix form .(), that was incorrect when using the -unsafe compilation flag. Now the concrete syntax of these calls is preserved.
Add location of invalid docstring in warning messages (#1529, @gpetiot)
Fix comments on the same line as prev and next elements (#1556, @gpetiot)
Break or-patterns after comments and preserve their position at the end of line (#1555, @gpetiot)
Fix linebreak between signature items of the same group (#1560, @gpetiot)
Fix stack overflow on large string constants (#1562, @gpetiot)
Fix comment position around list cons operator (#1567, @gpetiot)
Fix the vertical alignment test to break down comment groups (#1575, @gpetiot)
Preserve spacing of toplevel comments (#1554, @gpetiot)
Support more sugared extension points (#1587, @gpetiot)
Changes
Add buffer filename in the logs when applying ocamlformat (#1557, @dannywillems)
Improve comment position in pattern collection (#1576, @gpetiot)
Consistent positioning of lambda return type annotations when no-break-infix-before-func and pre/post extensions (#1581, @gpetiot)
New features
Support injectivity type annotations (OCaml 4.12 feature) (#1523, @gpetiot)
0.16.0 (2020-11-16)
Removed
Remove the 'escape-chars' option, deprecated since 0.14.0 (#1462, @gpetiot)
Remove the 'escape-strings' option, deprecated since 0.14.0 (#1463, @gpetiot)
Remove the 'doc-comments-val' option, deprecated since 0.14.2 (#1461, @gpetiot)
Removed options are now listed in the commandline manual (new REMOVED OPTIONS section) (#1469, @Julow)
Changes
Set 'indicate-multiline-delimiters=no' on default profile (#1452, @gpetiot)
Option 'let-open' is now deprecated, concrete syntax will always be preserved starting from OCamlFormat v0.17.0, corresponding to the current 'let-open=preserve' behavior. (#1467, @gpetiot)
Warnings printed by ocamlformat itself now use the 4.12 style with symbolic names (#1511, #1518, @emillon)
Remove extension from executable name in error messages. On Windows, this means that messages now start with "ocamlformat: ..." instead of "ocamlformat.exe: ..." (#1531, @emillon)
Using tokens instead of string manipulation when inspecting the original source (#1526, #1533, #1541 @hhugo) (#1532, @gpetiot)
Bug fixes
Allow a break after if%ext with if-then-else=keyword-first (#1419, #1543, @gpetiot)
Fix parentheses around infix applications having attributes (#1464, @gpetiot)
Fix parentheses around the index arg of a non-sugared index operation (#1465, @gpetiot)
Preserve comment position around match and try keywords (#1458, @gpetiot)
Add missing break in module statement (#1431, @gpetiot)
Indent attributes attached to included modules better (#1468, @gpetiot)
Clean up ocamlformat.el for submission to MELPA (#1476, #1495, @bcc32)
Added missing package metadata to ocamlformat.el (#1474, @bcc32)
Fix ocamlformat.el buffer replacement for MacOS Emacs (#1481, @juxd)
Add missing parentheses around a pattern matching that is the left-hand part of a sequence when an attribute is attached (#1483, @gpetiot)
Add missing parentheses around infix operator used to build a function (#1486, @gpetiot)
Fix comments around desugared expression (#1487, @gpetiot)
Fix invalid fragment delimiters of format-invalid-files recovery mode (#1485, @hhugo)
Fix misalignment of cases in docked function match (#1498, @gpetiot)
Preserve short-form extensions for structure item extensions (#1502, @gpetiot) For example open%ext M will not get rewritten to [%%ext open M].
Do not change the spaces within the code spans in docstrings (#1499, @gpetiot)
Comments of type constrained label in record pattern have to be relocated in 4.12 (#1517, @gpetiot)
Preserve functor syntax for OCaml 4.12 (#1514, @gpetiot)
Fix inconsistencies of the closing parentheses with indicate-multiline-delimiters (#1377, #1540, @gpetiot)
Fix position of comments around list constructor (::) (#1524, @gpetiot)
Fix comments position in extensions (#1525, @gpetiot)
Fix formatting of field override with constraint (#1544, @gpetiot)
New features
0.15.1 (2020-11-02)
Internal
Use ppxlib instead of ocaml-migrate-parsetree 1.x. (#1482, @emillon)
Do not break inline elements such as {i blah} in docstrings (#1346, @jberdine)
Distinguish hash-getter from hash-comparison infix operators. Operators of the form #**# or #**. where ** can be 0 or more operator chars are considered getter operators and are not surrounded by spaces, as opposed to regular infix operators (#1376, @gpetiot)
Type constraint on return type of functions is now always printed before the function body (#1381, #1397, @gpetiot)
Bug fixes
Restore previous functionality for pre-post extension points (#1342, @jberdine)
Fix extra break before function body of a fun (#1343, @jberdine) Indent further args of anonymous functions (#1440, @gpetiot)
Do not clear the emacs *compilation* buffer on successful reformat (#1350, @jberdine)
Fix disabling with attributes on OCaml < 4.08 (#1322, @emillon)
Preserve unwrapped comments by not adding artificial breaks when wrap-comments=false and ocp-indent-compat=true are set to avoid interfering with ocp-indent indentation. (#1352, @gpetiot)
Break long literal strings at the margin (#1367, @gpetiot)
Break after a multiline argument in an argument list (#1360, @gpetiot)
Remove unnecessary parens around object (#1379, @gpetiot)
Fix placement of comments on constants (#1383, @gpetiot)
Do not escape arguments of some Odoc tags (#1391, 1408, @gpetiot, @Julow) The characters []{} must not be escaped in the arguments of @raise, @author, @version and others.
Fix missing open line between multi-line let-binding with poly-typexpr (#1372, @jberdine)
Remove trailing space after expression when followed by an attribute and break before attributes attached to multi-line phrases (#1382, @gpetiot)
Do not add a space to minimal comments (* *), (** *) and (*$ *) (#1407, @gpetiot)
Fix attributes position in labelled arguments type (#1434, @gpetiot)
Add missing parens around type annotation in anonymous function (#1433, @gpetiot)
Fix alignment of 'then' keyword in parenthesised expression (#1421, @gpetiot)
New features
Support quoted extensions (added in ocaml 4.11) (#1405, @gpetiot)
Recognise eliom file extensions (#1430, @jrochel)
0.14.3 (2020-07-22)
Changes
No functional changes from 0.14.2. The goal of this release is to be compatible with base and stdio v0.14.0.
Backport the following PRs:
#1386 - Update opam metadata
#1396 - Add compatibility with base.v0.14.0
#1399 - Allow stdio.v0.14
0.14.2 (2020-05-11)
Changes
Merge doc-comments-val option with doc-comments. The placement of documentation comments on val and external items is now controled by doc-comments.
doc-comments=after becomes doc-comments=after-when-possible to take into account the technical limitations of ocamlformat;
doc-comments=before is unchanged;
doc-comments-val is now replaced with doc-comments To reproduce the former behaviors
doc-comments=before + doc-comments-val=before: now use doc-comments=before;
doc-comments=before + doc-comments-val=after: now use doc-comments=before-except-val;
doc-comments=after + doc-comments-val=before: this behavior did not make much sense and is not available anymore;
doc-comments=after + doc-comments-val=after: now use doc-comments=after-when-possible.
This reverts changes introduced in 0.14.1 (#1335) and 0.14.0 (#1012).
0.14.1 (2020-04-14)
Changes
The default for doc-comments is changed to after (#1335) (Jules Aguillon) This reverts a change introduced in 0.14.0 (#1012).
Revert deprecation of the doc-comments option (#1331) (Jules Aguillon) This reverts a change introduced in 0.14.0 (#1293).
0.14.0 (2020-04-02)
New features
Add an option --format-invalid-files to print unparsable parts of the input as verbatim text. This feature is still experimental. (#1026) (Guillaume Petiot)
Support multi-indices extended indexing operators (#1279, #1277) (Jules Aguillon, Guillaume Petiot) This feature has been added in OCaml 4.10.0
Preserve functor syntax for consistency (#1312) (Guillaume Petiot) Previously both functor syntax: module M = functor (K : S) -> struct end and module M (K : S) = struct end would be formatted as the latter, the original syntax is now preserved.
Changes
Add the option doc-comments-val=before|after (#1012) (Jules Aguillon) This option set the placement of documentation comment on val and external only. It is set to after by default.
The default for doc-comments is changed from after to before (#1012, #1325) (Jules Aguillon) This affects both conventional (default) and ocamlformat profiles.
Some options are now deprecated:
doc-comments (#1293, #1012) This option depends on a flawed heuristic. It is replaced by doc-comments-val for val and external declarations. There is no equivalent to this option in the general case.
escape-chars, escape-strings and extension-sugar (#1293) These options are rarely used and their default behavior is considered to be the right behavior.
Add space between row_field attributes and the label or arguments, to be consistent with the non-polymorphic case. (#1299) (Craig Ferguson)
Bug fixes
Fix missing parentheses around let open (#1229) (Jules Aguillon) eg. M.f (M.(x) [@attr]) would be formatted to M.f M.(x) [@attr], which would crash OCamlformat
Remove unecessary parentheses with attributes in some structure items:
extensions and eval items (#1230) (Jules Aguillon) eg. the expression [%ext (() [@attr])] or the structure item (() [@attr]) ;;
let _ = ... constructs (#1244) (Etienne Millon)
Fix some bugs related to comments:
after a function on the rhs of an infix (#1231) (Jules Aguillon) eg. the comment in (x >>= fun y -> y (* A *)) would be dropped
in module unpack (#1309) (Jules Aguillon) eg. in the module expression module M = (val x : S (* A *))
Fix formatting of empty signature payload [%a:] (#1236) (Etienne Millon)
Fix parenthesizing when accessing field of construct application (#1247) (Guillaume Petiot)
Fix formatting of attributes on object overrides {< >} (#1238) (Etienne Millon)
Fix attributes on coercion (#1239) (Etienne Millon)
Fix formatting of attributes on packed modules (#1243) (Etienne Millon)
Fix parens around binop operations with attributes (#1252, #1306) (Guillaume Petiot, Craig Ferguson)
Remove unecessary parentheses in the argument of indexing operators (#1280) (Jules Aguillon)
Retain attributes on various AST nodes:
field set expressions, e.g. (a.x <- b) [@a] (#1284) (Craig Ferguson)
instance variable set expressions, e.g. (a <- b) [@a] (#1288) (Craig Ferguson)
indexing operators, e.g. (a.(b)) [@a] (#1300) (Craig Ferguson)
sequences, e.g. (a; b) [@a] (#1291) (Craig Ferguson)
Avoid unnecessary spacing after object types inside records and polymorphic variants, e.g. {foo : < .. > [@a]} and { foo : < .. > } (#1296) (Craig Ferguson)
Fix missing parentheses around tuples with attributes. (#1301) (Craig Ferguson) Previously, f ((0, 0) [@a]) would be formatted to f (0, 0) [@a], crashing OCamlformat.
Avoid emitting >] when an object type is contained in an extension point or attribute payload (#1298) (Craig Ferguson)
Fix crash on the expression (0).*(0) (#1304) (Jules Aguillon) It was formatting to 0.*(0) which parses as an other expression.
Preserve empty doc-comments syntax. (#1311) (Guillaume Petiot) Previously (**) would be formatted to (***).
Do not crash when a comment contains just a newline (#1290) (Etienne Millon)
Handle lazy patterns as arguments to class (#1289) (Etienne Millon)
Preserve cinaps comments containing unparsable code (#1303) (Jules Aguillon) Previously, OCamlformat would fallback to the "wrapping" logic, making the comment unreadable and crashing in some cases.
Fix normalization of attributes, fixing the docstrings in attributes (#1314) (Guillaume Petiot)
Add missing parentheses around OR-patterns with attributes (#1317) (Guillaume Petiot)
Fix spacing inside parens for symbols when the spacing was handled by the englobing exp (#1316) (Guillaume Petiot)
Fix invalid (unparsable) docstrings (#1315) (Guillaume Petiot) When parsing a comment raises an error in odoc, it is printed as-is.
Fix parenthesizing of optional arguments rebound to non-variables, e.g. let f ?a:(A) = () rather than the unparsable let f ?a:A = () (#1305) (Craig Ferguson)
0.13.0 (2020-01-28)
New features
Add an option --margin-check to emit a warning if the formatted output exceeds the margin (#1110) (Guillaume Petiot)
Preserve comment indentation when wrap-comments is unset (#1138, #1159) (Jules Aguillon)
Improve error messages (#1147) (Jules Aguillon)
Display standard output in the emacs plugin even when ocamlformat does not fail (#1189) (Guillaume Petiot)
Removed
Remove ocamlformat_reason (#254, #1185) (Etienne Millon). This tool has never been released to opam, has no known users, and overlaps with what refmt can do.
Remove ocamlformat-diff (#1205) (Guillaume Petiot) This tool has never been released to opam, has no known users, and overlaps with what merge-fmt can do.
Packaging
Work with base v0.13.0 (#1163) (Jules Aguillon)
Bug fixes
Fix placement of comments just before a '|' (#1203) (Jules Aguillon)
Fix build version detection when building in the absence of a git root (#1198) (Anil Madhavapeddy)
Fix wrapping of or-patterns in presence of comments with break-cases=fit (#1167) (Jules Aguillon) This also fixes an unstable comment bug in or-patterns
Fix an unstable comment bug in variant declarations (#1108) (Jules Aguillon)
Fix: types on named arguments were wrapped incorrectly when preceding comments (#1124) (Guillaume Petiot)
Fix the indentation produced by max-indent (#1118) (Guillaume Petiot)
Fix break after Psig_include depending on presence of docstring (#1125) (Guillaume Petiot)
Remove some calls to if_newline and break_unless_newline and fix break before closing brackets (#1168) (Guillaume Petiot)
Fix unstable cmt in or-pattern (#1173) (Guillaume Petiot)
Fix location of comment attached to the underscore of an open record (#1208) (Guillaume Petiot)
Fix parentheses around optional module parameter (#1212) (Christian Barcenas)
Fix grouping of horizontally aligned comments (#1209) (Guillaume Petiot)
Fix dropped comments around module pack expressions (#1214) (Jules Aguillon)
Fix regression of comment position in list patterns (#1141) (Josh Berdine)
Fix: adjust definition of Location.is_single_line to reflect margin (#1102) (Josh Berdine)
Documentation
Fix documentation of option version-check (#1135) (Wilfred Hughes)
Fix hint when using break-separators=after-and-docked (#1130) (Greta Yorsh)
0.12 (2019-11-04)
Changes
Set "conventional" as the default profile (#1060) (Guillaume Petiot) This new profile is made to better match the most used style and is encouraged. To continue using the previous default, use profile = ocamlformat in your .ocamlformat.
CLI: Allow both values of boolean options (#1062) (Jules Aguillon) Now, both --opt and --no-opt` are available on the CLI for any boolean option "opt". Previously, only one of them were available depending on the default value.
Auto mode for break-string-literals (#1057) (Guillaume Petiot) wrap, newlines and newlines-and-wrap values of break-string-literals are removed. auto replaces them, it is equivalent to newlines-and-wrap.
Dock collection brackets (#1014) (Guillaume Petiot) after-and-docked value of break-separators is removed and is replaced by a new dock-collection-brackets option.
Preserve begin and end keywords in if-then-else (#978) (Jules Aguillon) Previously, begin/end keywords around if-then-else branches were turned into parentheses.
New features
Give a hint when warning 50 is raised (#1111) (Guillaume Petiot)
Add a message when a config value is removed (#1089) (Etienne Millon) Explain what replaces removed options and avoid printing a parsing error.
Implement sequence-blank-line=preserve-one for let bindings (#1077) (Jules Aguillon) Preserve a blank line after let .. in when sequence-blank-line set to preserve-one. Previously, only blank lines after ; could be preserved.
Parse toplevel directives (#1020) (Jules Aguillon) Allow #directives in .ml files. Previously, files containing a directive needed to be parsed as "use file". The "use file" mode is removed and --use-file is now the same as --impl.
Don't require --name, require kind, forbid --inplace, allow --check, make --enable-outside-detected-project implicit when reading from stdin (#1018) (Guillaume Petiot)
Parse code in docstrings (#941) (Guillaume Petiot) Format OCaml code in cinaps-style comments (*$ code *) and code blocks in documentation comments (** {[ code ]} *).
Parse documentation comments with Odoc (#721) (Jules Aguillon) Formatting of documentation comments is more robust and support newer Odoc syntaxes. Internally, Odoc replaces Octavius as the documentation parser.
Bug fixes
Fix unstabilizing comments on assignments (#1093) (Guillaume Petiot)
Fix the default value documentation for max-indent (#1105) (Guillaume Petiot)
Fix closing parenthesis exceeding the margin in function application (#1098) (Jules Aguillon)
Missing break before attributes of Pmty_with (#1103) (Josh Berdine)
Fix closing quote exceeding the margin (#1096) (Jules Aguillon)
Fix break before the closing bracket of collections (exceeding the margin) (#1073) (Guillaume Petiot)
Fix precedence of Dot wrt Hash (#1058) (Guillaume Petiot)
Fix break in variant type definition to not exceed the margin (#1064) (Guillaume Petiot)
Fix newlines and indentation in toplevel extension points (#1054) (Guillaume Petiot)
Fix placement of doc comments around extensions (#1052) (Jules Aguillon)
Inline extensions that do not break (#1050) (Guillaume Petiot)
Add missing cut before attributes in type declarations (#1051) (Guillaume Petiot)
Fix alignment of cases (#1046) (Guillaume Petiot)
Fix blank line after comments at the end of lists (#1045) (Guillaume Petiot)