Skip to content

Commit 0bfdee6

Browse files
committed
ocamlformat-mlx
1 parent 5bac2e7 commit 0bfdee6

39 files changed

+704
-260
lines changed

.github/workflows/build-linux.yml

Lines changed: 65 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -36,81 +36,82 @@ jobs:
3636
- name: Opam dependencies
3737
run: opam install --deps-only -t .
3838

39-
- name: Format
40-
run: opam exec -- dune fmt
39+
# - name: Format
40+
# run: opam exec -- dune fmt
4141

4242
- name: Build
4343
run: |
4444
opam exec -- dune subst
45-
opam exec -- dune build -p ocamlformat-lib,ocamlformat
45+
opam exec -- dune build -p ocamlformat-mlx-lib,ocamlformat-mlx
4646
4747
- name: Runtest
4848
run: opam exec -- dune runtest
4949

50-
- name: Check manpages
51-
run: opam exec -- dune build @gen_manpage --auto-promote
50+
# - name: Check manpages
51+
# run: opam exec -- dune build @gen_manpage --auto-promote
5252

5353
- name: Upload binary
5454
# Using a specific version because of https://github.com/actions/upload-artifact/issues/590
5555
uses: actions/[email protected]
5656
with:
5757
name: ocamlformat-${{ runner.os }}-${{ runner.arch }}
58-
path: _build/install/default/bin/ocamlformat
59-
60-
test-branch:
61-
if: ${{ github.ref != 'refs/heads/main' }}
62-
needs: build-linux
63-
runs-on: ubuntu-latest
64-
strategy:
65-
matrix:
66-
profile:
67-
- conventional
68-
- ocamlformat
69-
- janestreet
70-
# To enable comparing with ocp-indent:
71-
# include:
72-
# - ocp_indent: true
73-
# ocp_indent_config: JaneStreet
74-
# profile: janestreet
75-
76-
steps:
77-
- name: Install ocp-indent
78-
if: ${{ matrix.ocp_indent }}
79-
run: |
80-
sudo apt install -y ocp-indent
81-
sudo touch /etc/ocamlfind.conf
82-
83-
# Clone the project
84-
- uses: actions/checkout@v3
85-
with:
86-
fetch-depth: 0
87-
88-
- uses: actions/cache@v3
89-
with:
90-
path: test-extra/code
91-
key: test-extra-code
92-
93-
- name: Fetch main build of ocamlformat
94-
uses: dawidd6/action-download-artifact@v6
95-
with:
96-
workflow: build-linux.yml
97-
workflow_conclusion: ""
98-
check_artifacts: true
99-
branch: main
100-
name: ocamlformat-${{ runner.os }}-${{ runner.arch }}
101-
path: ocamlformat-a
102-
103-
- name: Fetch new build of ocamlformat
104-
uses: actions/[email protected]
105-
with:
106-
name: ocamlformat-${{ runner.os }}-${{ runner.arch }}
107-
path: ocamlformat-b
108-
109-
- name: Test ${{ matrix.profile }} profile
110-
run: |
111-
chmod +x ocamlformat-a/ocamlformat ocamlformat-b/ocamlformat
112-
./tools/test_branch.sh $TEST_BRANCH_ARGS -n -a ocamlformat-a/ocamlformat -b ocamlformat-b/ocamlformat 'profile=${{ matrix.profile }}'
113-
shell: bash
114-
env:
115-
OCP_INDENT_CONFIG: ${{ matrix.ocp_indent_config }}
116-
TEST_BRANCH_ARGS: ${{ matrix.ocp_indent && '-o -s' || '' }}
58+
path: _build/install/default/bin/ocamlformat-mlx
59+
60+
# test-branch:
61+
# if: ${{ github.ref != 'refs/heads/main' }}
62+
# needs: build-linux
63+
# runs-on: ubuntu-latest
64+
# strategy:
65+
# matrix:
66+
# profile:
67+
# - conventional
68+
# - ocamlformat
69+
# - janestreet
70+
# # To enable comparing with ocp-indent:
71+
# # include:
72+
# # - ocp_indent: true
73+
# # ocp_indent_config: JaneStreet
74+
# # profile: janestreet
75+
#
76+
# steps:
77+
# - name: Install ocp-indent
78+
# if: ${{ matrix.ocp_indent }}
79+
# run: |
80+
# sudo apt install -y ocp-indent
81+
# sudo touch /etc/ocamlfind.conf
82+
#
83+
# # Clone the project
84+
# - uses: actions/checkout@v3
85+
# with:
86+
# fetch-depth: 0
87+
#
88+
# - uses: actions/cache@v3
89+
# with:
90+
# path: test-extra/code
91+
# key: test-extra-code
92+
#
93+
# - name: Fetch main build of ocamlformat
94+
# uses: dawidd6/action-download-artifact@v6
95+
# with:
96+
# workflow: build-linux.yml
97+
# workflow_conclusion: ""
98+
# check_artifacts: true
99+
# branch: main
100+
# name: ocamlformat-${{ runner.os }}-${{ runner.arch }}
101+
# path: ocamlformat-a
102+
# allow_forks: true
103+
#
104+
# - name: Fetch new build of ocamlformat
105+
# uses: actions/[email protected]
106+
# with:
107+
# name: ocamlformat-${{ runner.os }}-${{ runner.arch }}
108+
# path: ocamlformat-b
109+
#
110+
# - name: Test ${{ matrix.profile }} profile
111+
# run: |
112+
# chmod +x ocamlformat-a/ocamlformat ocamlformat-b/ocamlformat
113+
#./tools/test_branch.sh $TEST_BRANCH_ARGS -n -a ocamlformat-a/ocamlformat -b ocamlformat-b/ocamlformat 'profile=${{ matrix.profile }}'
114+
# shell: bash
115+
# env:
116+
# OCP_INDENT_CONFIG: ${{ matrix.ocp_indent_config }}
117+
# TEST_BRANCH_ARGS: ${{ matrix.ocp_indent && '-o -s' || '' }}

