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 (0.17.0) #18158

Closed
wants to merge 1 commit into from
Closed

[new release] ocamlformat (0.17.0) #18158

wants to merge 1 commit into from

Conversation

gpetiot
Copy link
Contributor

@gpetiot gpetiot commented Feb 15, 2021

Auto-formatter for OCaml code

CHANGES:

Removed

Bug fixes

Changes

New features

@kit-ty-kate
Copy link
Member

The tests failed with:

[...]
# (cd _build/.sandbox/f5576e77f95ffe2605b7299799d75731/default && /usr/bin/git --no-pager diff --no-index --color=always -u ../../../default/test/cli/stdin.t test/cli/stdin.t.corrected)
# diff --git a/../../../default/test/cli/stdin.t b/test/cli/stdin.t.corrected
# index 742c23f..96f3517 100644
# --- a/../../../default/test/cli/stdin.t
# +++ b/test/cli/stdin.t.corrected
# @@ -15,15 +15,21 @@ One of '--impl', '--intf' or '--name' is required when the input is read from st
#  Nominal cases:
#  
#    $ echo 'let x =       1' | ocamlformat --impl -
# -  let x = 1
# +  File <standard input>
# +  Warning: Ocamlformat disabled because [--enable-outside-detected-project] is not set and no [.ocamlformat] was found within the project (root: ../../../../../../../ocamlformat.0.17.0)
# +  let x =       1
#  
#    $ echo 'val x :     int' | ocamlformat --intf -
# -  val x : int
# +  File <standard input>
# +  Warning: Ocamlformat disabled because [--enable-outside-detected-project] is not set and no [.ocamlformat] was found within the project (root: ../../../../../../../ocamlformat.0.17.0)
# +  val x :     int
[...]

@gpetiot
Copy link
Contributor Author

gpetiot commented Feb 15, 2021

I have no idea where it comes from, it looks like dune changed the way it runs the tests, but dune runtest doesn't report any issue for me.

@camelus
Copy link
Contributor

camelus commented Feb 15, 2021

Commit: 3682870

@gpetiot has posted 12 contributions.

☀️ All lint checks passed 3682870
  • These packages passed lint tests: ocamlformat.0.17.0

☀️ Installability check (+1)
  • new installable packages (1): ocamlformat.0.17.0

@kit-ty-kate
Copy link
Member

I have no idea where it comes from, it looks like dune changed the way it runs the tests, but dune runtest doesn't report any issue for me.

I tried locally and for me it does report some failures, but not the same, e.g.:

@@ -9817,8 +9817,8 @@ let _ =
 let _ =
   match () with
   | _ ->
-    (match () with
-     | _ -> long_function_name long_argument_name__________________________________________)
+      (match () with
+       | _ -> long_function_name long_argument_name__________________________________________)
 ;;
 
 let _ =
@@ -9831,7 +9831,7 @@ let g =
   f
     ~x
     (* this is a multiple-line-spanning
-              comment *)
+       comment *)
     ~y
 ;;
 

@kit-ty-kate
Copy link
Member

I was also able to reproduce in a docker container:

FROM ocaml/opam:debian-ocaml-4.11
RUN git -C opam-repository pull git://github.com/gpetiot/opam-repository.git release-ocamlformat-0.17.0
RUN opam update
RUN opam-2.1 install -yt ocamlformat.0.17.0

CHANGES:

#### Removed

  + Remove the 'let-open' option, deprecated since 0.16.0 (ocaml-ppx/ocamlformat#1563, @gpetiot)

  + Remove support for OCaml 4.06 and 4.07, minimal version requirement bumped to OCaml 4.08 (ocaml-ppx/ocamlformat#1549, @gpetiot)

  + Remove the 'extension-sugar' option, deprecated since 0.14.0 (ocaml-ppx/ocamlformat#1588, @gpetiot)

#### Bug fixes

  + Fix parsing of invalid file wrt original source handling (ocaml-ppx/ocamlformat#1542, @hhugo)

  + Preserve the syntax of infix set/get operators (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#1529, @gpetiot)

  + Fix comments on the same line as prev and next elements (ocaml-ppx/ocamlformat#1556, @gpetiot)

  + Break or-patterns after comments and preserve their position at the end of line (ocaml-ppx/ocamlformat#1555, @gpetiot)

  + Fix linebreak between signature items of the same group (ocaml-ppx/ocamlformat#1560, @gpetiot)

  + Fix stack overflow on large string constants (ocaml-ppx/ocamlformat#1562, @gpetiot)

  + Fix comment position around list cons operator (ocaml-ppx/ocamlformat#1567, @gpetiot)

  + Fix the vertical alignment test to break down comment groups (ocaml-ppx/ocamlformat#1575, @gpetiot)

  + Preserve spacing of toplevel comments (ocaml-ppx/ocamlformat#1554, @gpetiot)

  + Support more sugared extension points (ocaml-ppx/ocamlformat#1587, @gpetiot)

#### Changes

  + Add buffer filename in the logs when applying ocamlformat (ocaml-ppx/ocamlformat#1557, @dannywillems)

  + Improve comment position in pattern collection (ocaml-ppx/ocamlformat#1576, @gpetiot)

  + Consistent positioning of lambda return type annotations when no-break-infix-before-func and pre/post extensions (ocaml-ppx/ocamlformat#1581, @gpetiot)

#### New features

  + Support injectivity type annotations (OCaml 4.12 feature) (ocaml-ppx/ocamlformat#1523, @gpetiot)
@gpetiot gpetiot closed this Feb 16, 2021
@gpetiot gpetiot deleted the release-ocamlformat-0.17.0 branch February 16, 2021 13:34
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.

3 participants