akoutmos / doctor

Ensure that your Elixir project documentation is healthy
MIT License
179 stars 15 forks source link

False positive for `Doc Cov` with Elixir 1.12+ #41

Open aifrak opened 3 years ago

aifrak commented 3 years ago

Hi,

I have noticed that mix doctor shows false positive for Elixir 1.12+ when I was trying to add doctor to my project.

To be sure the issue is not comming from my project or a custom .doctor.exs, I have tried with different versions of Elixir and Erlang by testing with the Phoenix project on the master branch without any .doctor.exs.

In the example below, the files lib/phoenix/code_reloader/proxy.ex, lib/phoenix/code_reloader/server.ex and lib/phoenix/config.ex should not have Doc Cov to 100%.

What we get when running mix doctor with Elixir 1.12+:

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Doc Cov  Spec Cov  Module                                   File                                                      Functions  No Docs  No Specs  Module Doc  Struct Spec
...
100%     0%        Phoenix.CodeReloader                     lib/phoenix/code_reloader.ex                              2          0        2         Yes         N/A        
100%     0%        Phoenix.CodeReloader.Proxy               lib/phoenix/code_reloader/proxy.ex                        5          0        5         Yes         N/A        
100%     0%        Phoenix.CodeReloader.Server              lib/phoenix/code_reloader/server.ex                       8          0        8         Yes         N/A        
100%     20%       Phoenix.Config                           lib/phoenix/config.ex                                     10         0        8         Yes         N/A        
100%     51%       Phoenix.Controller                       lib/phoenix/controller.ex          
...

Results obtained with those versions:


What we should expect when running mix doctor:

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Doc Cov  Spec Cov  Module                                   File                                                      Functions  No Docs  No Specs  Module Doc  Struct Spec
...
100%     0%        Phoenix.CodeReloader                     lib/phoenix/code_reloader.ex                              2          0        2         Yes         N/A        
40%      0%        Phoenix.CodeReloader.Proxy               lib/phoenix/code_reloader/proxy.ex                        5          3        5         Yes         N/A        
50%      0%        Phoenix.CodeReloader.Server              lib/phoenix/code_reloader/server.ex                       8          4        8         Yes         N/A        
90%      20%       Phoenix.Config                           lib/phoenix/config.ex                                     10         1        8         Yes         N/A        
100%     51%       Phoenix.Controller                       lib/phoenix/controller.ex 
...

Results obtained with those versions:

akoutmos commented 3 years ago

Thanks for opening up this issue. I'll have to take a look at what has changed in Elixir 1.12 that would have caused this. Looking through the Elixir source code for 1.12, it doesn't look like fetch_docs has changed much :thinking:

elliotb commented 2 years ago

This appears to no longer be an issue in Elixir 1.13.

aifrak commented 2 years ago

I confirm what @elliotb wrote: no issue in Elixir 1.13.

Tested on the Phoenix project with Elixir 1.13.0 and Erlang 24.0.5 and 24.1.7.

akoutmos commented 2 years ago

That's great to hear! Still kinda concerning that I wasn't able to find a root cause for 1.12 though...