Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning duplication #1127

Open
dlesbre opened this issue May 22, 2024 · 3 comments
Open

Warning duplication #1127

dlesbre opened this issue May 22, 2024 · 3 comments

Comments

@dlesbre
Copy link

dlesbre commented May 22, 2024

Odoc duplicates warnings when a module type appears multiple times.

module type S = sig
  val foo : int -> int
  (** This raises a warning because odoc can't find Not_found
        @raises Not_found *)
end

module X : S (* warning appears a second time *)

module type S' = sig
  include S (* warning appears a third time *)
end

module Y : S' (* warning appears a fourth time *)

This clogs output. For reference on how bad it gets, I have a library with 9 @raises Not_found in the mli. This creates 188 warnings (376 lines).

@jonludlam
Copy link
Member

Thanks for this! Yes, we can fix this.

I had a go with your library and it does indeed show many warnings. I wondered if you had tried dune build @doc-new? At least then the warnings are only for the unresolved references in your own docs, though there's still duplication due to the includes.

@jonludlam
Copy link
Member

I should say, we can fix this within files, but not between. That is, if you have an unresolved reference in one toplevel module, and then it's included in another toplevel module, you'll see the warning twice. In most instances this won't be a huge problem though as references are only resolved at link time, and if your library is wrapped there will only be one toplevel module and hence only one call to link is required.

@dlesbre
Copy link
Author

dlesbre commented May 26, 2024

I had a go with your library and it does indeed show many warnings. I wondered if you had tried dune build @doc-new? At least then the warnings are only for the unresolved references in your own docs, though there's still duplication due to the includes.

I didn't know about @doc-new, however, trying it on my package doesn't seem to be an improvement... I no longer have issues with warnings for missing Stdlib reference, but I suddenly get a ton of warnings for unresolved links within my own package. These links are all correct (they generate no warning with @doc, and even when building with @doc-new, as far as I can tell, the generated docs also has all the correct links despite outputting warnings...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants