Skip to content

Commit

Permalink
Merge pull request #478 from Julow/preview-ocamlformat-0.26.0
Browse files Browse the repository at this point in the history
Upgrade to ocamlformat 0.26.0
  • Loading branch information
Leonidas-from-XIV authored Jul 31, 2023
2 parents 5e2887c + bdbb8c8 commit 0baf5f2
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 31 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Upgrade to OCamlformat 0.26.0
7f4890bc747650982e5f01eb1e570c9fa127bbdb
2 changes: 1 addition & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version=0.22.4
version=0.26.0
profile=conventional
parse-docstrings=true
2 changes: 1 addition & 1 deletion bin/distrib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let check_archive ~dry_run ~skip_lint ~skip_build ~skip_tests ~pkg_names pkg ar
=
Archive.untbz ~dry_run ~clean:true ar >>= fun dir ->
(if skip_lint then Ok 0
else Lint.lint_packages ~dry_run ~dir ~todo:Lint.all pkg pkg_names)
else Lint.lint_packages ~dry_run ~dir ~todo:Lint.all pkg pkg_names)
>>= fun c0 ->
Check.dune_checks ~dry_run ~skip_build ~skip_tests ~pkg_names dir
>>= fun c1 ->
Expand Down
14 changes: 7 additions & 7 deletions bin/opam.ml
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,13 @@ let submit ~token ~dry_run ~yes ~opam_repo ~pkgs_to_submit local_repo
Pkg.name pkg >>= fun name ->
let project_name = Pkg.project_name pkg in
(if draft then Ok ()
else
match Config.Draft_release.is_set ~dry_run ~build_dir ~name ~version with
| Ok true ->
R.error_msg
"Cannot open a non-draft pull request for a draft release. Please \
use option '--draft' for 'dune-release opam submit'."
| _ -> Ok ())
else
match Config.Draft_release.is_set ~dry_run ~build_dir ~name ~version with
| Ok true ->
R.error_msg
"Cannot open a non-draft pull request for a draft release. Please \
use option '--draft' for 'dune-release opam submit'."
| _ -> Ok ())
>>= fun () ->
list_map Pkg.name pkgs >>= fun names ->
let title = Github.pr_title ~names ~version ~project_name ~pkgs_to_submit in
Expand Down
2 changes: 1 addition & 1 deletion lib/check.ml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ let check_project ~pkg_names ~skip_lint ~skip_build ~skip_tests ~skip_change_log
dune_checks ~dry_run:false ~skip_build ~skip_tests ~pkg_names dir
>>= fun dune_exit ->
(if skip_lint then Ok 0
else Lint.lint_packages ~dry_run:false ~dir ~todo:Lint.all pkg pkg_names)
else Lint.lint_packages ~dry_run:false ~dir ~todo:Lint.all pkg pkg_names)
>>= fun lint_exit ->
(if skip_change_log then Ok 0 else change_log_check pkg)
>>| fun change_log_exit ->
Expand Down
24 changes: 12 additions & 12 deletions lib/github.ml
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,13 @@ let open_pr ~token ~dry_run ~title ~fork_owner ~branch ~opam_repo ~draft body
let default_body = `Assoc [ ("html_url", `String D.pr_url) ] in
run_with_auth ~dry_run ~default_body curl_t >>= fun json ->
(if draft then
Pkg.build_dir pkg >>= fun build_dir ->
Pkg.name pkg >>= fun name ->
Pkg.version pkg >>= fun version ->
Github_v3_api.Pull_request.Response.number json >>= fun pr_number ->
Config.Draft_pr.set ~dry_run ~build_dir ~name ~version
(string_of_int pr_number)
else Ok ())
Pkg.build_dir pkg >>= fun build_dir ->
Pkg.name pkg >>= fun name ->
Pkg.version pkg >>= fun version ->
Github_v3_api.Pull_request.Response.number json >>= fun pr_number ->
Config.Draft_pr.set ~dry_run ~build_dir ~name ~version
(string_of_int pr_number)
else Ok ())
>>= fun () -> Github_v3_api.Pull_request.Response.html_url json

