Skip to content

Commit 161e914

Browse files
authored
dune build @fmt --auto-promote with ocamlformat 0.26.2 (#316)
Alternative to #315 Closes #315
2 parents 7db6b5a + 8950768 commit 161e914

File tree

7 files changed

+195
-191
lines changed

7 files changed

+195
-191
lines changed

.github/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ webhooks coming from the web to this local server.
5656

5757
We use `ocamlformat` to auto-format OCaml and Dune files. If
5858
possible, run it with `dune build @fmt --auto-promote` before
59-
committing. As of today, version 0.15.0 is required.
59+
committing. As of today, version 0.26.2 is required.
6060

6161
You may also configure your editor to auto-format your files on save.
6262
If you are inside a `nix-shell` and using Emacs, you can simply do so

bot-components/GitHub_GraphQL.ml

+62-62
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
(* Queries *)
44

55
module PullRequest_Cards =
6-
[%graphql
7-
{|
6+
[%graphql
7+
{|
88
query prCards($owner: String!, $repo: String!, $number: Int!) {
99
repository(owner: $owner,name: $repo) {
1010
pullRequest(number: $number) {
@@ -22,8 +22,8 @@ module PullRequest_Cards =
2222
|}]
2323

2424
module PullRequest_ID =
25-
[%graphql
26-
{|
25+
[%graphql
26+
{|
2727
query prID($owner: String!, $repo: String!, $number: Int!) {
2828
repository(owner: $owner,name: $repo) {
2929
pullRequest(number: $number) {
@@ -34,8 +34,8 @@ module PullRequest_ID =
3434
|}]
3535

3636
module PullRequest_Milestone =
37-
[%graphql
38-
{|
37+
[%graphql
38+
{|
3939
query prInfo($pr_id: ID!) {
4040
node(id: $pr_id) {
4141
... on PullRequest {
@@ -49,8 +49,8 @@ module PullRequest_Milestone =
4949
|}]
5050

5151
module PullRequest_ID_and_Milestone =
52-
[%graphql
53-
{|
52+
[%graphql
53+
{|
5454
query prInfo($owner: String!, $repo: String!, $number: Int!) {
5555
repository(owner: $owner,name: $repo) {
5656
pullRequest(number: $number) {
@@ -65,8 +65,8 @@ module PullRequest_ID_and_Milestone =
6565
|}]
6666

6767
module Milestone_ID =
68-
[%graphql
69-
{|
68+
[%graphql
69+
{|
7070
query milestoneID($owner: String!, $repo: String!, $number: Int!) {
7171
repository(owner: $owner,name: $repo) {
7272
milestone(number: $number) {
@@ -77,8 +77,8 @@ module Milestone_ID =
7777
|}]
7878

7979
module TeamMembership =
80-
[%graphql
81-
{|
80+
[%graphql
81+
{|
8282
query teamMember($org: String!, $team: String!, $user: String!) {
8383
organization(login:$org) {
8484
team(slug:$team) {
@@ -99,8 +99,8 @@ module ParseAsString = struct
9999
end
100100

101101
module PullRequest_Refs =
102-
[%graphql
103-
{|
102+
[%graphql
103+
{|
104104
query prRefs($owner: String!, $repo: String!, $number: Int!) {
105105
repository(owner: $owner, name:$repo) {
106106
pullRequest(number: $number) {
@@ -129,8 +129,8 @@ module PullRequest_Refs =
129129
|}]
130130

131131
module Issue_Milestone =
132-
[%graphql
133-
{|
132+
[%graphql
133+
{|
134134
fragment Milestone on Milestone {
135135
id
136136
}
@@ -165,8 +165,8 @@ module Issue_Milestone =
165165
|}]
166166

167167
module PullRequestReviewsInfo =
168-
[%graphql
169-
{|
168+
[%graphql
169+
{|
170170
fragment Reviews on PullRequestReviewConnection {
171171
nodes {
172172
author { login }
@@ -203,8 +203,8 @@ module PullRequestReviewsInfo =
203203
|}]
204204

205205
module DefaultBranch =
206-
[%graphql
207-
{|
206+
[%graphql
207+
{|
208208
query defaultBranch($owner: String!, $repo: String!) {
209209
repository(owner: $owner, name: $repo) {
210210
defaultBranchRef {
@@ -215,8 +215,8 @@ module DefaultBranch =
215215
|}]
216216

217217
module FileContent =
218-
[%graphql
219-
{|
218+
[%graphql
219+
{|
220220
query fileContent($owner: String!, $repo: String!, $file: String!) {
221221
repository(owner: $owner, name: $repo) {
222222
file:object(expression: $file) {
@@ -229,8 +229,8 @@ module FileContent =
229229
|}]
230230

231231
module RepoId =
232-
[%graphql
233-
{|
232+
[%graphql
233+
{|
234234
query repoId($owner: String!, $repo: String!) {
235235
repository(owner: $owner, name: $repo) {
236236
id
@@ -239,8 +239,8 @@ module RepoId =
239239
|}]
240240

241241
module GetCheckRuns =
242-
[%graphql
243-
{|
242+
[%graphql
243+
{|
244244
query getCheckRuns($appId: Int!, $owner: String!, $repo: String!, $commit: String!, $context: String!) {
245245
repository(owner:$owner, name:$repo) {
246246
obj: object(expression: $commit) {
@@ -266,8 +266,8 @@ module GetCheckRuns =
266266
|}]
267267

268268
module GetLabel =
269-
[%graphql
270-
{|
269+
[%graphql
270+
{|
271271
query getLabels($owner: String!, $repo: String!, $label: String!) {
272272
repository(owner:$owner, name:$repo) {
273273
label(name: $label) {
@@ -278,8 +278,8 @@ module GetLabel =
278278
|}]
279279

280280
module GetOpenPullRequestWithLabel =
281-
[%graphql
282-
{|
281+
[%graphql
282+
{|
283283

284284
query getOpenPullRequestWithLabel($owner: String!, $repo:String!, $label:String!, $cursor: String, $len: Int!) {
285285
repository(name: $repo,owner:$owner) {
@@ -299,8 +299,8 @@ query getOpenPullRequestWithLabel($owner: String!, $repo:String!, $label:String!
299299
|}]
300300

301301
module GetPullRequestLabelTimeline =
302-
[%graphql
303-
{|
302+
[%graphql
303+
{|
304304
fragment Label on Label {
305305
name
306306
}
@@ -331,8 +331,8 @@ query getPullRequestLabelTimeline($owner: String!, $repo:String!, $prNumber: Int
331331
|}]
332332

333333
module GetPullRequestLabels =
334-
[%graphql
335-
{|
334+
[%graphql
335+
{|
336336

337337
query getPullRequestLabels($owner: String!, $repo:String!, $prNumber: Int!, $cursor: String, $len: Int!) {
338338
repository(name: $repo,owner:$owner) {
@@ -353,8 +353,8 @@ query getPullRequestLabels($owner: String!, $repo:String!, $prNumber: Int!, $cur
353353
|}]
354354

355355
module GetBaseAndHeadChecks =
356-
[%graphql
357-
{|
356+
[%graphql
357+
{|
358358
fragment CheckRuns on CheckRunConnection {
359359
nodes {
360360
name
@@ -400,8 +400,8 @@ query getChecks($appId: Int!, $owner: String!, $repo:String!, $prNumber: Int!, $
400400
|}]
401401

402402
module GetPipelineSummary =
403-
[%graphql
404-
{|
403+
[%graphql
404+
{|
405405
query getChecks($appId: Int!, $owner: String!, $repo:String!, $head: String!) {
406406
repository(name: $repo,owner:$owner) {
407407
getPipelineSummaryCommit: object(expression: $head) {
@@ -422,8 +422,8 @@ query getChecks($appId: Int!, $owner: String!, $repo:String!, $head: String!) {
422422
|}]
423423

424424
module GetProjectFieldValues =
425-
[%graphql
426-
{|
425+
[%graphql
426+
{|
427427
query getProjectFieldValues($organization: String!, $project: Int!, $field: String!, $options: [String!]!) {
428428
organization(login: $organization) {
429429
projectV2(number: $project) {
@@ -445,8 +445,8 @@ query getProjectFieldValues($organization: String!, $project: Int!, $field: Stri
445445
(* Mutations *)
446446

447447
module AddCardToProject =
448-
[%graphql
449-
{|
448+
[%graphql
449+
{|
450450
mutation addCard($card_id:ID!, $project_id: ID!) {
451451
addProjectV2ItemById(input:{contentId:$card_id,projectId:$project_id}) {
452452
item {
@@ -457,8 +457,8 @@ module AddCardToProject =
457457
|}]
458458

459459
module UpdateFieldValue =
460-
[%graphql
461-
{|
460+
[%graphql
461+
{|
462462
mutation updateFieldValue($card_id:ID!, $project_id: ID!, $field_id: ID!, $field_value_id: String!) {
463463
updateProjectV2ItemFieldValue(input: {projectId: $project_id, itemId: $card_id, fieldId: $field_id, value: {singleSelectOptionId: $field_value_id}}) {
464464
clientMutationId
@@ -467,8 +467,8 @@ module UpdateFieldValue =
467467
|}]
468468

469469
module CreateNewReleaseManagementField =
470-
[%graphql
471-
{|
470+
[%graphql
471+
{|
472472
mutation createNewField($project_id: ID!, $field: String!) {
473473
createProjectV2Field(input: {projectId: $project_id, dataType: SINGLE_SELECT, name: $field, singleSelectOptions: [{name: "Request inclusion", color: GREEN, description: "This merged pull request is proposed for inclusion."}, {name: "Shipped", color: PURPLE, description: "This pull request has been backported (or merged directly in the release branch)."}, {name: "Rejected", color: RED, description: "This merged pull request will not be included in this release."}]}) {
474474
projectV2Field {
@@ -485,8 +485,8 @@ module CreateNewReleaseManagementField =
485485
|}]
486486
487487
module PostComment =
488-
[%graphql
489-
{|
488+
[%graphql
489+
{|
490490
mutation addComment($id:ID!,$message:String!) {
491491
payload: addComment(input:{subjectId:$id,body:$message}) {
492492
commentEdge {
@@ -499,8 +499,8 @@ module PostComment =
499499
|}]
500500
501501
module UpdateMilestone =
502-
[%graphql
503-
{|
502+
[%graphql
503+
{|
504504
mutation updateMilestone($issue: ID!, $milestone: ID!) {
505505
updateIssue(input: {id: $issue, milestoneId: $milestone}) {
506506
clientMutationId
@@ -509,8 +509,8 @@ module UpdateMilestone =
509509
|}]
510510
511511
module MergePullRequest =
512-
[%graphql
513-
{|
512+
[%graphql
513+
{|
514514
mutation mergePullRequest($pr_id: ID!, $commit_headline: String,
515515
$commit_body: String, $merge_method: PullRequestMergeMethod) {
516516
mergePullRequest(
@@ -527,8 +527,8 @@ module MergePullRequest =
527527
|}]
528528
529529
module ClosePullRequest =
530-
[%graphql
531-
{|
530+
[%graphql
531+
{|
532532
mutation closePullRequest($pr_id: ID!) {
533533
closePullRequest(
534534
input: {pullRequestId: $pr_id}) {
@@ -540,8 +540,8 @@ module ClosePullRequest =
540540
|}]
541541
542542
module LabelIssue =
543-
[%graphql
544-
{|
543+
[%graphql
544+
{|
545545
mutation labelIssue($issue_id: ID!, $label_ids: [ID!]!) {
546546
addLabelsToLabelable(
547547
input: {labelableId: $issue_id, labelIds:$label_ids}) {
@@ -551,8 +551,8 @@ module LabelIssue =
551551
|}]
552552
553553
module UnlabelIssue =
554-
[%graphql
555-
{|
554+
[%graphql
555+
{|
556556
mutation unlabelIssue($issue_id: ID!, $label_ids: [ID!]!) {
557557
removeLabelsFromLabelable(
558558
input: {labelableId: $issue_id, labelIds:$label_ids}) {
@@ -562,8 +562,8 @@ module UnlabelIssue =
562562
|}]
563563
564564
module NewCheckRun =
565-
[%graphql
566-
{|
565+
[%graphql
566+
{|
567567
mutation newCheckRun($name: String!, $repoId: ID!, $headSha: String!,
568568
$status: RequestableCheckStatusState!, $title: String!, $text: String, $summary: String!,
569569
$url: String!, $conclusion: CheckConclusionState, $externalId: String) {
@@ -590,8 +590,8 @@ module NewCheckRun =
590590
|}]
591591
592592
module UpdateCheckRun =
593-
[%graphql
594-
{|
593+
[%graphql
594+
{|
595595
mutation updateCheckRun($checkRunId: ID!, $repoId: ID!
596596
$conclusion: CheckConclusionState!, $title: String!, $text: String,
597597
$url: String, $summary: String!) {

bot-components/GitHub_queries.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1026,4 +1026,4 @@ let get_artifact_blob ~bot_info ~owner ~repo ~artifact_id =
10261026
generic_get_zip ~bot_info
10271027
(f "repos/%s/%s/actions/artifacts/%s/zip" owner repo artifact_id)
10281028
(let open Zip in
1029-
List.map ~f:(fun (entry, contents) -> (entry.filename, contents)) )
1029+
List.map ~f:(fun (entry, contents) -> (entry.filename, contents)) )

bot-components/GitLab_GraphQL.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module GetRetriedJobs =
2-
[%graphql
3-
{|
2+
[%graphql
3+
{|
44
query getRetriedJobs($fullPath: ID!, $jobId: JobID!) {
55
project(fullPath: $fullPath) {
66
job(id: $jobId) {

bot-components/GraphQL_query.ml

+1-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ let send_graphql_query ~bot_info ?(extra_headers = []) ~api ~query ~parse
5252
| errors ->
5353
let errors =
5454
to_list errors
55-
|> List.map ~f:(fun error ->
56-
error |> member "message" |> to_string )
55+
|> List.map ~f:(fun error -> error |> member "message" |> to_string)
5756
in
5857
Error
5958
( "Server responded to GraphQL request with errors: "

0 commit comments

Comments
 (0)