this repo has no description

Formatting

+70 -69
+3 -1
src/driver/bin/odoc_driver.ml
··· 71 71 in 72 72 Compile.init_stats units; 73 73 let compiled = Compile.compile ~partial_dir:odoc_dir units in 74 - let linked = Compile.link ~warnings_tags:packages ~custom_layout:false compiled in 74 + let linked = 75 + Compile.link ~warnings_tags:packages ~custom_layout:false compiled 76 + in 75 77 let occurrence_file = 76 78 let output = 77 79 Fpath.( / ) odoc_dir "occurrences-all.odoc-occurrences"
+3 -1
src/driver/bin/odoc_driver_monorepo.ml
··· 49 49 in 50 50 Compile.init_stats units; 51 51 let compiled = Compile.compile ~partial_dir:odoc_dir units in 52 - let linked = Compile.link ~warnings_tags:[] ~custom_layout:true compiled in 52 + let linked = 53 + Compile.link ~warnings_tags:[] ~custom_layout:true compiled 54 + in 53 55 let occurrence_file = 54 56 let output = 55 57 Fpath.( / ) odoc_dir "occurrences-all.odoc-occurrences"
+4 -1
src/driver/bin/odoc_driver_voodoo.ml
··· 89 89 match actions with 90 90 | CompileOnly -> () 91 91 | LinkAndGen | All -> 92 - let linked = Compile.link ~warnings_tags:[package_name] ~custom_layout:false compiled in 92 + let linked = 93 + Compile.link ~warnings_tags:[ package_name ] ~custom_layout:false 94 + compiled 95 + in 93 96 let occurrence_file = 94 97 let output = 95 98 Fpath.( / ) odoc_dir "occurrences-all.odoc-occurrences"
+3 -3
src/driver/compile.ml
··· 144 144 in 145 145 Odoc.compile ~output_dir:unit.output_dir 146 146 ~input_file:unit.input_file ~includes 147 - ~warnings_tag:unit.pkgname 148 - ~parent_id:unit.parent_id; 147 + ~warnings_tag:unit.pkgname ~parent_id:unit.parent_id; 149 148 Atomic.incr Stats.stats.compiled_units; 150 149 151 150 unit) ··· 244 243 245 244 type linked = Odoc_unit.any 246 245 247 - let link : warnings_tags:string list -> custom_layout:bool -> compiled list -> _ = 246 + let link : warnings_tags:string list -> custom_layout:bool -> compiled list -> _ 247 + = 248 248 fun ~warnings_tags ~custom_layout compiled -> 249 249 let link : compiled -> linked = 250 250 fun c ->
+5 -1
src/driver/compile.mli
··· 12 12 13 13 type linked 14 14 15 - val link : warnings_tags:string list -> custom_layout:bool -> compiled list -> linked list 15 + val link : 16 + warnings_tags:string list -> 17 + custom_layout:bool -> 18 + compiled list -> 19 + linked list 16 20 17 21 val html_generate : 18 22 occurrence_file:Fpath.t ->
+8 -5
src/driver/odoc.ml
··· 36 36 | [ (_, digest) ], deps -> Ok { digest; deps } 37 37 | _ -> Error (`Msg "odd") 38 38 39 - let compile ~output_dir ~input_file:file ~includes ~warnings_tag ~parent_id 40 - = 39 + let compile ~output_dir ~input_file:file ~includes ~warnings_tag ~parent_id = 41 40 let open Cmd in 42 41 let includes = 43 42 Fpath.Set.fold ··· 54 53 %% includes % "--enable-missing-root-warning" 55 54 in 56 55 let cmd = cmd % "--parent-id" % Id.to_string parent_id in 57 - let cmd = match warnings_tag with None -> cmd | Some tag -> cmd % "--warnings-tag" % tag in 56 + let cmd = 57 + match warnings_tag with 58 + | None -> cmd 59 + | Some tag -> cmd % "--warnings-tag" % tag 60 + in 58 61 let desc = Printf.sprintf "Compiling %s" (Fpath.to_string file) in 59 62 ignore 60 63 @@ Cmd_outputs.submit ··· 161 164 if Fpath.to_string file = "stdlib.odoc" then cmd % "--open=\"\"" else cmd 162 165 in 163 166 let cmd = 164 - List.fold_left (fun acc k -> acc % "--warnings-tags" % k) cmd 165 - warnings_tags in 167 + List.fold_left (fun acc k -> acc % "--warnings-tags" % k) cmd warnings_tags 168 + in 166 169 let desc = Printf.sprintf "Linking %s" (Fpath.to_string file) in 167 170 let cmd = if custom_layout then cmd % "--custom-layout" else cmd in 168 171 let log =
+3 -6
src/loader/odoc_loader.ml
··· 256 256 | Make_root_error m -> error_msg filename m) 257 257 258 258 let read_cmti ~make_root ~parent ~filename ~warnings_tag = 259 - wrap_errors ~filename 260 - (read_cmti ~make_root ~parent ~filename ~warnings_tag) 259 + wrap_errors ~filename (read_cmti ~make_root ~parent ~filename ~warnings_tag) 261 260 262 261 let read_cmt ~make_root ~parent ~filename ~warnings_tag = 263 - wrap_errors ~filename 264 - (read_cmt ~make_root ~parent ~filename ~warnings_tag) 262 + wrap_errors ~filename (read_cmt ~make_root ~parent ~filename ~warnings_tag) 265 263 266 264 let read_impl ~make_root ~filename ~source_id = 267 265 wrap_errors ~filename (read_impl ~make_root ~source_id ~filename) 268 266 269 267 let read_cmi ~make_root ~parent ~filename ~warnings_tag = 270 - wrap_errors ~filename 271 - (read_cmi ~make_root ~parent ~filename ~warnings_tag) 268 + wrap_errors ~filename (read_cmi ~make_root ~parent ~filename ~warnings_tag) 272 269 273 270 let read_location = Doc_attr.read_location
+18 -19
src/odoc/bin/main.ml
··· 144 144 in 145 145 let warnings_tag = 146 146 let doc = 147 - "Warnings tag. This is useful when you want to declare that \ 148 - warnings that would be generated resolving the references defined in \ 149 - this unit should be ignored if they end up in expansions in other \ 150 - units. When linking, only warnings with specified tags are reported." 147 + "Warnings tag. This is useful when you want to declare that warnings \ 148 + that would be generated resolving the references defined in this unit \ 149 + should be ignored if they end up in expansions in other units. When \ 150 + linking, only warnings with specified tags are reported." 151 151 in 152 152 let env = Arg.env_var "ODOC_WARNINGS_TAG" ~doc in 153 - Arg.(value & opt (some string) None & info ~docs ~doc ~env [ "warnings-tag" ]) 153 + Arg.( 154 + value & opt (some string) None & info ~docs ~doc ~env [ "warnings-tag" ]) 154 155 in 155 156 Term.( 156 157 const 157 - (fun 158 - warn_error 159 - print_warnings 160 - enable_missing_root_warning 161 - warnings_tag 162 - -> 158 + (fun warn_error print_warnings enable_missing_root_warning warnings_tag -> 163 159 Odoc_model.Error.enable_missing_root_warning := 164 160 enable_missing_root_warning; 165 161 { Odoc_model.Error.warn_error; print_warnings; warnings_tag }) 166 - $ warn_error $ print_warnings $ enable_missing_root_warning 167 - $ warnings_tag) 162 + $ warn_error $ print_warnings $ enable_missing_root_warning $ warnings_tag) 168 163 169 164 let dst ?create () = 170 165 let doc = "Output directory where the HTML tree is expected to be saved." in ··· 716 711 717 712 let warnings_tags = 718 713 let doc = 719 - "Warnings tags. Only report warnings in references that have been compiled \ 720 - with these specific tags. Can be passed multiple times." 714 + "Warnings tags. Only report warnings in references that have been \ 715 + compiled with these specific tags. Can be passed multiple times." 721 716 in 722 717 let env = Arg.env_var "ODOC_WARNINGS_TAGS" ~doc in 723 718 Arg.(value & opt_all string [] & info ~docs ~doc ~env [ "warnings-tags" ]) 724 719 725 720 let link directories page_roots lib_roots input_file output_file 726 - current_package warnings_options open_modules custom_layout warnings_tags = 721 + current_package warnings_options open_modules custom_layout warnings_tags 722 + = 727 723 let input = Fs.File.of_string input_file in 728 724 let output = get_output_file ~output_file ~input in 729 725 let check () = ··· 751 747 let resolver = 752 748 Resolver.create ~important_digests:false ~directories ~open_modules ~roots 753 749 in 754 - match Odoc_link.from_odoc ~resolver ~warnings_options ~warnings_tags input output with 750 + match 751 + Odoc_link.from_odoc ~resolver ~warnings_options ~warnings_tags input 752 + output 753 + with 755 754 | Error _ as e -> e 756 755 | Ok _ -> Ok () 757 756 ··· 815 814 Term.( 816 815 const handle_error 817 816 $ (const link $ odoc_file_directories $ page_roots $ lib_roots $ input 818 - $ dst $ current_package $ warnings_options $ open_modules $ custom_layout $ warnings_tags 819 - )) 817 + $ dst $ current_package $ warnings_options $ open_modules $ custom_layout 818 + $ warnings_tags)) 820 819 821 820 let info ~docs = 822 821 let man =
+2 -2
src/odoc/compile.ml
··· 400 400 let result = 401 401 Error.catch_errors_and_warnings (fun () -> 402 402 resolve_and_substitute ~resolver ~make_root ~hidden 403 - ~warnings_tag:warnings_options.warnings_tag parent_id 404 - input input_type) 403 + ~warnings_tag:warnings_options.warnings_tag parent_id input 404 + input_type) 405 405 in 406 406 (* Extract warnings to write them into the output file *) 407 407 let _, warnings = Error.unpack_warnings result in
+1 -1
src/odoc/odoc_link.ml
··· 56 56 items = content_for_hidden_modules; 57 57 compiled = false; 58 58 removed = []; 59 - doc = { elements = []; warnings_tag = None}; 59 + doc = { elements = []; warnings_tag = None }; 60 60 }; 61 61 expansion = None; 62 62 }
+2 -1
src/odoc/rendering.ml
··· 33 33 34 34 let document_of_input ~resolver ~warnings_options ~syntax input = 35 35 let output = Fs.File.(set_ext ".odocl" input) in 36 - Odoc_link.from_odoc ~resolver ~warnings_options ~warnings_tags:[] input output >>= function 36 + Odoc_link.from_odoc ~resolver ~warnings_options ~warnings_tags:[] input output 37 + >>= function 37 38 | `Page page -> Ok (Renderer.document_of_page ~syntax page) 38 39 | `Module m -> Ok (Renderer.document_of_compilation_unit ~syntax m) 39 40 | `Impl _ ->
+1 -5
src/odoc/url.ml
··· 8 8 let reference = 9 9 let open Odoc_model in 10 10 let warnings_options = 11 - { 12 - Error.warn_error = true; 13 - print_warnings = true; 14 - warnings_tag = None; 15 - } 11 + { Error.warn_error = true; print_warnings = true; warnings_tag = None } 16 12 in 17 13 Semantics.parse_reference reference 18 14 |> Error.handle_errors_and_warnings ~warnings_options
+2 -3
src/xref2/env.ml
··· 174 174 } 175 175 176 176 let should_suppress_warnings env opt = 177 - match opt with 178 - | None -> false 179 - | Some x -> not (List.mem x env.warnings_tags) (* Suppress warnings unless the tag is in the list *) 177 + match opt with None -> false | Some x -> not (List.mem x env.warnings_tags) 178 + (* Suppress warnings unless the tag is in the list *) 180 179 181 180 let set_warnings_tags env tags = { env with warnings_tags = tags } 182 181
+15 -20
src/xref2/link.ml
··· 232 232 p) 233 233 234 234 let rec comment_inline_element : 235 - loc:_ -> Env.t -> string option -> Comment.inline_element -> Comment.inline_element = 235 + loc:_ -> 236 + Env.t -> 237 + string option -> 238 + Comment.inline_element -> 239 + Comment.inline_element = 236 240 fun ~loc:_ env warnings_tag x -> 237 241 match x with 238 242 | `Styled (s, ls) -> 239 243 `Styled 240 244 ( s, 241 - List.map 242 - (with_location (comment_inline_element env warnings_tag)) 243 - ls ) 245 + List.map (with_location (comment_inline_element env warnings_tag)) ls 246 + ) 244 247 | `Reference (r, content) as orig -> ( 245 248 match 246 249 maybe_suppress env warnings_tag (fun () -> ··· 287 290 let map f x = List.rev_map f x |> List.rev in 288 291 map 289 292 (map (fun (cell, cell_type) -> 290 - ( comment_nestable_block_element_list env warnings_tag 291 - parent cell, 293 + ( comment_nestable_block_element_list env warnings_tag parent cell, 292 294 cell_type ))) 293 295 data 294 296 in ··· 335 337 and comment_nestable_block_element_list env warnings_tag parent 336 338 (xs : Comment.nestable_block_element Comment.with_location list) = 337 339 List.rev_map 338 - (with_location 339 - (comment_nestable_block_element env warnings_tag parent)) 340 + (with_location (comment_nestable_block_element env warnings_tag parent)) 340 341 xs 341 342 |> List.rev 342 343 ··· 344 345 match x with 345 346 | `Deprecated content -> 346 347 `Deprecated 347 - (comment_nestable_block_element_list env warnings_tag parent 348 - content) 348 + (comment_nestable_block_element_list env warnings_tag parent content) 349 349 | `Param (name, content) -> 350 350 `Param 351 351 ( name, 352 - comment_nestable_block_element_list env warnings_tag parent 353 - content ) 352 + comment_nestable_block_element_list env warnings_tag parent content ) 354 353 | `Raise ((`Reference (r, reference_content) as orig), content) -> ( 355 354 match 356 355 maybe_suppress env warnings_tag (fun () -> ··· 372 371 | `Raise ((`Code_span _ as orig), content) -> 373 372 `Raise 374 373 ( orig, 375 - comment_nestable_block_element_list env warnings_tag parent 376 - content ) 374 + comment_nestable_block_element_list env warnings_tag parent content ) 377 375 | `Return content -> 378 376 `Return 379 - (comment_nestable_block_element_list env warnings_tag parent 380 - content) 377 + (comment_nestable_block_element_list env warnings_tag parent content) 381 378 | `See (kind, target, content) -> 382 379 `See 383 380 ( kind, 384 381 target, 385 - comment_nestable_block_element_list env warnings_tag parent 386 - content ) 382 + comment_nestable_block_element_list env warnings_tag parent content ) 387 383 | `Before (version, content) -> 388 384 `Before 389 385 ( version, 390 - comment_nestable_block_element_list env warnings_tag parent 391 - content ) 386 + comment_nestable_block_element_list env warnings_tag parent content ) 392 387 | `Author _ | `Since _ | `Alert _ | `Version _ -> 393 388 x (* only contain primitives *) 394 389