View Source mix doctor.explain (Doctor v0.21.0)

Figuring out why a particular module failed Doctor validation can sometimes be a bit difficult when the relevant information is embedded within a table with other validation results.

The mix doctor.explain command has only a single required argument. That argument is the name of the module that you wish to get a detailed report of. For example you could run the following from the terminal:

$ mix doctor.explain MyApp.Some.Module

To generate a report like this:

Doctor file found. Loading configuration.

Function            @doc  @spec
-------------------------------
generate_report/2        

Module Results:
  Doc Coverage:    0.0%  --> Your config has a 'min_module_doc_coverage' value of 80
  Spec Coverage:   0.0%
  Has Module Doc:  
  Has Struct Spec: N/A

In addition, the following CLI flags are supported (similarly to the mix doctor command):

--config-file  Provide a relative or absolute path to a `.doctor.exs`
               file to use during the execution of the mix command.

--raise        If any of your modules fails Doctor validation, then
               raise an error and return a non-zero exit status.

To use these command line args you would do something like so:

$ mix doctor.explain --raise --config_file /some/path/to/some/.doctor.exs MyApp.Some.Module

Note that mix doctor.explain takes a module name instead of a file path since you can define multiple modules in a single file.