let undraft_release ~token ~dry_run ~owner ~repo ~release_id ~name =
Expand Down Expand Up @@ -447,9 +447,9 @@ let publish_distrib ~token ~dry_run ~msg ~archive ~yes ~draft p =
~repo ~draft
>>= fun id ->
(if draft then
Config.Draft_release.set ~dry_run ~build_dir ~name ~version
(string_of_int id)
else Config.Draft_release.unset ~dry_run ~build_dir ~name ~version)
Config.Draft_release.set ~dry_run ~build_dir ~name ~version
(string_of_int id)
else Config.Draft_release.unset ~dry_run ~build_dir ~name ~version)
>>= fun () ->
Prompt.(
confirm_or_abort ~yes
Expand All @@ -462,8 +462,8 @@ let publish_distrib ~token ~dry_run ~msg ~archive ~yes ~draft p =
curl_upload_archive ~token ~dry_run ~yes archive owner repo id
>>= fun (url, asset_name) ->
(if draft then
Config.Release_asset_name.set ~dry_run ~build_dir ~name ~version asset_name
else Config.Release_asset_name.unset ~dry_run ~build_dir ~name ~version)
Config.Release_asset_name.set ~dry_run ~build_dir ~name ~version asset_name
else Config.Release_asset_name.unset ~dry_run ~build_dir ~name ~version)
>>= fun () -> Ok url

let rec pp_list pp ppf = function
Expand Down
10 changes: 5 additions & 5 deletions lib/opam.ml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ let prepare_package ~build_dir ~dry_run ~version vcs name =
in
OS.Dir.exists src >>= fun exists ->
(if exists then Ok ()
else
R.error_msgf
"%a does not exist, did you run:\n dune-release opam pkg -p %s\n"
Fpath.pp src name)
else
R.error_msgf
"%a does not exist, did you run:\n dune-release opam pkg -p %s\n"
Fpath.pp src name)
>>= fun () ->
OS.Dir.create ~path:true dst >>= fun _ ->
cp "opam" >>= fun () ->
Expand All @@ -92,7 +92,7 @@ let prepare ~dry_run ?msg ~local_repo ~remote_repo ~opam_repo ~version ~tag
msg >>= fun msg ->
Sos.dir_exists ~dry_run Fpath.(local_repo / ".git") >>= fun exists ->
(if exists then Ok ()
else R.error_msgf "%a is not a valid Git repository." Fpath.pp local_repo)
else R.error_msgf "%a is not a valid Git repository." Fpath.pp local_repo)
>>= fun () ->
let git_for_repo r = Cmd.of_list (Cmd.to_list @@ Vcs.cmd r) in
Vcs.get () >>= fun repo ->
Expand Down
2 changes: 1 addition & 1 deletion lib/pkg.ml
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ let distrib_archive ~dry_run ~keep_dir ~include_submodules p =
let branch = Fmt.str "dune-release-dist-%a" Vcs.Tag.pp tag in
Vcs.checkout ~dry_run clone_vcs ~branch ~commit_ish:(Tag tag) >>= fun () ->
(if include_submodules then pull_submodules ~dry_run ~dist_build_dir
else Ok ())
else Ok ())
>>= fun () ->
distrib_prepare ~dry_run ~dist_build_dir ~version >>= fun () ->
let exclude_paths = Fpath.Set.of_list Distrib.exclude_paths in
Expand Down
6 changes: 3 additions & 3 deletions lib/uri_helpers.mli
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
type uri = { scheme : string option; domain : string list; path : string list }
(** Helper type describing the content of an URI to facilitate parsing. Scheme
is None if no explicit scheme was specified. The domain is a non empty list
in hierarchical order, e.g. [\["io"; "github"; "me"\]] for ["me.github.io"].
The path is [\[\]] if there was no path and a list of the path components,
e.g. [\["some"; "path"\]] for ["domain.com/some/path"]. *)
in hierarchical order, e.g. [["io"; "github"; "me"]] for ["me.github.io"].
The path is [[]] if there was no path and a list of the path components,
e.g. [["some"; "path"]] for ["domain.com/some/path"]. *)

val pp_uri : Format.formatter -> uri -> unit
val equal_uri : uri -> uri -> bool
Expand Down

0 comments on commit 0baf5f2

Please sign in to comment.