.github/workflows/build-mingw64.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ jobs:
4646
4747
- name: Install dependencies
4848
run: |
49-
opam pin add -yn ocamlformat-lib.dev .
50-
opam pin add -yn ocamlformat.dev .
51-
opam install -y --deps-only ocamlformat
49+
opam pin add -yn ocamlformat-mlx-lib.dev .
50+
opam pin add -yn ocamlformat-mlx.dev .
51+
opam install -y --deps-only ocamlformat-mlx
5252
5353
- name: Build
5454
run: |
5555
opam exec -- dune subst
56-
opam exec -- dune build -p ocamlformat-lib,ocamlformat @install
57-
opam exec -- dune install --prefix=install ocamlformat
58-
Copy-Item ${{ github.workspace }}\\install\\bin\\ocamlformat.exe -Destination .\${{ env.artifact_name }}
56+
opam exec -- dune build -p ocamlformat-mlx-lib,ocamlformat-mlx @install
57+
opam exec -- dune install --prefix=install ocamlformat-mlx
58+
Copy-Item ${{ github.workspace }}\\install\\bin\\ocamlformat-mlx.exe -Destination .\${{ env.artifact_name }}
5959
6060
- name: Version check
6161
run: |
6262
echo "Version check:"
63-
install/bin/ocamlformat.exe --version
63+
install/bin/ocamlformat-mlx.exe --version
6464
6565
- name: Upload Artifact
6666
uses: actions/upload-artifact@v4

.github/workflows/build-others.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ jobs:
4040
- name: Opam dependencies
4141
run: opam install --deps-only -t .
4242

43-
- name: Format
44-
run: opam exec -- dune fmt
43+
# - name: Format
44+
# run: opam exec -- dune fmt
4545

4646
- name: Runtest
4747
run: opam exec -- dune runtest

.github/workflows/changelog-check.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
jobs:
99
Changelog-Entry-Check:
1010
name: Check Changelog Action
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-latest
1212
steps:
1313
- uses: tarides/changelog-check-action@v1
14+
# We don't push changelog entries
15+
# steps:
16+
# - uses: tarides/changelog-check-action@v1

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Items marked with an asterisk (\*) are changes that are likely to format
44
existing code differently from the previous release when using the default
55
profile. This started with version 0.26.0.
66

7+
## 0.27.0.1 (mlx)
8+
- relax OCaml constraints, compatible with OCaml 5.3
9+
710
## 0.27.0
811

912
### Highlight

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ default: exe
1414

1515
.PHONY: exe
1616
exe:
17-
@dune build bin/ocamlformat/main.exe bin/ocamlformat-rpc/main.exe
17+
@dune build bin/ocamlformat/main.exe
1818

1919
.PHONY: clean
2020
clean:

bin/dune

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(data_only_dirs ocamlformat-rpc)

bin/ocamlformat/dune

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@
1111

1212
(executable
1313
(name main)
14-
(public_name ocamlformat)
15-
(package ocamlformat)
14+
(public_name ocamlformat-mlx)
15+
(package ocamlformat-mlx)
1616
(modules main)
1717
(flags
1818
(:standard -open Ocamlformat_stdlib))
1919
(instrumentation
2020
(backend bisect_ppx))
21-
(libraries ocamlformat-lib bin_conf))
21+
(libraries ocamlformat-mlx-lib bin_conf))
2222

2323
(rule
2424
(with-stdout-to
2525
ocamlformat.1
2626
(run ./main.exe --help=groff)))
2727

28-
(install
29-
(section man)
30-
(files ocamlformat.1)
31-
(package ocamlformat))
28+
; (install
29+
; (section man)
30+
; (files ocamlformat.1)
31+
; (package ocamlformat))

dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
(flags
1515
(:standard -noassert))))
1616

17-
(data_only_dirs test-extra)
17+
(data_only_dirs test-extra mlx lib-rpc lib-rpc-server emacs doc bench tools)
1818

1919
(rule
2020
(with-stdout-to

dune-project

Lines changed: 44 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
; ;
1212
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1313

14-
(name ocamlformat)
14+
(name ocamlformat-mlx)
1515

1616
(using menhir 2.1)
1717

@@ -20,25 +20,23 @@
2020
(generate_opam_files true)
2121

2222
(authors
23+
"Andrey Popp <[email protected]>"
2324
"Josh Berdine <[email protected]>"
2425
"Hugo Heuzard <[email protected]>"
2526
"Etienne Millon <[email protected]>"
2627
"Guillaume Petiot <[email protected]>"
2728
"Jules Aguillon <[email protected]>")
2829

29-
(maintainers
30-
"Guillaume Petiot <[email protected]>"
31-
"Jules Aguillon <[email protected]>"
32-
"Emile Trotignon <[email protected]>")
30+
(maintainers "Andrey Popp <[email protected]>")
3331

3432
(source
35-
(github ocaml-ppx/ocamlformat))
33+
(github ocaml-mlx/ocamlformat-mlx))
3634

3735
(package
38-
(name ocamlformat-lib)
39-
(synopsis "OCaml Code Formatter")
36+
(name ocamlformat-mlx-lib)
37+
(synopsis "OCaml .mlx Code Formatter")
4038
(description
41-
"OCamlFormat is a tool to automatically format OCaml code in a uniform style.")
39+
"OCamlFormat is a tool to automatically format OCaml .mlx code in a uniform style.")
4240
(depends
4341
(ocaml
4442
(>= 4.08))
@@ -64,10 +62,6 @@
6462
(>= 20201216))
6563
(ocaml-version
6664
(>= 3.5.0))
67-
(ocamlformat-rpc-lib
68-
(and
69-
:with-test
70-
(= :version)))
7165
(ocp-indent
7266
(or
7367
(and
@@ -88,8 +82,8 @@
8882
camlp-streams))
8983

9084
(package
91-
(name ocamlformat)
92-
(synopsis "Auto-formatter for OCaml code")
85+
(name ocamlformat-mlx)
86+
(synopsis "Auto-formatter for OCaml .mlx code")
9387
(description
9488
"**ocamlformat** is a code formatter for OCaml. It comes with opinionated default settings but is also fully customizable to suit your coding style.\n\n- **Profiles:** ocamlformat offers profiles we predefined formatting configurations. Profiles include `default`, `ocamlformat`, `janestreet`.\n- **Configurable:** Users can change the formatting profile and configure every option in their `.ocamlformat` configuration file.\n- **Format Comments:** ocamlformat can format comments, docstrings, and even code blocks in your comments.\n- **RPC:** ocamlformat provides an RPC server that can be used by other tools to easily format OCaml Code.")
9589
(depends
@@ -106,43 +100,43 @@
106100
(csexp
107101
(>= 1.4.0))
108102
dune
109-
(ocamlformat-lib
103+
(ocamlformat-mlx-lib
110104
(= :version))
111-
(ocamlformat-rpc-lib
112-
(and
113-
:with-test
114-
(= :version)))
105+
; (ocamlformat-rpc-lib
106+
; (and
107+
; :with-test
108+
; (= :version)))
115109
(re
116110
(>= 1.10.3))))
117111

118-
(package
119-
(name ocamlformat-bench)
120-
(synopsis "Auto-formatter for OCaml code")
121-
(description
122-
"OCamlFormat is a tool to automatically format OCaml code in a uniform style.")
123-
(depends
124-
(ocaml
125-
(>= 4.08))
126-
(alcotest
127-
(and
128-
:with-test
129-
(>= 1.3.0)))
130-
(bechamel
131-
(>= 0.2.0))
132-
(ocamlformat-lib
133-
(= :version))
134-
stdio
135-
(yojson
136-
(>= 1.6.0))))
112+
; (package
113+
; (name ocamlformat-bench)
114+
; (synopsis "Auto-formatter for OCaml code")
115+
; (description
116+
; "OCamlFormat is a tool to automatically format OCaml code in a uniform style.")
117+
; (depends
118+
; (ocaml
119+
; (>= 4.08))
120+
; (alcotest
121+
; (and
122+
; :with-test
123+
; (>= 1.3.0)))
124+
; (bechamel
125+
; (>= 0.2.0))
126+
; (ocamlformat-lib
127+
; (= :version))
128+
; stdio
129+
; (yojson
130+
; (>= 1.6.0))))
137131

138-
(package
139-
(name ocamlformat-rpc-lib)
140-
(synopsis "Auto-formatter for OCaml code (RPC mode)")
141-
(description
142-
"OCamlFormat is a tool to automatically format OCaml code in a uniform style. This package defines a RPC interface to OCamlFormat")
143-
(license MIT)
144-
(depends
145-
(ocaml
146-
(>= 4.08))
147-
(csexp
148-
(>= 1.4.0))))
132+
; (package
133+
; (name ocamlformat-rpc-lib)
134+
; (synopsis "Auto-formatter for OCaml code (RPC mode)")
135+
; (description
136+
; "OCamlFormat is a tool to automatically format OCaml code in a uniform style. This package defines a RPC interface to OCamlFormat")
137+
; (license MIT)
138+
; (depends
139+
; (ocaml
140+
; (>= 4.08))
141+
; (csexp
142+
; (>= 1.4.0))))

0 commit comments

Comments
 (0)