Ex_doc: `:skip_undefined_reference_warnings_on` not working for given module?

Created on 22 Dec 2020  路  4Comments  路  Source: elixir-lang/ex_doc

Deps:

$ MIX_ENV=docs mix deps
* connection 1.0.4 (Hex package) (mix)
  locked at 1.0.4 (connection) 4a0850c9
  ok
* db_connection 2.2.2 (Hex package) (mix)
  locked at 2.2.2 (db_connection) 642af240
  ok
* decimal 1.9.0 (Hex package) (mix)
  locked at 1.9.0 (decimal) b1f23435
  ok
+* earmark_parser 1.4.10 (Hex package) (mix)
+ locked at 1.4.10 (earmark_parser) 8e2d5370
+  ok
* ecto 3.5.2 (Hex package) (mix)
  locked at 3.5.2 (ecto) fd92cfb1
  ok
+* ex_doc 0.23.0 (Hex package) (mix)
+locked at 0.23.0 (ex_doc) f5e2c470
+ok
* jason 1.2.2 (Hex package) (mix)
  locked at 1.2.2 (jason) 18a228f5
  ok
* makeup 1.0.5 (Hex package) (mix)
  locked at 1.0.5 (makeup) cfa158c0
  ok
* makeup_elixir 0.15.0 (Hex package) (mix)
  locked at 0.15.0 (makeup_elixir) 75ffa34a
  ok
* myxql 0.3.3 (Hex package) (mix)
  locked at 0.3.3 (myxql) a9466d83
  ok
* nimble_parsec 1.1.0 (Hex package) (mix)
  locked at 1.1.0 (nimble_parsec) 08eb32d6
  ok
* postgrex 0.15.5 (Hex package) (mix)
  locked at 0.15.5 (postgrex) ed90c81e
  ok
* tds 2.1.1 (Hex package) (mix)
  locked at 2.1.1 (tds) 6b28e1f0
  ok
* telemetry 0.4.2 (Hex package) (rebar3)
  locked at 0.4.2 (telemetry) 2d1419bd
  ok

Actual:

Steps to reproduce:

  1. git clone https://github.com/elixir-ecto/ecto_sql.git
  2. mix deps.get
  3. Update mix.exs and add this line 177:
  176       source_url: "https://github.com/elixir-ecto/ecto_sql", 
+ 177       skip_undefined_reference_warnings_on: ["DBConnection.ConnectionPool"], 
  178       groups_for_modules: [
  1. MIX_ENV=docs mix docs
Generating docs...
warning: documentation references module "DBConnection.ConnectionPool" but it is hidden
  lib/ecto/adapters/myxql.ex:2: Ecto.Adapters.MyXQL

warning: documentation references module "DBConnection.ConnectionPool" but it is hidden
  lib/ecto/adapters/postgres.ex:2: Ecto.Adapters.Postgres

warning: documentation references module "DBConnection.ConnectionPool" but it is hidden
  lib/ecto/adapters/tds.ex:2: Ecto.Adapters.Tds

View "html" docs at "doc/index.html"
warning: documentation references module "DBConnection.ConnectionPool" but it is hidden
  lib/ecto/adapters/myxql.ex:2: Ecto.Adapters.MyXQL

warning: documentation references module "DBConnection.ConnectionPool" but it is hidden
  lib/ecto/adapters/postgres.ex:2: Ecto.Adapters.Postgres

warning: documentation references module "DBConnection.ConnectionPool" but it is hidden
  lib/ecto/adapters/tds.ex:2: Ecto.Adapters.Tds

View "epub" docs at "doc/Ecto SQL.epub"

Expected:

MIX_ENV=docs mix docs
Generating docs...
View "html" docs at "doc/index.html"
View "epub" docs at "doc/Ecto SQL.epub"

Did I use the :skip_undefined_reference_warnings_on option incorrectly or is it a bug?

All 4 comments

Hi @kianmeng,
could you please update ex_doc to the lastest version ("~> 0.23") and see if the issue still happens

There are two issues.

  1. there is already a key named :skip_undefined_reference_warnings_on in that keywordlist, it is just on line 179.
  2. :skip_undefined_reference_warnings_on does not work for modules you link to as in this case, but for modules you link from. If you add Ecto.Adapters.Postgres you will see the warning is gone.

This was previously proposed in https://github.com/elixir-lang/ex_doc/issues/1192 and had a PR https://github.com/elixir-lang/ex_doc/pull/1249 but it didn't make its way in.

@eksperimental, Awesome! Thanks for clarifying my misunderstanding of the :skip_undefined_reference_warnings_on option and shared the historical context of :skip_reference_warnings_for option. :+1: :+1:

Was this page helpful?
0 / 5 - 0 ratings