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

[new release] ocamlformat, ocamlformat-rpc-lib and ocamlformat-lib (0.25.0) #23407

Closed
wants to merge 4 commits into from
Closed

[new release] ocamlformat, ocamlformat-rpc-lib and ocamlformat-lib (0.25.0) #23407

wants to merge 4 commits into from

Conversation

gpetiot
Copy link
Contributor

@gpetiot gpetiot commented Feb 24, 2023

Auto-formatter for OCaml code

CHANGES:

Library

Bug fixes

Changes

New features

…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)
@gpetiot gpetiot changed the title [new release] ocamlformat, ocamlformat-rpc-lib, ocamlformat-lib and ocamlformat-bench (0.25.0) [new release] ocamlformat, ocamlformat-rpc-lib and ocamlformat-lib (0.25.0) Feb 24, 2023
@kit-ty-kate
Copy link
Member

The tests for all three packages fail with:

#=== ERROR while compiling ocamlformat.0.25.0 =================================#
# context              2.2.0~alpha~dev | linux/x86_64 | ocaml-base-compiler.4.08.1 | pinned(https://github.com/ocaml-ppx/ocamlformat/releases/download/0.25.0/ocamlformat-0.25.0.tbz)
# path                 ~/.opam/4.08/.opam-switch/build/ocamlformat.0.25.0
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p ocamlformat -j 31 @install @runtest
# exit-code            1
# env-file             ~/.opam/log/ocamlformat-7-ed8c29.env
# output-file          ~/.opam/log/ocamlformat-7-ed8c29.out
### output ###
# File "vendor/parser-recovery/lib/dune", line 14, characters 0-194:
# 14 | (rule
# 15 |  (targets parser_recover.ml)
# 16 |  (deps parser.cmly)
# 17 |  (action
# 18 |   (with-stdout-to
# 19 |    %{targets}
# 20 |    (with-stderr-to
# 21 |     recovery_parser.stderr
# 22 |     (run ../menhir-recover/main.exe parser.cmly)))))
# Error: No rule found for vendor/parser-recovery/lib/parser.cmly
# File "test/rpc/dune", line 17, characters 12-31:
# 17 |  (libraries ocamlformat-rpc-lib unix)
#                  ^^^^^^^^^^^^^^^^^^^
# Error: Library "ocamlformat-rpc-lib" not found.
# -> required by _build/default/test/rpc/rpc_test_fail.exe
# -> required by _build/default/test/rpc/rpc_test_fail.output
# -> required by alias test/rpc/runtest in test/rpc/dune:16
# File "test/rpc/dune", line 3, characters 12-31:
# 3 |  (libraries ocamlformat-rpc-lib unix)
#                 ^^^^^^^^^^^^^^^^^^^
# Error: Library "ocamlformat-rpc-lib" not found.
# -> required by _build/default/test/rpc/rpc_test.exe
# -> required by _build/default/test/rpc/rpc_test.output
# -> required by alias test/rpc/runtest in test/rpc/dune:2

@kit-ty-kate
Copy link
Member

The tests are still failing

@kit-ty-kate
Copy link
Member

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.

@gpetiot gpetiot marked this pull request as draft March 3, 2023 19:44
@gpetiot
Copy link
Contributor Author

gpetiot commented Mar 3, 2023

Yes sorry, I converted as a draft. It's taking more time than I expected (and would like) to get right.
At this point I wish I could release the package without the tests.

@gpetiot gpetiot marked this pull request as ready for review March 6, 2023 17:39
@kit-ty-kate
Copy link
Member

Superseded by #23464

@kit-ty-kate kit-ty-kate closed this Mar 6, 2023
@gpetiot gpetiot deleted the release-ocamlformat-0.25.0 branch March 6, 2023 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants