mix lazy_doc.check (LazyDoc v0.5.0)

## Main functionality

The module Mix.Tasks.LazyDoc.Check is designed to facilitate the checking of documentation for functions and modules within a codebase using the LazyDoc application.

## Description

It initializes the LazyDoc application, identifies undocumented functions and modules across specified files, and exits with an appropriate status code based on the presence of undocumented elements. Warnings are logged for any undocumented functions and modules encountered during the check.

Summary

Functions

Parameters

  • entry_functions - a list of functions categorized by module.
  • file - the file in which the modules and functions are defined.

Description

Iterates through the provided list of entry functions, checks for undocumented functions, and prints warnings if any are found.

Parameters

  • modules - a list of tuples containing module names and their associated metadata.
  • file - a string representing the file name where undocumented modules are found.

Description

Logs a warning for each undocumented module and the corresponding file.

Parameters

  • functions - a list of functions to be checked for documentation.
  • mod - the name of the module containing the functions.
  • file - the name of the file where the module is defined.

Description

Logs a warning for each function in the provided list that lacks documentation and logs the filename containing the module.

Parameters

  • _command_line_args - command line arguments passed to the function.

Description

Initializes the LazyDoc application, runs a Mix task to load the application configuration, and extracts data from files to check for undocumented functions and modules.

Functions

get_undocumented_functions(entry_functions, file)

Parameters

  • entry_functions - a list of functions categorized by module.
  • file - the file in which the modules and functions are defined.

Description

Iterates through the provided list of entry functions, checks for undocumented functions, and prints warnings if any are found.

Returns

a list of modules containing undocumented functions.

get_undocumented_modules(modules, file)

Parameters

  • modules - a list of tuples containing module names and their associated metadata.
  • file - a string representing the file name where undocumented modules are found.

Description

Logs a warning for each undocumented module and the corresponding file.

Returns

true if there are undocumented modules, otherwise false.

run(command_line_args)

Parameters

  • _command_line_args - command line arguments passed to the function.

Description

Initializes the LazyDoc application, runs a Mix task to load the application configuration, and extracts data from files to check for undocumented functions and modules.

Returns

exits with a status code indicating the presence of undocumented code (1 for undocumented, 0 for none).