akoutmos / doctor

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

Incorrect data gathering for nested modules #40

Closed adamwight closed 2 years ago

adamwight commented 3 years ago

I'm new to Elixir so probably making some kind of fundamental mistake. But what I see is that inner modules are not tracked correctly, and functions and docs get jumbled between the two. I'm attaching a minimal test case to demonstrate what I've found:

doctor_inner_module_glitch.zip

Doctor should report 100% doc coverage, instead shows 50%:

mix doctor

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------                  
Doc Cov  Spec Cov  Module                                   File                                                      Functions  No Docs  No Specs  Module Doc  Struct Spec                  
N/A      N/A       Doctor.BugDemo.NestedGlitch.Inner        lib/doctor_nested_module_glitch.ex                        0          0        0         Yes         N/A                          
50%      50%       Doctor.BugDemo.NestedGlitch              lib/doctor_nested_module_glitch.ex                        2          1        1         Yes         N/A                          
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------                  
andrewcarter commented 3 years ago

+1 Running into the same issue. Any workarounds?

akoutmos commented 3 years ago

Hey @andrewcarter (and sorry @adamwight for not responding sooner). Just saw this issue πŸ˜“

I'm not 100% sure as to why this is occurring, but if I were to guess, I would say that it is a case I probably have not considered in my parser when I traverse the AST. To be 100% honest, I'm a bit swamped at the moment and probably won't be able to look into this for the next couple weeks, but now that I know this issue is here, it's on my radar.

If you either of you is feeling adventurous enough to dig into the problem, I'd be more than willing to take a look at a PR and provide guidance though πŸ˜„.

Thanks!