Skip to content

Non-exported type from EDoc chunk shows in documentation if used in internal function spec #2169

@g-andrade

Description

@g-andrade

Following what I thought was a bug in rebar3_ex_doc but managed to reproduce using only EDoc + ExDoc.

  • ExDoc version: 0.39.1
  • Elixir version: 1.18.4
  • OTP version: 27.3.4.5
  • rebar3 version: 3.25.1

Example

Image

^ The only difference between these two modules is that the first declares a -moduledoc attribute instead of a @doc tag. From my investigation, this appears to make ExDoc no longer depend on the separate EDoc chunk - even when I deleted it, the module showed in the docs.

Looking at documentation data differences

Running Code.fetch_docs/1 for both modules returns very different data.

Image

I can't tell if the root cause is that the EDoc chunk file has more data than it should, or if it's in how ExDoc filters that data.

Demo app

mix_test.zip contains a Mix library that reproduces the issue with the following commands (or make doc):

mix compile
rebar3 as dev edoc # produces the chunk required for the bad module to show in the docs
ex_doc "mix_test" "0.0.0" _build/dev/lib/mix_test/ebin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions