Skip to content

Commit 652a1a3

Browse files
sir4ur0nGoopher Maijenburg
authored andcommitted
[OCaml] Generate .ocamlformat file; format all generated OCaml files (OpenAPITools#21809)
* [OCaml] Generate .ocamlformat file Fixes OpenAPITools#21806 * [OCaml] Run `dune fmt` on all OCaml folders * Don't format in Git * Add myself for OCaml
1 parent 468834b commit 652a1a3

19 files changed

Lines changed: 37 additions & 27 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ If you want to join the committee, please kindly apply by sending an email to te
12641264
| Nim | |
12651265
| NodeJS/Javascript | @CodeNinjai (2017/07) @frol (2017/07) @cliffano (2017/07) |
12661266
| ObjC | |
1267-
| OCaml | @cgensoul (2019/08) |
1267+
| OCaml | @cgensoul (2019/08), @sir4ur0n (2025/08) |
12681268
| Perl | @wing328 (2017/07) [:heart:](https://www.patreon.com/wing328) @yue9944882 (2019/06) |
12691269
| PHP | @jebentier (2017/07), @dkarlovi (2017/07), @mandrean (2017/08), @jfastnacht (2017/09), [@ybelenko](https://github.com/ybelenko) (2018/07), @renepardon (2018/12) |
12701270
| PowerShell | @wing328 (2020/05) |

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ public OCamlClientCodegen() {
134134
supportingFiles.add(new SupportingFile("dune.mustache", "", "dune"));
135135
supportingFiles.add(new SupportingFile("dune-project.mustache", "", "dune-project"));
136136
supportingFiles.add(new SupportingFile("readme.mustache", "", "README.md"));
137+
supportingFiles.add(new SupportingFile("ocamlformat.mustache", "", ".ocamlformat"));
137138

138139
defaultIncludes = new HashSet<>(
139140
Arrays.asList(
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
(lang dune 1.10)
2-
(name {{{packageName}}})
1+
(lang dune 2.0)
2+
(name {{{packageName}}})

modules/openapi-generator/src/main/resources/ocaml/lib.mustache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dev-repo: ""
1414
depends: [
1515
"ocaml"
1616
"ocamlfind"
17+
"ocamlformat" {= "0.27.0"}
1718
"dune"
1819
"ppx_deriving_yojson"
1920
"conf-libev"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version=0.27.0
2+
ocaml-version=4.14.0
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version=0.27.0
2+
ocaml-version=4.14.0

samples/client/petstore/ocaml-fake-petstore/.openapi-generator/FILES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.ocamlformat
12
README.md
23
dune
34
dune-project
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
(lang dune 1.10)
2-
(name petstore_client)
1+
(lang dune 2.0)
2+
(name petstore_client)

samples/client/petstore/ocaml-fake-petstore/petstore_client.opam

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dev-repo: ""
1414
depends: [
1515
"ocaml"
1616
"ocamlfind"
17+
"ocamlformat" {= "0.27.0"}
1718
"dune"
1819
"ppx_deriving_yojson"
1920
"conf-libev"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version=0.27.0
2+
ocaml-version=4.14.0

0 commit comments

Comments
 (0)