Views: Configured .ocp-indent.conf to sensible defaults, and indented everything with this. Settings are:

normal
base = 2
type = 2
in = 0
with = 0
match_clause = 2
ppx_stritem_ext = 2
max_indent = 2
strict_with = never
strict_else = always
strict_comments = false
align_ops = true
align_params = auto
This commit is contained in:
rand00 2022-02-03 14:00:24 +01:00
parent 87442c4a09
commit 126fe38465

View file

@ -133,12 +133,12 @@ let layout ?include_static_css ?(nav=`Default) ~title body =
in in
H.html H.html
(H.head (H.title (H.txt title)) (H.head (H.title (H.txt title))
[H.style ~a:H.[a_mime_type "text/css"] static_css]) [H.style ~a:H.[a_mime_type "text/css"] static_css])
(H.body [ (H.body [
breadcrumb; breadcrumb;
H.main body H.main body
]) ])
let toggleable ?(hidden=true) ~id ~description content = let toggleable ?(hidden=true) ~id ~description content =
let checked = if hidden then [] else H.[a_checked ()] in let checked = if hidden then [] else H.[a_checked ()] in
@ -297,13 +297,13 @@ module Job = struct
~title:(Fmt.str "Job %s %a" job_name pp_platform platform) ~title:(Fmt.str "Job %s %a" job_name pp_platform platform)
((H.h1 [txtf "Job %s %a" job_name pp_platform platform] :: ((H.h1 [txtf "Job %s %a" job_name pp_platform platform] ::
(match readme with (match readme with
| None -> [] | None -> []
| Some data -> | Some data ->
[ [
H.h2 ~a:H.[a_id "readme"] [H.txt "README"]; H.h2 ~a:H.[a_id "readme"] [H.txt "README"];
H.a ~a:H.[a_href "#builds"] [H.txt "Skip to builds"]; H.a ~a:H.[a_href "#builds"] [H.txt "Skip to builds"];
H.Unsafe.data (Utils.Omd.html_of_string data) H.Unsafe.data (Utils.Omd.html_of_string data)
])) @ ])) @
[ [
H.h2 ~a:H.[a_id "builds"] [H.txt "Builds"]; H.h2 ~a:H.[a_id "builds"] [H.txt "Builds"];
H.a ~a:H.[a_href "#readme"] [H.txt "Back to readme"]; H.a ~a:H.[a_href "#readme"] [H.txt "Back to readme"];
@ -381,30 +381,29 @@ module Job_build = struct
] ]
]; ];
H.h3 [H.txt "Build artifacts"]; H.h3 [H.txt "Build artifacts"];
H.dl (List.concat_map H.dl (List.concat_map (fun { Builder_db.filepath; localpath=_; sha256; size } ->
(fun { Builder_db.filepath; localpath=_; sha256; size } -> let (`Hex sha256_hex) = Hex.of_cstruct sha256 in
let (`Hex sha256_hex) = Hex.of_cstruct sha256 in [
[ H.dt [H.a
H.dt [H.a ~a:H.[Fmt.kstr a_href "f/%a" Fpath.pp filepath]
~a:H.[Fmt.kstr a_href "f/%a" Fpath.pp filepath] [H.code [txtf "%a" Fpath.pp filepath]]];
[H.code [txtf "%a" Fpath.pp filepath]]]; H.dd [
H.dd [ H.code [H.txt "SHA256:"; H.txt sha256_hex];
H.code [H.txt "SHA256:"; H.txt sha256_hex]; txtf " (%a)" Fmt.byte_size size;
txtf " (%a)" Fmt.byte_size size; ];
]; ])
]) artifacts);
artifacts);
H.h3 [ H.h3 [
txtf "Reproduced by %d builds" txtf "Reproduced by %d builds"
(List.length (same_input_same_output @ different_input_same_output))] ; (List.length (same_input_same_output @ different_input_same_output))] ;
H.ul H.ul
((List.map (fun { Builder_db.Build.start ; uuid ; platform ; _ } -> ((List.map (fun { Builder_db.Build.start ; uuid ; platform ; _ } ->
H.li [ H.li [
txtf "on %s, same input, " platform; txtf "on %s, same input, " platform;
H.a ~a:H.[Fmt.kstr a_href "/job/%s/build/%a/" name Uuidm.pp uuid] H.a ~a:H.[Fmt.kstr a_href "/job/%s/build/%a/" name Uuidm.pp uuid]
[txtf "%a" pp_ptime start] [txtf "%a" pp_ptime start]
]) ])
same_input_same_output) @ same_input_same_output) @
List.map (fun { Builder_db.Build.start ; uuid = other_uuid ; platform ; _ } -> List.map (fun { Builder_db.Build.start ; uuid = other_uuid ; platform ; _ } ->
H.li [ H.li [
txtf "on %s, different input, " platform; txtf "on %s, different input, " platform;
@ -417,41 +416,41 @@ module Job_build = struct
different_input_same_output) different_input_same_output)
] ]
@ (if same_input_different_output = [] then @ (if same_input_different_output = [] then
[] []
else else
[ H.h3 [H.txt "Same input, different output (not reproducible!)"]; [ H.h3 [H.txt "Same input, different output (not reproducible!)"];
H.ul ( H.ul (
List.map (fun { Builder_db.Build.start ; uuid = other_uuid ; platform ; _ } -> List.map (fun { Builder_db.Build.start ; uuid = other_uuid ; platform ; _ } ->
H.li [ H.li [
txtf "on %s, " platform ; txtf "on %s, " platform ;
H.a ~a:H.[ H.a ~a:H.[
Fmt.kstr a_href "/compare/%a/%a/" Fmt.kstr a_href "/compare/%a/%a/"
Uuidm.pp other_uuid Uuidm.pp other_uuid
Uuidm.pp build.uuid] Uuidm.pp build.uuid]
[txtf "%a" pp_ptime start] [txtf "%a" pp_ptime start]
]) ])
same_input_different_output) same_input_different_output)
] ]
) )
@ [ @ [
H.h3 [H.txt "Comparisons with other builds on the same platform"]; H.h3 [H.txt "Comparisons with other builds on the same platform"];
let opt_build (ctx, build') = let opt_build (ctx, build') =
match build' with match build' with
| Some b when not (Uuidm.equal build.uuid b.Builder_db.Build.uuid) -> | Some b when not (Uuidm.equal build.uuid b.Builder_db.Build.uuid) ->
[ H.li [ H.txt ctx; [ H.li [ H.txt ctx;
H.a ~a:[ H.a ~a:[
Fmt.kstr H.a_href "/compare/%a/%a/" Fmt.kstr H.a_href "/compare/%a/%a/"
Uuidm.pp b.uuid Uuidm.pp b.uuid
Uuidm.pp build.uuid ] Uuidm.pp build.uuid ]
[txtf "%a" pp_ptime b.start]] [txtf "%a" pp_ptime b.start]]
] ]
| _ -> [] | _ -> []
in in
H.ul H.ul
(List.concat_map opt_build (List.concat_map opt_build
[ ("Latest build ", latest) ; [ ("Latest build ", latest) ;
("Later build with different output ", next) ; ("Later build with different output ", next) ;
("Earlier build with different output ", previous) ]) ("Earlier build with different output ", previous) ])
] ]
let viz_style_deps = " let viz_style_deps = "
@ -572,29 +571,29 @@ let opam_diffs diffs =
List.concat_map (fun pd -> List.concat_map (fun pd ->
H.h4 [ txtf "%a" Opamdiff.pp_opam_diff pd ] :: H.h4 [ txtf "%a" Opamdiff.pp_opam_diff pd ] ::
(match pd.Opamdiff.build with None -> [] | Some a -> (match pd.Opamdiff.build with None -> [] | Some a ->
let l, r = Opamdiff.commands_to_strings a in let l, r = Opamdiff.commands_to_strings a in
[ [
H.h5 [ H.txt "build instruction (without common prefix) modifications, old:" ] ; H.h5 [ H.txt "build instruction (without common prefix) modifications, old:" ] ;
H.code (List.concat_map (fun s -> [ H.txt s ; H.br () ]) l) ; H.code (List.concat_map (fun s -> [ H.txt s ; H.br () ]) l) ;
H.h5 [ H.txt "new" ] ; H.h5 [ H.txt "new" ] ;
H.code (List.concat_map (fun s -> [ H.txt s ; H.br () ]) r) H.code (List.concat_map (fun s -> [ H.txt s ; H.br () ]) r)
]) @ ]) @
(match pd.Opamdiff.install with None -> [] | Some a -> (match pd.Opamdiff.install with None -> [] | Some a ->
let l, r = Opamdiff.commands_to_strings a in let l, r = Opamdiff.commands_to_strings a in
[ [
H.h5 [ H.txt "install instruction (without common prefix) modifications, old:" ] ; H.h5 [ H.txt "install instruction (without common prefix) modifications, old:" ] ;
H.code (List.concat_map (fun s -> [ H.txt s ; H.br () ]) l) ; H.code (List.concat_map (fun s -> [ H.txt s ; H.br () ]) l) ;
H.h5 [ H.txt "new" ] ; H.h5 [ H.txt "new" ] ;
H.code (List.concat_map (fun s -> [ H.txt s ; H.br () ]) r) H.code (List.concat_map (fun s -> [ H.txt s ; H.br () ]) r)
]) @ ]) @
(match pd.Opamdiff.url with None -> [] | Some a -> (match pd.Opamdiff.url with None -> [] | Some a ->
let l, r = Opamdiff.opt_url_to_string a in let l, r = Opamdiff.opt_url_to_string a in
[ [
H.h5 [ H.txt "URL" ] ; H.h5 [ H.txt "URL" ] ;
txtf "old: %s" l; txtf "old: %s" l;
H.br (); H.br ();
txtf "new: %s" r txtf "new: %s" r
]) @ ]) @
[ H.br () ]) [ H.br () ])
diffs diffs
@ -610,24 +609,24 @@ let compare_builds
layout layout
~nav:(`Comparison ((job_left, build_left), (job_right, build_right))) ~nav:(`Comparison ((job_left, build_left), (job_right, build_right)))
~title:(Fmt.str "Comparing builds %a and %a" ~title:(Fmt.str "Comparing builds %a and %a"
Uuidm.pp build_left.uuid Uuidm.pp build_right.uuid) Uuidm.pp build_left.uuid Uuidm.pp build_right.uuid)
([ ([
H.h1 [H.txt "Comparing builds"]; H.h1 [H.txt "Comparing builds"];
H.h2 [ H.h2 [
H.txt "Builds "; H.txt "Builds ";
H.a ~a:H.[a_href H.a ~a:H.[a_href
(Fmt.str "/job/%s/build/%a/" (Fmt.str "/job/%s/build/%a/"
job_left job_left
Uuidm.pp build_left.uuid)] Uuidm.pp build_left.uuid)]
[ txtf "%s@%a %a" [ txtf "%s@%a %a"
job_left job_left
pp_ptime build_left.start pp_ptime build_left.start
pp_platform (Some build_left.platform)]; pp_platform (Some build_left.platform)];
H.txt " and "; H.txt " and ";
H.a ~a:H.[a_href H.a ~a:H.[a_href
(Fmt.str "/job/%s/build/%a/" (Fmt.str "/job/%s/build/%a/"
job_right job_right
Uuidm.pp build_right.uuid)] Uuidm.pp build_right.uuid)]
[ txtf "%s@%a %a" [ txtf "%s@%a %a"
job_right job_right
pp_ptime build_right.start pp_ptime build_right.start
@ -642,22 +641,22 @@ let compare_builds
H.li [ H.li [
H.a ~a:H.[a_href "#opam-packages-removed"] H.a ~a:H.[a_href "#opam-packages-removed"]
[txtf "%d opam packages removed" [txtf "%d opam packages removed"
(OpamPackage.Set.cardinal left)] (OpamPackage.Set.cardinal left)]
]; ];
H.li [ H.li [
H.a ~a:H.[a_href "#opam-packages-installed"] H.a ~a:H.[a_href "#opam-packages-installed"]
[txtf "%d new opam packages installed" [txtf "%d new opam packages installed"
(OpamPackage.Set.cardinal right)] (OpamPackage.Set.cardinal right)]
]; ];
H.li [ H.li [
H.a ~a:H.[a_href "#opam-packages-version-diff"] H.a ~a:H.[a_href "#opam-packages-version-diff"]
[txtf "%d opam packages with version changes" [txtf "%d opam packages with version changes"
(List.length version_diff)] (List.length version_diff)]
]; ];
H.li [ H.li [
H.a ~a:H.[a_href "#opam-packages-opam-diff"] H.a ~a:H.[a_href "#opam-packages-opam-diff"]
[txtf "%d opam packages with changes in their opam file" [txtf "%d opam packages with changes in their opam file"
(List.length opam_diff)] (List.length opam_diff)]
]; ];
H.li [ H.li [
H.a ~a:H.[a_href "#opam-packages-unchanged"] H.a ~a:H.[a_href "#opam-packages-unchanged"]
@ -699,23 +698,23 @@ let compare_builds
H.code (package_diffs version_diff); H.code (package_diffs version_diff);
H.h3 ~a:H.[a_id "opam-packages-opam-diff"] H.h3 ~a:H.[a_id "opam-packages-opam-diff"]
[H.txt "Opam packages with changes in their opam file"]] @ [H.txt "Opam packages with changes in their opam file"]] @
opam_diffs opam_diff @ [ opam_diffs opam_diff @ [
H.h3 ~a:H.[a_id "opam-packages-unchanged"] H.h3 ~a:H.[a_id "opam-packages-unchanged"]
[H.txt "Unchanged opam packages"]; [H.txt "Unchanged opam packages"];
H.code (packages same); H.code (packages same);
H.h3 ~a:H.[a_id "env-added"] [H.txt "Environment variables added"]; H.h3 ~a:H.[a_id "env-added"] [H.txt "Environment variables added"];
H.code (key_values added_env); H.code (key_values added_env);
H.h3 ~a:H.[a_id "env-removed"] [H.txt "Environment variables removed"]; H.h3 ~a:H.[a_id "env-removed"] [H.txt "Environment variables removed"];
H.code (key_values removed_env); H.code (key_values removed_env);
H.h3 ~a:H.[a_id "env-changed"] [H.txt "Environment variables changed"]; H.h3 ~a:H.[a_id "env-changed"] [H.txt "Environment variables changed"];
H.code (key_value_changes changed_env); H.code (key_value_changes changed_env);
H.h3 ~a:H.[a_id "pkgs-added"] [H.txt "System packages added"]; H.h3 ~a:H.[a_id "pkgs-added"] [H.txt "System packages added"];
H.code (key_values added_pkgs); H.code (key_values added_pkgs);
H.h3 ~a:H.[a_id "pkgs-removed"] [H.txt "System packages removed"]; H.h3 ~a:H.[a_id "pkgs-removed"] [H.txt "System packages removed"];
H.code (key_values removed_pkgs); H.code (key_values removed_pkgs);
H.h3 ~a:H.[a_id "pkgs-changed"] [H.txt "System packages changed"]; H.h3 ~a:H.[a_id "pkgs-changed"] [H.txt "System packages changed"];
H.code (key_value_changes changed_pkgs); H.code (key_value_changes changed_pkgs);
]) ])
let failed_builds ~start ~count builds = let failed_builds ~start ~count builds =
let build (job_name, build) = let build (job_name, build) =
@ -732,11 +731,11 @@ let failed_builds ~start ~count builds =
H.h1 [H.txt "Failed builds"]; H.h1 [H.txt "Failed builds"];
H.ul (List.map build builds); H.ul (List.map build builds);
H.p [ txtf "View the next %d failed builds " count; H.p [ txtf "View the next %d failed builds " count;
H.a ~a:H.[ H.a ~a:H.[
Fmt.kstr a_href "/failed-builds/?count=%d&start=%d" Fmt.kstr a_href "/failed-builds/?count=%d&start=%d"
count (start + count) ] count (start + count) ]
[ H.txt "here"]; [ H.txt "here"];
H.txt "."; H.txt ".";
] ]
]) ])