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

Improve: remove the bisect_ppx dependency and clean Makefile #1005

Merged
merged 10 commits into from
Sep 24, 2019

Conversation

Julow
Copy link
Collaborator

@Julow Julow commented Sep 3, 2019

  • Avoid building and running tests twice
  • Avoid using paths to _build
  • Remove dune-workspace that was making dune hard to use on the command line
  • Remove plugin code from src/dune
  • Remove bisect support
  • Improve test_branch to use a separate tree, so the script does not change while executing (UB) and does not change user's worktree

Everyone that built OCamlformat before must remove its dune-workspace file.
That file must be removed everytime we switch from before to after this PR is eventually merged (eg. reviewing PRs, git bisect)

With this, dune build and dune exec -- ocamlformat will work correctly.

@hhugo
Copy link
Collaborator

hhugo commented Sep 3, 2019

  • I believe this will make ocamlformat slower. The "release" profile currently removes asserts by passing the -noassert flag. There are pretty expensive checks in Ast.ml. @jberdine, do you have any though on this ?
  • I'm a bit sad to see bisect support disappear. I was hoping that we build something with it. Like making sure that new feature come with good tests (covering the new code paths)
  • can you explain why dune-workspace is make using dune hard ?

@Julow
Copy link
Collaborator Author

Julow commented Sep 4, 2019

I readded the -noassert flag in release mode.

The dune-workspace was problematic because:

  • It is generated by the Makefile
  • It references the current opam switch but is not regenerated if it changes
  • If it is not present, the contexes it defines will not be built. So test-extra/Makefile won't find the binary
  • It removes the default context. dune exec must be called with --context=dev

The last 2 could be fixed by renaming the dev context to default.

Removing bisect is not great, I agree. I'll try to add it back.

@Julow
Copy link
Collaborator Author

Julow commented Sep 5, 2019

