akoutmos / doctor

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

Allow doctor.explain to work in umbrella apps #49

Closed randycoulman closed 2 years ago

randycoulman commented 2 years ago

Resolves #26

Modifies mix doctor.explain so that it will work in umbrella apps.

As with mix doctor, this starts up an accumulator agent for umbrella apps and collects the results from each application in the umbrella.

If the module is not found in any of the apps, the standard "Could not find module" exception is raised.

If the module is found in one or more of the apps, then tne final result is true if it was true in each of the apps where it was found and false otherwise.

It seems very unlikely that the same module would be found in multiple apps, but this implementation supports that in case it happens.

To make this work more cleanly, CLI.generate_single_module_report returns :not_found if the module wasn't found rather than immediately raising an exception. This allows the doctor.explain task to capture the result and raise the exception later, if necessary.

akoutmos commented 2 years ago

Thanks for the contribution! Really appreciate it :)