From da0cde5f432b8c4ae0db4a6ffecea66ab769a402 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Tue, 10 Sep 2024 11:38:29 +0200 Subject: [PATCH 01/10] Add ocamlformat as dev-setup dependency Signed-off-by: Mathieu Barbin --- dune-project | 6 +++++- pp.opam | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dune-project b/dune-project index f5da950..150cab5 100644 --- a/dune-project +++ b/dune-project @@ -15,7 +15,11 @@ (name pp) (depends (ocaml (>= 4.08.0)) - (ppx_expect :with-test)) + (ppx_expect :with-test) + (ocamlformat + (and + :with-dev-setup + (= 0.26.0)))) (synopsis "Pretty-printing library") (description " This library provides a lean alternative to the Format [1] module of diff --git a/pp.opam b/pp.opam index bb6d2f7..d720080 100644 --- a/pp.opam +++ b/pp.opam @@ -32,6 +32,7 @@ depends: [ "dune" {>= "2.8"} "ocaml" {>= "4.08.0"} "ppx_expect" {with-test} + "ocamlformat" {with-dev-setup & = "0.26.0"} "odoc" {with-doc} ] build: [ From bfb5582271079ebe0bbe31f40147292263fb15e1 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Tue, 10 Sep 2024 11:44:04 +0200 Subject: [PATCH 02/10] Add more validation steps in CI - I didn't include `lint-opam` due to issues building `opam-dune-lint`. Left as potential future work. Signed-off-by: Mathieu Barbin --- .github/workflows/ci.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7fc5c1..a9f7305 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,8 +34,20 @@ jobs: with: ocaml-compiler: ${{ matrix.ocaml-compiler }} - - run: opam install . --deps-only --with-test + - name: Install dependencies + run: opam install . --deps-only --with-doc --with-test --with-dev-setup - - run: opam exec -- dune build + - name: Build + run: opam exec -- dune build - - run: opam exec -- dune runtest + - name: Run tests + run: opam exec -- dune runtest + + - name: Check for uncommitted changes + run: git diff --exit-code + + - name: Lint fmt + uses: ocaml/setup-ocaml/lint-fmt@v3 + + - name: Lint doc + uses: ocaml/setup-ocaml/lint-doc@v3 From 8819e6978970f83584938c034a1adf920f90d2ca Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Tue, 10 Sep 2024 11:45:14 +0200 Subject: [PATCH 03/10] Upgrade GitHub workflow actions deps Signed-off-by: Mathieu Barbin --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9f7305..6d80135 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,10 +27,10 @@ jobs: git config --global core.ignorecase false - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Use OCaml ${{ matrix.ocaml-compiler }} - uses: ocaml/setup-ocaml@v2 + uses: ocaml/setup-ocaml@v3 with: ocaml-compiler: ${{ matrix.ocaml-compiler }} From 07eef7421c31cb0ec5840ffd37aa8efd124746c5 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Tue, 10 Sep 2024 11:47:24 +0200 Subject: [PATCH 04/10] Add CI badge to README Signed-off-by: Mathieu Barbin --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 10ac5d9..0f4358f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ Pp - Pretty printing ==================== +[![CI Status](https://github.com/ocaml-dune/pp/workflows/CI/badge.svg)](https://github.com/ocaml-dune/pp/actions/workflows/ci.yml) + This library provides a lean alternative to the [Format][format] module of the OCaml standard library. It aims to make it easy for users to do the right thing. If you have tried `Format` before but From a9a291ddad3f66806fb8c4ff3283f782c0e730df Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Tue, 10 Sep 2024 11:48:31 +0200 Subject: [PATCH 05/10] Fmt Signed-off-by: Mathieu Barbin --- test/tests.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/tests.ml b/test/tests.ml index 248f990..10080cd 100644 --- a/test/tests.ml +++ b/test/tests.ml @@ -328,5 +328,6 @@ let%expect_test "paragraph" = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum euismod, nisl eget aliquam ultricies. |}] -let%expect_test "paragraphf" = print (Pp.paragraphf "Hello World%s" "!"); +let%expect_test "paragraphf" = + print (Pp.paragraphf "Hello World%s" "!"); [%expect {| Hello World! |}] From 624aa230e0bf3d7eaf1f8059076b433c7dc632c8 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Tue, 10 Sep 2024 12:01:29 +0200 Subject: [PATCH 06/10] Upgrade to ocamlformat.0.26.2 Signed-off-by: Mathieu Barbin --- .ocamlformat | 2 +- dune-project | 2 +- pp.opam | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ocamlformat b/.ocamlformat index 57a795d..f2dc1c8 100644 --- a/.ocamlformat +++ b/.ocamlformat @@ -1,4 +1,4 @@ -version=0.26.0 +version=0.26.2 break-separators=before dock-collection-brackets=false break-sequences=true diff --git a/dune-project b/dune-project index 150cab5..747657e 100644 --- a/dune-project +++ b/dune-project @@ -19,7 +19,7 @@ (ocamlformat (and :with-dev-setup - (= 0.26.0)))) + (= 0.26.2)))) (synopsis "Pretty-printing library") (description " This library provides a lean alternative to the Format [1] module of diff --git a/pp.opam b/pp.opam index d720080..53d6166 100644 --- a/pp.opam +++ b/pp.opam @@ -32,7 +32,7 @@ depends: [ "dune" {>= "2.8"} "ocaml" {>= "4.08.0"} "ppx_expect" {with-test} - "ocamlformat" {with-dev-setup & = "0.26.0"} + "ocamlformat" {with-dev-setup & = "0.26.2"} "odoc" {with-doc} ] build: [ From 9a76ee2b352bbf8ec190e198e05b68dea50389cf Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Tue, 10 Sep 2024 12:16:06 +0200 Subject: [PATCH 07/10] Prepare release notes Signed-off-by: Mathieu Barbin --- CHANGES.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 32e03ff..8ffe6ac 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,13 @@ -Unreleased ----------- +2.0.0 +----- + +- Prepare release (#21, @mbarbin) + - Upgrade to `ocamlformat.0.26.2`. + - Fmt the code + - Add CI badge to README + - Upgrade GitHub workflow actions dependencies (checkout@v4, setup-ocaml@v3) + - Add more validation steps in CI + - Add `ocamlformat` as dev-setup dependency - Add `Pp.verbatimf`. (#18, @mbarbin) From 4a323f11608b667fa937523d5b0fb23fd9b6650b Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Tue, 10 Sep 2024 12:32:47 +0200 Subject: [PATCH 08/10] Add more validations to CI Skip failures (macsos, windows). Signed-off-by: Mathieu Barbin --- .github/workflows/ci.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d80135..ff0cc7d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,8 +14,28 @@ jobs: - ubuntu-latest - windows-latest ocaml-compiler: + - 5.2.x - 4.14.x - - 4.08.x + - 4.13.x + include: + # OCaml 4.12.x: skipping windows (fail) + - ocaml-compiler: 4.12.x + os: ubuntu-latest + - ocaml-compiler: 4.12.x + os: macos-latest + # OCaml 4.11.x: skipping macos & windows (fail) + - ocaml-compiler: 4.11.x + os: ubuntu-latest + # OCaml 4.10.x: skipping windows (fail) + - ocaml-compiler: 4.10.x + os: ubuntu-latest + - ocaml-compiler: 4.10.x + os: macos-latest + # OCaml 4.08.x: skipping macos & windows (fail) + # Keep the minimal version of OCaml in sync in here, `dune-project` + # and `dune-workspace.dev`. + - ocaml-compiler: 4.08.x + os: ubuntu-latest runs-on: ${{ matrix.os }} From 34f647770cedf41aa7f98af02c7cee830cfce587 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Fri, 13 Sep 2024 13:50:01 +0200 Subject: [PATCH 09/10] Simplify ocaml lower bound expression Signed-off-by: Mathieu Barbin --- dune-project | 2 +- pp.opam | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dune-project b/dune-project index 747657e..eba50f3 100644 --- a/dune-project +++ b/dune-project @@ -14,7 +14,7 @@ (package (name pp) (depends - (ocaml (>= 4.08.0)) + (ocaml (>= 4.08)) (ppx_expect :with-test) (ocamlformat (and diff --git a/pp.opam b/pp.opam index 53d6166..197a689 100644 --- a/pp.opam +++ b/pp.opam @@ -30,7 +30,7 @@ doc: "https://ocaml-dune.github.io/pp/" bug-reports: "https://github.com/ocaml-dune/pp/issues" depends: [ "dune" {>= "2.8"} - "ocaml" {>= "4.08.0"} + "ocaml" {>= "4.08"} "ppx_expect" {with-test} "ocamlformat" {with-dev-setup & = "0.26.2"} "odoc" {with-doc} From cd743f8bb6ecddd881705c0e424749ea9b4a499c Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Tue, 10 Sep 2024 12:10:13 +0200 Subject: [PATCH 10/10] Remove unused file Signed-off-by: Mathieu Barbin --- .github/workflows/ci.yml | 3 +-- Makefile | 3 --- dune-workspace.dev | 4 ---- 3 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 dune-workspace.dev diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff0cc7d..f3fd73e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,8 +32,7 @@ jobs: - ocaml-compiler: 4.10.x os: macos-latest # OCaml 4.08.x: skipping macos & windows (fail) - # Keep the minimal version of OCaml in sync in here, `dune-project` - # and `dune-workspace.dev`. + # Keep the minimal version of OCaml in sync in here and `dune-project` - ocaml-compiler: 4.08.x os: ubuntu-latest diff --git a/Makefile b/Makefile index 55f3456..5d1e7fe 100644 --- a/Makefile +++ b/Makefile @@ -17,9 +17,6 @@ reinstall: uninstall install clean: dune clean -all-supported-ocaml-versions: - dune runtest --workspace dune-workspace.dev - release: dune-release tag dune-release distrib --skip-build --skip-lint --skip-tests -n pp diff --git a/dune-workspace.dev b/dune-workspace.dev deleted file mode 100644 index d385721..0000000 --- a/dune-workspace.dev +++ /dev/null @@ -1,4 +0,0 @@ -(lang dune 1.0) - -;; This file is used by `make all-supported-ocaml-versions` -(context (opam (switch 4.04.2)))