Bisect is quite easy to use manually, I'm not sure it's worth the trouble adding it to our build system:

  • Add (preprocess (pps bisect_ppx)) to src/dune
  • dune runtest
  • bisect-ppx-report -ignore-missing-files -html coverage _build/default/test/*/bisect*.out

The first step could be automated using either a diff patch or a template comment.

@Julow
Copy link
Collaborator Author

Julow commented Sep 17, 2019

I added tools/bisect.sh that builds and runs ocamlformat with ppx_bisect in a temporary worktree.

@gpetiot gpetiot requested a review from hhugo September 18, 2019 03:24
@gpetiot
Copy link
Collaborator

gpetiot commented Sep 18, 2019

It looks good to me, if it suits Hugo as well you can merge.

@gpetiot gpetiot changed the title Clean makefile Improve: remove the bisect_ppx dependency and clean Makefile Sep 19, 2019
@Julow
Copy link
Collaborator Author

Julow commented Sep 19, 2019

I added a commit to remote the temporary worktrees in test_branch.sh to avoid filling /tmp.

@gpetiot
Copy link
Collaborator

gpetiot commented Sep 23, 2019

Can be rebased now that the odoc dependency has been updated, and merged.

@Julow
Copy link
Collaborator Author

Julow commented Sep 23, 2019

Rebased.

@Julow Julow merged commit 59ca7c2 into ocaml-ppx:master Sep 24, 2019
@jberdine
Copy link
Collaborator

jberdine commented Nov 1, 2019

Isn't dune exec not working with any context a dune bug?

After this change, what is the intended workflow for testing multiple compiler versions, etc. With no workspace, it seems that the only reasonable workable thing to do is to use a local opam switch so that it is automatically selected. But then there can be only one. Which makes the process of e.g. changing the compiler version very very slow.

I don't understand how this change isn't seen as a huge developer experience regression.

@Julow
Copy link
Collaborator Author

Julow commented Nov 4, 2019

I think the usual workflow for that is simply changing the current switch (opam switch <switch>).
If you must not change your current global switch, you can use opam switch link <switch>. It symlinks a global switch as a local switch in your current directory.

@emillon
Copy link
Collaborator

emillon commented Nov 4, 2019

@jberdine there's also another way to test on multiple compiler versions, which is having a dune-workspace.dev file. That way, it's not picked by default, but it's still possible to test all versions at once. There's a setup like this in dune, though in practice we often let CI deal with these compatibility issues.

Julow added a commit to Julow/opam-repository that referenced this pull request Nov 4, 2019
CHANGES:

#### Changes

  + Set "conventional" as the default profile (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#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` (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#1111) (Guillaume Petiot)
  + Add a message when a config value is removed (ocaml-ppx/ocamlformat#1089) (Etienne Millon)
    Explain what replaces removed options and avoid printing a parsing error.
  + Implement `sequence-blank-line=preserve-one` for let bindings (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#1018) (Guillaume Petiot)
  + Parse code in docstrings (ocaml-ppx/ocamlformat#941) (Guillaume Petiot)
    Format OCaml code in cinaps-style comments `(*$ code *)` and code blocks in documentation comments `(** {[ code ]} *)`.
  + Parse documentation comments with Odoc (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#1093) (Guillaume Petiot)
  + Fix the default value documentation for `max-indent` (ocaml-ppx/ocamlformat#1105) (Guillaume Petiot)
  + Fix closing parenthesis exceeding the margin in function application (ocaml-ppx/ocamlformat#1098) (Jules Aguillon)
  + Missing break before attributes of `Pmty_with` (ocaml-ppx/ocamlformat#1103) (Josh Berdine)
  + Fix closing quote exceeding the margin (ocaml-ppx/ocamlformat#1096) (Jules Aguillon)
  + Fix break before the closing bracket of collections (exceeding the margin) (ocaml-ppx/ocamlformat#1073) (Guillaume Petiot)
  + Fix precedence of Dot wrt Hash (ocaml-ppx/ocamlformat#1058) (Guillaume Petiot)
  + Fix break in variant type definition to not exceed the margin (ocaml-ppx/ocamlformat#1064) (Guillaume Petiot)
  + Fix newlines and indentation in toplevel extension points (ocaml-ppx/ocamlformat#1054) (Guillaume Petiot)
  + Fix placement of doc comments around extensions (ocaml-ppx/ocamlformat#1052) (Jules Aguillon)
  + Inline extensions that do not break (ocaml-ppx/ocamlformat#1050) (Guillaume Petiot)
  + Add missing cut before attributes in type declarations (ocaml-ppx/ocamlformat#1051) (Guillaume Petiot)
  + Fix alignment of cases (ocaml-ppx/ocamlformat#1046) (Guillaume Petiot)
  + Fix blank line after comments at the end of lists (ocaml-ppx/ocamlformat#1045) (Guillaume Petiot)
  + Fix indexing operators precedence (ocaml-ppx/ocamlformat#1039) (Jules Aguillon)
  + Fix dropped comment after infix op (ocaml-ppx/ocamlformat#1030) (Guillaume Petiot)
  + No newline if the input is empty (ocaml-ppx/ocamlformat#1031) (Guillaume Petiot)
  + Fix unstable comments around attributes (ocaml-ppx/ocamlformat#1029) (Guillaume Petiot)
  + Fix extra blank line in sequence (ocaml-ppx/ocamlformat#1021) (Jules Aguillon)
  + Check functor arguments when computing placement of doc comments (ocaml-ppx/ocamlformat#1013) (Jules Aguillon)
  + Fix indentation of labelled args (ocaml-ppx/ocamlformat#1006) (Guillaume Petiot)
  + Fix linebreak between or-cases with comments when `break-cases=all` (ocaml-ppx/ocamlformat#1002) (Guillaume Petiot)
  + Fix unstable unattached doc comment in records (ocaml-ppx/ocamlformat#998) (Jules Aguillon)
  + Fix string literal changed (ocaml-ppx/ocamlformat#995) (Jules Aguillon)
  + Fix type variable (ocaml-ppx/ocamlformat#996) (Jules Aguillon)
  + Fix crash on extension sequence (ocaml-ppx/ocamlformat#992) (Guillaume Petiot)
  + Fix position of expressions regarding of comments in infix-op expressions (ocaml-ppx/ocamlformat#986) (Guillaume Petiot)
  + Escape special characters in external declaration (ocaml-ppx/ocamlformat#988) (Jules Aguillon)
  + Fix parens around constrained expr with attrs (ocaml-ppx/ocamlformat#987) (Guillaume Petiot)
  + Fix the margin, and correctly breaks comments (ocaml-ppx/ocamlformat#957) (Guillaume Petiot)
  + Fix formatting of custom indexing operators (ocaml-ppx/ocamlformat#975) (Guillaume Petiot)
  + Fix position of comments of labelled arrow types (ocaml-ppx/ocamlformat#976) (Guillaume Petiot)
  + No box around inline odoc styles (ocaml-ppx/ocamlformat#971) (Guillaume Petiot)
  + Fix boxing of collection expressions/patterns (ocaml-ppx/ocamlformat#960) (Guillaume Petiot)
  + Fix crash on record expr with pack fields (ocaml-ppx/ocamlformat#963) (Jules Aguillon)
  + Fix letop in subexpr (ocaml-ppx/ocamlformat#956) (hhugo)

#### Internal

  + Take file kind from --name when formatting stdin (ocaml-ppx/ocamlformat#1119) (Jules Aguillon)
  + Make Fmt.t abstract (ocaml-ppx/ocamlformat#1109) (Jules Aguillon)
  + Future-proof Fmt API in case Fmt.t goes abstract (ocaml-ppx/ocamlformat#1106) (Etienne Millon)
  + Future-proof `Fmt` API in case `Fmt.t` goes abstract (ocaml-ppx/ocamlformat#1106) (Etienne Millon)
  + Optional names for formatting boxes in debug output (ocaml-ppx/ocamlformat#1083) (Guillaume Petiot)
  + Check ocamlformat error codes in the testsuite (ocaml-ppx/ocamlformat#1084) (Etienne Millon)
  + Clean `Translation_unit` (ocaml-ppx/ocamlformat#1078) (Guillaume Petiot)
  + Use dune file generation in test/passing/dune (ocaml-ppx/ocamlformat#1082) (Etienne Millon)
  + CI: factorize tests and check reason build (ocaml-ppx/ocamlformat#1079) (Guillaume Petiot)
  + Use short form for action in src/dune (ocaml-ppx/ocamlformat#1076) (Etienne Millon)
  + Cleanup `sequence_blank_line` (ocaml-ppx/ocamlformat#1075) (Jules Aguillon)
  + CI: use a script travis-ci.sh to simplify .travis.yml (ocaml-ppx/ocamlformat#1063) (Guillaume Petiot)
  + Remove utility functions from `Fmt_ast` (ocaml-ppx/ocamlformat#1059) (Guillaume Petiot)
  + CI: use opam-2.0.5 in Travis (ocaml-ppx/ocamlformat#1044) (Anton Kochkov)
  + CI: check the build with OCaml 4.07.1 and 4.08.0 (ocaml-ppx/ocamlformat#1036) (Jules Aguillon)
  + Use the same sets of options for both branches by default in `test_branch.sh` (ocaml-ppx/ocamlformat#1033) (Guillaume Petiot)
  + Fix `test_branch.sh` and CI checking of CHANGES.md (ocaml-ppx/ocamlformat#1032, ocaml-ppx/ocamlformat#1034) (Jules Aguillon)
  + Fix flag of git-worktree in `test_branch.sh` and `bisect.sh` (ocaml-ppx/ocamlformat#1027) (Guillaume Petiot)
  + Remove the `bisect_ppx` dependency and clean the `Makefile` (ocaml-ppx/ocamlformat#1005) (Jules Aguillon)
  + Use a `CHANGES.md` log file again (ocaml-ppx/ocamlformat#1023) (Guillaume Petiot)
  + Support OCaml 4.09.0 (add the odoc.1.4.2 dependency) (ocaml-ppx/ocamlformat#1024) (Guillaume Petiot)
  + Update labels of issue templates (ocaml-ppx/ocamlformat#1017) (Guillaume Petiot)
  + Update labels in `CONTRIBUTING.md` (ocaml-ppx/ocamlformat#1007) (Guillaume Petiot)
  + Allow to ignore invalid options (ocaml-ppx/ocamlformat#984) (hhugo)
    The `--ignore-invalid-option` flag is added to ignore invalid options in `.ocamlformat` files.
  + Improve the documentation of `--doc-comments` (ocaml-ppx/ocamlformat#982) (Jules Aguillon)
  + Remove symbolic links and change naming convention of tests (ocaml-ppx/ocamlformat#980) (Guillaume Petiot)
  + Change the type of `fmt_code` (ocaml-ppx/ocamlformat#974) (Guillaume Petiot)
  + Simplify `Makefile` (ocaml-ppx/ocamlformat#973) (hhugo)
  + Dune should not be flagged as a build dep anymore (ocaml-ppx/ocamlformat#954) (Guillaume Petiot)
Julow added a commit to Julow/opam-repository that referenced this pull request Nov 4, 2019
CHANGES:

#### Changes

  + Set "conventional" as the default profile (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#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` (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#1111) (Guillaume Petiot)
  + Add a message when a config value is removed (ocaml-ppx/ocamlformat#1089) (Etienne Millon)
    Explain what replaces removed options and avoid printing a parsing error.
  + Implement `sequence-blank-line=preserve-one` for let bindings (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#1018) (Guillaume Petiot)
  + Parse code in docstrings (ocaml-ppx/ocamlformat#941) (Guillaume Petiot)
    Format OCaml code in cinaps-style comments `(*$ code *)` and code blocks in documentation comments `(** {[ code ]} *)`.
  + Parse documentation comments with Odoc (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#1093) (Guillaume Petiot)
  + Fix the default value documentation for `max-indent` (ocaml-ppx/ocamlformat#1105) (Guillaume Petiot)
  + Fix closing parenthesis exceeding the margin in function application (ocaml-ppx/ocamlformat#1098) (Jules Aguillon)
  + Missing break before attributes of `Pmty_with` (ocaml-ppx/ocamlformat#1103) (Josh Berdine)
  + Fix closing quote exceeding the margin (ocaml-ppx/ocamlformat#1096) (Jules Aguillon)
  + Fix break before the closing bracket of collections (exceeding the margin) (ocaml-ppx/ocamlformat#1073) (Guillaume Petiot)
  + Fix precedence of Dot wrt Hash (ocaml-ppx/ocamlformat#1058) (Guillaume Petiot)
  + Fix break in variant type definition to not exceed the margin (ocaml-ppx/ocamlformat#1064) (Guillaume Petiot)
  + Fix newlines and indentation in toplevel extension points (ocaml-ppx/ocamlformat#1054) (Guillaume Petiot)
  + Fix placement of doc comments around extensions (ocaml-ppx/ocamlformat#1052) (Jules Aguillon)
  + Inline extensions that do not break (ocaml-ppx/ocamlformat#1050) (Guillaume Petiot)
  + Add missing cut before attributes in type declarations (ocaml-ppx/ocamlformat#1051) (Guillaume Petiot)
  + Fix alignment of cases (ocaml-ppx/ocamlformat#1046) (Guillaume Petiot)
  + Fix blank line after comments at the end of lists (ocaml-ppx/ocamlformat#1045) (Guillaume Petiot)
  + Fix indexing operators precedence (ocaml-ppx/ocamlformat#1039) (Jules Aguillon)
  + Fix dropped comment after infix op (ocaml-ppx/ocamlformat#1030) (Guillaume Petiot)
  + No newline if the input is empty (ocaml-ppx/ocamlformat#1031) (Guillaume Petiot)
  + Fix unstable comments around attributes (ocaml-ppx/ocamlformat#1029) (Guillaume Petiot)
  + Fix extra blank line in sequence (ocaml-ppx/ocamlformat#1021) (Jules Aguillon)
  + Check functor arguments when computing placement of doc comments (ocaml-ppx/ocamlformat#1013) (Jules Aguillon)
  + Fix indentation of labelled args (ocaml-ppx/ocamlformat#1006) (Guillaume Petiot)
  + Fix linebreak between or-cases with comments when `break-cases=all` (ocaml-ppx/ocamlformat#1002) (Guillaume Petiot)
  + Fix unstable unattached doc comment in records (ocaml-ppx/ocamlformat#998) (Jules Aguillon)
  + Fix string literal changed (ocaml-ppx/ocamlformat#995) (Jules Aguillon)
  + Fix type variable (ocaml-ppx/ocamlformat#996) (Jules Aguillon)
  + Fix crash on extension sequence (ocaml-ppx/ocamlformat#992) (Guillaume Petiot)
  + Fix position of expressions regarding of comments in infix-op expressions (ocaml-ppx/ocamlformat#986) (Guillaume Petiot)
  + Escape special characters in external declaration (ocaml-ppx/ocamlformat#988) (Jules Aguillon)
  + Fix parens around constrained expr with attrs (ocaml-ppx/ocamlformat#987) (Guillaume Petiot)
  + Fix the margin, and correctly breaks comments (ocaml-ppx/ocamlformat#957) (Guillaume Petiot)
  + Fix formatting of custom indexing operators (ocaml-ppx/ocamlformat#975) (Guillaume Petiot)
  + Fix position of comments of labelled arrow types (ocaml-ppx/ocamlformat#976) (Guillaume Petiot)
  + No box around inline odoc styles (ocaml-ppx/ocamlformat#971) (Guillaume Petiot)
  + Fix boxing of collection expressions/patterns (ocaml-ppx/ocamlformat#960) (Guillaume Petiot)
  + Fix crash on record expr with pack fields (ocaml-ppx/ocamlformat#963) (Jules Aguillon)
  + Fix letop in subexpr (ocaml-ppx/ocamlformat#956) (hhugo)

#### Internal

  + Take file kind from --name when formatting stdin (ocaml-ppx/ocamlformat#1119) (Jules Aguillon)
  + Make Fmt.t abstract (ocaml-ppx/ocamlformat#1109) (Jules Aguillon)
  + Future-proof Fmt API in case Fmt.t goes abstract (ocaml-ppx/ocamlformat#1106) (Etienne Millon)
  + Future-proof `Fmt` API in case `Fmt.t` goes abstract (ocaml-ppx/ocamlformat#1106) (Etienne Millon)
  + Optional names for formatting boxes in debug output (ocaml-ppx/ocamlformat#1083) (Guillaume Petiot)
  + Check ocamlformat error codes in the testsuite (ocaml-ppx/ocamlformat#1084) (Etienne Millon)
  + Clean `Translation_unit` (ocaml-ppx/ocamlformat#1078) (Guillaume Petiot)
  + Use dune file generation in test/passing/dune (ocaml-ppx/ocamlformat#1082) (Etienne Millon)
  + CI: factorize tests and check reason build (ocaml-ppx/ocamlformat#1079) (Guillaume Petiot)
  + Use short form for action in src/dune (ocaml-ppx/ocamlformat#1076) (Etienne Millon)
  + Cleanup `sequence_blank_line` (ocaml-ppx/ocamlformat#1075) (Jules Aguillon)
  + CI: use a script travis-ci.sh to simplify .travis.yml (ocaml-ppx/ocamlformat#1063) (Guillaume Petiot)
  + Remove utility functions from `Fmt_ast` (ocaml-ppx/ocamlformat#1059) (Guillaume Petiot)
  + CI: use opam-2.0.5 in Travis (ocaml-ppx/ocamlformat#1044) (Anton Kochkov)
  + CI: check the build with OCaml 4.07.1 and 4.08.0 (ocaml-ppx/ocamlformat#1036) (Jules Aguillon)
  + Use the same sets of options for both branches by default in `test_branch.sh` (ocaml-ppx/ocamlformat#1033) (Guillaume Petiot)
  + Fix `test_branch.sh` and CI checking of CHANGES.md (ocaml-ppx/ocamlformat#1032, ocaml-ppx/ocamlformat#1034) (Jules Aguillon)
  + Fix flag of git-worktree in `test_branch.sh` and `bisect.sh` (ocaml-ppx/ocamlformat#1027) (Guillaume Petiot)
  + Remove the `bisect_ppx` dependency and clean the `Makefile` (ocaml-ppx/ocamlformat#1005) (Jules Aguillon)
  + Use a `CHANGES.md` log file again (ocaml-ppx/ocamlformat#1023) (Guillaume Petiot)
  + Support OCaml 4.09.0 (add the odoc.1.4.2 dependency) (ocaml-ppx/ocamlformat#1024) (Guillaume Petiot)
  + Update labels of issue templates (ocaml-ppx/ocamlformat#1017) (Guillaume Petiot)
  + Update labels in `CONTRIBUTING.md` (ocaml-ppx/ocamlformat#1007) (Guillaume Petiot)
  + Allow to ignore invalid options (ocaml-ppx/ocamlformat#984) (hhugo)
    The `--ignore-invalid-option` flag is added to ignore invalid options in `.ocamlformat` files.
  + Improve the documentation of `--doc-comments` (ocaml-ppx/ocamlformat#982) (Jules Aguillon)
  + Remove symbolic links and change naming convention of tests (ocaml-ppx/ocamlformat#980) (Guillaume Petiot)
  + Change the type of `fmt_code` (ocaml-ppx/ocamlformat#974) (Guillaume Petiot)
  + Simplify `Makefile` (ocaml-ppx/ocamlformat#973) (hhugo)
  + Dune should not be flagged as a build dep anymore (ocaml-ppx/ocamlformat#954) (Guillaume Petiot)
Julow added a commit to Julow/opam-repository that referenced this pull request Nov 4, 2019
CHANGES:

#### Changes

  + Set "conventional" as the default profile (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#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` (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#1111) (Guillaume Petiot)
  + Add a message when a config value is removed (ocaml-ppx/ocamlformat#1089) (Etienne Millon)
    Explain what replaces removed options and avoid printing a parsing error.
  + Implement `sequence-blank-line=preserve-one` for let bindings (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#1018) (Guillaume Petiot)
  + Parse code in docstrings (ocaml-ppx/ocamlformat#941) (Guillaume Petiot)
    Format OCaml code in cinaps-style comments `(*$ code *)` and code blocks in documentation comments `(** {[ code ]} *)`.
  + Parse documentation comments with Odoc (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#1093) (Guillaume Petiot)
  + Fix the default value documentation for `max-indent` (ocaml-ppx/ocamlformat#1105) (Guillaume Petiot)
  + Fix closing parenthesis exceeding the margin in function application (ocaml-ppx/ocamlformat#1098) (Jules Aguillon)
  + Missing break before attributes of `Pmty_with` (ocaml-ppx/ocamlformat#1103) (Josh Berdine)
  + Fix closing quote exceeding the margin (ocaml-ppx/ocamlformat#1096) (Jules Aguillon)
  + Fix break before the closing bracket of collections (exceeding the margin) (ocaml-ppx/ocamlformat#1073) (Guillaume Petiot)
  + Fix precedence of Dot wrt Hash (ocaml-ppx/ocamlformat#1058) (Guillaume Petiot)
  + Fix break in variant type definition to not exceed the margin (ocaml-ppx/ocamlformat#1064) (Guillaume Petiot)
  + Fix newlines and indentation in toplevel extension points (ocaml-ppx/ocamlformat#1054) (Guillaume Petiot)
  + Fix placement of doc comments around extensions (ocaml-ppx/ocamlformat#1052) (Jules Aguillon)
  + Inline extensions that do not break (ocaml-ppx/ocamlformat#1050) (Guillaume Petiot)
  + Add missing cut before attributes in type declarations (ocaml-ppx/ocamlformat#1051) (Guillaume Petiot)
  + Fix alignment of cases (ocaml-ppx/ocamlformat#1046) (Guillaume Petiot)
  + Fix blank line after comments at the end of lists (ocaml-ppx/ocamlformat#1045) (Guillaume Petiot)
  + Fix indexing operators precedence (ocaml-ppx/ocamlformat#1039) (Jules Aguillon)
  + Fix dropped comment after infix op (ocaml-ppx/ocamlformat#1030) (Guillaume Petiot)
  + No newline if the input is empty (ocaml-ppx/ocamlformat#1031) (Guillaume Petiot)
  + Fix unstable comments around attributes (ocaml-ppx/ocamlformat#1029) (Guillaume Petiot)
  + Fix extra blank line in sequence (ocaml-ppx/ocamlformat#1021) (Jules Aguillon)
  + Check functor arguments when computing placement of doc comments (ocaml-ppx/ocamlformat#1013) (Jules Aguillon)
  + Fix indentation of labelled args (ocaml-ppx/ocamlformat#1006) (Guillaume Petiot)
  + Fix linebreak between or-cases with comments when `break-cases=all` (ocaml-ppx/ocamlformat#1002) (Guillaume Petiot)
  + Fix unstable unattached doc comment in records (ocaml-ppx/ocamlformat#998) (Jules Aguillon)
  + Fix string literal changed (ocaml-ppx/ocamlformat#995) (Jules Aguillon)
  + Fix type variable (ocaml-ppx/ocamlformat#996) (Jules Aguillon)
  + Fix crash on extension sequence (ocaml-ppx/ocamlformat#992) (Guillaume Petiot)
  + Fix position of expressions regarding of comments in infix-op expressions (ocaml-ppx/ocamlformat#986) (Guillaume Petiot)
  + Escape special characters in external declaration (ocaml-ppx/ocamlformat#988) (Jules Aguillon)
  + Fix parens around constrained expr with attrs (ocaml-ppx/ocamlformat#987) (Guillaume Petiot)
  + Fix the margin, and correctly breaks comments (ocaml-ppx/ocamlformat#957) (Guillaume Petiot)
  + Fix formatting of custom indexing operators (ocaml-ppx/ocamlformat#975) (Guillaume Petiot)
  + Fix position of comments of labelled arrow types (ocaml-ppx/ocamlformat#976) (Guillaume Petiot)
  + No box around inline odoc styles (ocaml-ppx/ocamlformat#971) (Guillaume Petiot)
  + Fix boxing of collection expressions/patterns (ocaml-ppx/ocamlformat#960) (Guillaume Petiot)
  + Fix crash on record expr with pack fields (ocaml-ppx/ocamlformat#963) (Jules Aguillon)
  + Fix letop in subexpr (ocaml-ppx/ocamlformat#956) (hhugo)

#### Internal

  + Take file kind from --name when formatting stdin (ocaml-ppx/ocamlformat#1119) (Jules Aguillon)
  + Make Fmt.t abstract (ocaml-ppx/ocamlformat#1109) (Jules Aguillon)
  + Future-proof Fmt API in case Fmt.t goes abstract (ocaml-ppx/ocamlformat#1106) (Etienne Millon)
  + Future-proof `Fmt` API in case `Fmt.t` goes abstract (ocaml-ppx/ocamlformat#1106) (Etienne Millon)
  + Optional names for formatting boxes in debug output (ocaml-ppx/ocamlformat#1083) (Guillaume Petiot)
  + Check ocamlformat error codes in the testsuite (ocaml-ppx/ocamlformat#1084) (Etienne Millon)
  + Clean `Translation_unit` (ocaml-ppx/ocamlformat#1078) (Guillaume Petiot)
  + Use dune file generation in test/passing/dune (ocaml-ppx/ocamlformat#1082) (Etienne Millon)
  + CI: factorize tests and check reason build (ocaml-ppx/ocamlformat#1079) (Guillaume Petiot)
  + Use short form for action in src/dune (ocaml-ppx/ocamlformat#1076) (Etienne Millon)
  + Cleanup `sequence_blank_line` (ocaml-ppx/ocamlformat#1075) (Jules Aguillon)
  + CI: use a script travis-ci.sh to simplify .travis.yml (ocaml-ppx/ocamlformat#1063) (Guillaume Petiot)
  + Remove utility functions from `Fmt_ast` (ocaml-ppx/ocamlformat#1059) (Guillaume Petiot)
  + CI: use opam-2.0.5 in Travis (ocaml-ppx/ocamlformat#1044) (Anton Kochkov)
  + CI: check the build with OCaml 4.07.1 and 4.08.0 (ocaml-ppx/ocamlformat#1036) (Jules Aguillon)
  + Use the same sets of options for both branches by default in `test_branch.sh` (ocaml-ppx/ocamlformat#1033) (Guillaume Petiot)
  + Fix `test_branch.sh` and CI checking of CHANGES.md (ocaml-ppx/ocamlformat#1032, ocaml-ppx/ocamlformat#1034) (Jules Aguillon)
  + Fix flag of git-worktree in `test_branch.sh` and `bisect.sh` (ocaml-ppx/ocamlformat#1027) (Guillaume Petiot)
  + Remove the `bisect_ppx` dependency and clean the `Makefile` (ocaml-ppx/ocamlformat#1005) (Jules Aguillon)
  + Use a `CHANGES.md` log file again (ocaml-ppx/ocamlformat#1023) (Guillaume Petiot)
  + Support OCaml 4.09.0 (add the odoc.1.4.2 dependency) (ocaml-ppx/ocamlformat#1024) (Guillaume Petiot)
  + Update labels of issue templates (ocaml-ppx/ocamlformat#1017) (Guillaume Petiot)
  + Update labels in `CONTRIBUTING.md` (ocaml-ppx/ocamlformat#1007) (Guillaume Petiot)
  + Allow to ignore invalid options (ocaml-ppx/ocamlformat#984) (hhugo)
    The `--ignore-invalid-option` flag is added to ignore invalid options in `.ocamlformat` files.
  + Improve the documentation of `--doc-comments` (ocaml-ppx/ocamlformat#982) (Jules Aguillon)
  + Remove symbolic links and change naming convention of tests (ocaml-ppx/ocamlformat#980) (Guillaume Petiot)
  + Change the type of `fmt_code` (ocaml-ppx/ocamlformat#974) (Guillaume Petiot)
  + Simplify `Makefile` (ocaml-ppx/ocamlformat#973) (hhugo)
  + Dune should not be flagged as a build dep anymore (ocaml-ppx/ocamlformat#954) (Guillaume Petiot)
Julow added a commit to Julow/opam-repository that referenced this pull request Nov 4, 2019
CHANGES:

#### Changes

  + Set "conventional" as the default profile (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#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` (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#1111) (Guillaume Petiot)
  + Add a message when a config value is removed (ocaml-ppx/ocamlformat#1089) (Etienne Millon)
    Explain what replaces removed options and avoid printing a parsing error.
  + Implement `sequence-blank-line=preserve-one` for let bindings (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#1018) (Guillaume Petiot)
  + Parse code in docstrings (ocaml-ppx/ocamlformat#941) (Guillaume Petiot)
    Format OCaml code in cinaps-style comments `(*$ code *)` and code blocks in documentation comments `(** {[ code ]} *)`.
  + Parse documentation comments with Odoc (ocaml-ppx/ocamlformat#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 (ocaml-ppx/ocamlformat#1093) (Guillaume Petiot)
  + Fix the default value documentation for `max-indent` (ocaml-ppx/ocamlformat#1105) (Guillaume Petiot)
  + Fix closing parenthesis exceeding the margin in function application (ocaml-ppx/ocamlformat#1098) (Jules Aguillon)
  + Missing break before attributes of `Pmty_with` (ocaml-ppx/ocamlformat#1103) (Josh Berdine)
  + Fix closing quote exceeding the margin (ocaml-ppx/ocamlformat#1096) (Jules Aguillon)
  + Fix break before the closing bracket of collections (exceeding the margin) (ocaml-ppx/ocamlformat#1073) (Guillaume Petiot)
  + Fix precedence of Dot wrt Hash (ocaml-ppx/ocamlformat#1058) (Guillaume Petiot)
  + Fix break in variant type definition to not exceed the margin (ocaml-ppx/ocamlformat#1064) (Guillaume Petiot)
  + Fix newlines and indentation in toplevel extension points (ocaml-ppx/ocamlformat#1054) (Guillaume Petiot)
  + Fix placement of doc comments around extensions (ocaml-ppx/ocamlformat#1052) (Jules Aguillon)
  + Inline extensions that do not break (ocaml-ppx/ocamlformat#1050) (Guillaume Petiot)
  + Add missing cut before attributes in type declarations (ocaml-ppx/ocamlformat#1051) (Guillaume Petiot)
  + Fix alignment of cases (ocaml-ppx/ocamlformat#1046) (Guillaume Petiot)
  + Fix blank line after comments at the end of lists (ocaml-ppx/ocamlformat#1045) (Guillaume Petiot)
  + Fix indexing operators precedence (ocaml-ppx/ocamlformat#1039) (Jules Aguillon)
  + Fix dropped comment after infix op (ocaml-ppx/ocamlformat#1030) (Guillaume Petiot)
  + No newline if the input is empty (ocaml-ppx/ocamlformat#1031) (Guillaume Petiot)
  + Fix unstable comments around attributes (ocaml-ppx/ocamlformat#1029) (Guillaume Petiot)
  + Fix extra blank line in sequence (ocaml-ppx/ocamlformat#1021) (Jules Aguillon)
  + Check functor arguments when computing placement of doc comments (ocaml-ppx/ocamlformat#1013) (Jules Aguillon)
  + Fix indentation of labelled args (ocaml-ppx/ocamlformat#1006) (Guillaume Petiot)
  + Fix linebreak between or-cases with comments when `break-cases=all` (ocaml-ppx/ocamlformat#1002) (Guillaume Petiot)
  + Fix unstable unattached doc comment in records (ocaml-ppx/ocamlformat#998) (Jules Aguillon)
  + Fix string literal changed (ocaml-ppx/ocamlformat#995) (Jules Aguillon)
  + Fix type variable (ocaml-ppx/ocamlformat#996) (Jules Aguillon)
  + Fix crash on extension sequence (ocaml-ppx/ocamlformat#992) (Guillaume Petiot)
  + Fix position of expressions regarding of comments in infix-op expressions (ocaml-ppx/ocamlformat#986) (Guillaume Petiot)
  + Escape special characters in external declaration (ocaml-ppx/ocamlformat#988) (Jules Aguillon)
  + Fix parens around constrained expr with attrs (ocaml-ppx/ocamlformat#987) (Guillaume Petiot)
  + Fix the margin, and correctly breaks comments (ocaml-ppx/ocamlformat#957) (Guillaume Petiot)
  + Fix formatting of custom indexing operators (ocaml-ppx/ocamlformat#975) (Guillaume Petiot)
  + Fix position of comments of labelled arrow types (ocaml-ppx/ocamlformat#976) (Guillaume Petiot)
  + No box around inline odoc styles (ocaml-ppx/ocamlformat#971) (Guillaume Petiot)
  + Fix boxing of collection expressions/patterns (ocaml-ppx/ocamlformat#960) (Guillaume Petiot)
  + Fix crash on record expr with pack fields (ocaml-ppx/ocamlformat#963) (Jules Aguillon)
  + Fix letop in subexpr (ocaml-ppx/ocamlformat#956) (hhugo)

#### Internal

  + Take file kind from --name when formatting stdin (ocaml-ppx/ocamlformat#1119) (Jules Aguillon)
  + Make Fmt.t abstract (ocaml-ppx/ocamlformat#1109) (Jules Aguillon)
  + Future-proof Fmt API in case Fmt.t goes abstract (ocaml-ppx/ocamlformat#1106) (Etienne Millon)
  + Future-proof `Fmt` API in case `Fmt.t` goes abstract (ocaml-ppx/ocamlformat#1106) (Etienne Millon)
  + Optional names for formatting boxes in debug output (ocaml-ppx/ocamlformat#1083) (Guillaume Petiot)
  + Check ocamlformat error codes in the testsuite (ocaml-ppx/ocamlformat#1084) (Etienne Millon)
  + Clean `Translation_unit` (ocaml-ppx/ocamlformat#1078) (Guillaume Petiot)
  + Use dune file generation in test/passing/dune (ocaml-ppx/ocamlformat#1082) (Etienne Millon)
  + CI: factorize tests and check reason build (ocaml-ppx/ocamlformat#1079) (Guillaume Petiot)
  + Use short form for action in src/dune (ocaml-ppx/ocamlformat#1076) (Etienne Millon)
  + Cleanup `sequence_blank_line` (ocaml-ppx/ocamlformat#1075) (Jules Aguillon)
  + CI: use a script travis-ci.sh to simplify .travis.yml (ocaml-ppx/ocamlformat#1063) (Guillaume Petiot)
  + Remove utility functions from `Fmt_ast` (ocaml-ppx/ocamlformat#1059) (Guillaume Petiot)
  + CI: use opam-2.0.5 in Travis (ocaml-ppx/ocamlformat#1044) (Anton Kochkov)
  + CI: check the build with OCaml 4.07.1 and 4.08.0 (ocaml-ppx/ocamlformat#1036) (Jules Aguillon)
  + Use the same sets of options for both branches by default in `test_branch.sh` (ocaml-ppx/ocamlformat#1033) (Guillaume Petiot)
  + Fix `test_branch.sh` and CI checking of CHANGES.md (ocaml-ppx/ocamlformat#1032, ocaml-ppx/ocamlformat#1034) (Jules Aguillon)
  + Fix flag of git-worktree in `test_branch.sh` and `bisect.sh` (ocaml-ppx/ocamlformat#1027) (Guillaume Petiot)
  + Remove the `bisect_ppx` dependency and clean the `Makefile` (ocaml-ppx/ocamlformat#1005) (Jules Aguillon)
  + Use a `CHANGES.md` log file again (ocaml-ppx/ocamlformat#1023) (Guillaume Petiot)
  + Support OCaml 4.09.0 (add the odoc.1.4.2 dependency) (ocaml-ppx/ocamlformat#1024) (Guillaume Petiot)
  + Update labels of issue templates (ocaml-ppx/ocamlformat#1017) (Guillaume Petiot)
  + Update labels in `CONTRIBUTING.md` (ocaml-ppx/ocamlformat#1007) (Guillaume Petiot)
  + Allow to ignore invalid options (ocaml-ppx/ocamlformat#984) (hhugo)
    The `--ignore-invalid-option` flag is added to ignore invalid options in `.ocamlformat` files.
  + Improve the documentation of `--doc-comments` (ocaml-ppx/ocamlformat#982) (Jules Aguillon)
  + Remove symbolic links and change naming convention of tests (ocaml-ppx/ocamlformat#980) (Guillaume Petiot)
  + Change the type of `fmt_code` (ocaml-ppx/ocamlformat#974) (Guillaume Petiot)
  + Simplify `Makefile` (ocaml-ppx/ocamlformat#973) (hhugo)
  + Dune should not be flagged as a build dep anymore (ocaml-ppx/ocamlformat#954) (Guillaume Petiot)
@jberdine
Copy link
Collaborator

jberdine commented Nov 4, 2019

@Julow thanks, I didn't know about opam switch link. But especially for testing, when the config is not checked in, it is hard to make it reproducible across developers and across time, e.g. while bisecting.

@emillon, with dune-workspace.dev, do you mean basically to add back the dune-workspace file removed by this PR, but to add .dev?

@emillon
Copy link
Collaborator

emillon commented Nov 12, 2019

@jberdine yes, something like that (I'm not familiar with the context of this PR or how the file was generated)

bogdan2412 pushed a commit to bogdan2412/ocamlformat that referenced this pull request Mar 28, 2020
…px#1005)

* Cleanup Makefile

Remove `dune-workspace` generation
Don't use paths to `_build`
Remove bisect support
Remove plugin code from dune file

* Cleanup .gitignore

* Don't build whole package

* test-extra: Remove unused code

* test_branch: Use temporary worktree

* Add -noassert in release mode

* Remove dependency to bisect_ppx

* Add placeholder for bisect ppx

* Add tools/bisect.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants