···7171 in
7272 Compile.init_stats units;
7373 let compiled = Compile.compile ~partial_dir:odoc_dir units in
7474- let linked = Compile.link ~warnings_tags:packages ~custom_layout:false compiled in
7474+ let linked =
7575+ Compile.link ~warnings_tags:packages ~custom_layout:false compiled
7676+ in
7577 let occurrence_file =
7678 let output =
7779 Fpath.( / ) odoc_dir "occurrences-all.odoc-occurrences"
+3-1
src/driver/bin/odoc_driver_monorepo.ml
···4949 in
5050 Compile.init_stats units;
5151 let compiled = Compile.compile ~partial_dir:odoc_dir units in
5252- let linked = Compile.link ~warnings_tags:[] ~custom_layout:true compiled in
5252+ let linked =
5353+ Compile.link ~warnings_tags:[] ~custom_layout:true compiled
5454+ in
5355 let occurrence_file =
5456 let output =
5557 Fpath.( / ) odoc_dir "occurrences-all.odoc-occurrences"
+4-1
src/driver/bin/odoc_driver_voodoo.ml
···8989 match actions with
9090 | CompileOnly -> ()
9191 | LinkAndGen | All ->
9292- let linked = Compile.link ~warnings_tags:[package_name] ~custom_layout:false compiled in
9292+ let linked =
9393+ Compile.link ~warnings_tags:[ package_name ] ~custom_layout:false
9494+ compiled
9595+ in
9396 let occurrence_file =
9497 let output =
9598 Fpath.( / ) odoc_dir "occurrences-all.odoc-occurrences"
+3-3
src/driver/compile.ml
···144144 in
145145 Odoc.compile ~output_dir:unit.output_dir
146146 ~input_file:unit.input_file ~includes
147147- ~warnings_tag:unit.pkgname
148148- ~parent_id:unit.parent_id;
147147+ ~warnings_tag:unit.pkgname ~parent_id:unit.parent_id;
149148 Atomic.incr Stats.stats.compiled_units;
150149151150 unit)
···244243245244type linked = Odoc_unit.any
246245247247-let link : warnings_tags:string list -> custom_layout:bool -> compiled list -> _ =
246246+let link : warnings_tags:string list -> custom_layout:bool -> compiled list -> _
247247+ =
248248 fun ~warnings_tags ~custom_layout compiled ->
249249 let link : compiled -> linked =
250250 fun c ->
+5-1
src/driver/compile.mli
···12121313type linked
14141515-val link : warnings_tags:string list -> custom_layout:bool -> compiled list -> linked list
1515+val link :
1616+ warnings_tags:string list ->
1717+ custom_layout:bool ->
1818+ compiled list ->
1919+ linked list
16201721val html_generate :
1822 occurrence_file:Fpath.t ->
+8-5
src/driver/odoc.ml
···3636 | [ (_, digest) ], deps -> Ok { digest; deps }
3737 | _ -> Error (`Msg "odd")
38383939-let compile ~output_dir ~input_file:file ~includes ~warnings_tag ~parent_id
4040- =
3939+let compile ~output_dir ~input_file:file ~includes ~warnings_tag ~parent_id =
4140 let open Cmd in
4241 let includes =
4342 Fpath.Set.fold
···5453 %% includes % "--enable-missing-root-warning"
5554 in
5655 let cmd = cmd % "--parent-id" % Id.to_string parent_id in
5757- let cmd = match warnings_tag with None -> cmd | Some tag -> cmd % "--warnings-tag" % tag in
5656+ let cmd =
5757+ match warnings_tag with
5858+ | None -> cmd
5959+ | Some tag -> cmd % "--warnings-tag" % tag
6060+ in
5861 let desc = Printf.sprintf "Compiling %s" (Fpath.to_string file) in
5962 ignore
6063 @@ Cmd_outputs.submit
···161164 if Fpath.to_string file = "stdlib.odoc" then cmd % "--open=\"\"" else cmd
162165 in
163166 let cmd =
164164- List.fold_left (fun acc k -> acc % "--warnings-tags" % k) cmd
165165- warnings_tags in
167167+ List.fold_left (fun acc k -> acc % "--warnings-tags" % k) cmd warnings_tags
168168+ in
166169 let desc = Printf.sprintf "Linking %s" (Fpath.to_string file) in
167170 let cmd = if custom_layout then cmd % "--custom-layout" else cmd in
168171 let log =
···144144 in
145145 let warnings_tag =
146146 let doc =
147147- "Warnings tag. This is useful when you want to declare that \
148148- warnings that would be generated resolving the references defined in \
149149- this unit should be ignored if they end up in expansions in other \
150150- units. When linking, only warnings with specified tags are reported."
147147+ "Warnings tag. This is useful when you want to declare that warnings \
148148+ that would be generated resolving the references defined in this unit \
149149+ should be ignored if they end up in expansions in other units. When \
150150+ linking, only warnings with specified tags are reported."
151151 in
152152 let env = Arg.env_var "ODOC_WARNINGS_TAG" ~doc in
153153- Arg.(value & opt (some string) None & info ~docs ~doc ~env [ "warnings-tag" ])
153153+ Arg.(
154154+ value & opt (some string) None & info ~docs ~doc ~env [ "warnings-tag" ])
154155 in
155156 Term.(
156157 const
157157- (fun
158158- warn_error
159159- print_warnings
160160- enable_missing_root_warning
161161- warnings_tag
162162- ->
158158+ (fun warn_error print_warnings enable_missing_root_warning warnings_tag ->
163159 Odoc_model.Error.enable_missing_root_warning :=
164160 enable_missing_root_warning;
165161 { Odoc_model.Error.warn_error; print_warnings; warnings_tag })
166166- $ warn_error $ print_warnings $ enable_missing_root_warning
167167- $ warnings_tag)
162162+ $ warn_error $ print_warnings $ enable_missing_root_warning $ warnings_tag)
168163169164let dst ?create () =
170165 let doc = "Output directory where the HTML tree is expected to be saved." in
···716711717712 let warnings_tags =
718713 let doc =
719719- "Warnings tags. Only report warnings in references that have been compiled \
720720- with these specific tags. Can be passed multiple times."
714714+ "Warnings tags. Only report warnings in references that have been \
715715+ compiled with these specific tags. Can be passed multiple times."
721716 in
722717 let env = Arg.env_var "ODOC_WARNINGS_TAGS" ~doc in
723718 Arg.(value & opt_all string [] & info ~docs ~doc ~env [ "warnings-tags" ])
724719725720 let link directories page_roots lib_roots input_file output_file
726726- current_package warnings_options open_modules custom_layout warnings_tags =
721721+ current_package warnings_options open_modules custom_layout warnings_tags
722722+ =
727723 let input = Fs.File.of_string input_file in
728724 let output = get_output_file ~output_file ~input in
729725 let check () =
···751747 let resolver =
752748 Resolver.create ~important_digests:false ~directories ~open_modules ~roots
753749 in
754754- match Odoc_link.from_odoc ~resolver ~warnings_options ~warnings_tags input output with
750750+ match
751751+ Odoc_link.from_odoc ~resolver ~warnings_options ~warnings_tags input
752752+ output
753753+ with
755754 | Error _ as e -> e
756755 | Ok _ -> Ok ()
757756···815814 Term.(
816815 const handle_error
817816 $ (const link $ odoc_file_directories $ page_roots $ lib_roots $ input
818818- $ dst $ current_package $ warnings_options $ open_modules $ custom_layout $ warnings_tags
819819- ))
817817+ $ dst $ current_package $ warnings_options $ open_modules $ custom_layout
818818+ $ warnings_tags))
820819821820 let info ~docs =
822821 let man =
+2-2
src/odoc/compile.ml
···400400 let result =
401401 Error.catch_errors_and_warnings (fun () ->
402402 resolve_and_substitute ~resolver ~make_root ~hidden
403403- ~warnings_tag:warnings_options.warnings_tag parent_id
404404- input input_type)
403403+ ~warnings_tag:warnings_options.warnings_tag parent_id input
404404+ input_type)
405405 in
406406 (* Extract warnings to write them into the output file *)
407407 let _, warnings = Error.unpack_warnings result in
···33333434let document_of_input ~resolver ~warnings_options ~syntax input =
3535 let output = Fs.File.(set_ext ".odocl" input) in
3636- Odoc_link.from_odoc ~resolver ~warnings_options ~warnings_tags:[] input output >>= function
3636+ Odoc_link.from_odoc ~resolver ~warnings_options ~warnings_tags:[] input output
3737+ >>= function
3738 | `Page page -> Ok (Renderer.document_of_page ~syntax page)
3839 | `Module m -> Ok (Renderer.document_of_compilation_unit ~syntax m)
3940 | `Impl _ ->
+1-5
src/odoc/url.ml
···88 let reference =
99 let open Odoc_model in
1010 let warnings_options =
1111- {
1212- Error.warn_error = true;
1313- print_warnings = true;
1414- warnings_tag = None;
1515- }
1111+ { Error.warn_error = true; print_warnings = true; warnings_tag = None }
1612 in
1713 Semantics.parse_reference reference
1814 |> Error.handle_errors_and_warnings ~warnings_options
+2-3
src/xref2/env.ml
···174174}
175175176176let should_suppress_warnings env opt =
177177- match opt with
178178- | None -> false
179179- | Some x -> not (List.mem x env.warnings_tags) (* Suppress warnings unless the tag is in the list *)
177177+ match opt with None -> false | Some x -> not (List.mem x env.warnings_tags)
178178+(* Suppress warnings unless the tag is in the list *)
180179181180let set_warnings_tags env tags = { env with warnings_tags = tags }
182181