mix lazy_doc.check (LazyDoc v0.6.2)

View Source

The module Mix.Tasks.LazyDoc.Check provides a mix task for checking the documentation status of functions and modules within a project.

Description

This module is designed to facilitate the documentation process in Elixir projects by identifying undocumented functions and modules. It functions as part of the LazyDoc toolset, which aims to improve code documentation practices. When the task is executed, it starts the LazyDoc application, extracts relevant data from files, and checks for any undocumented functions or modules. It logs warnings for each undocumented function in a module and for each undocumented module, and subsequently determines whether the documentation is complete or not, exiting with an appropriate status based on its findings. The use of this module encourages developers to maintain well-documented code, enhancing overall code quality and maintainability.

Summary

Functions

Returns a list of modules that contain undocumented functions.

Returns true if undocumented modules are found; otherwise, it returns false.

Returns a warning log for undocumented functions in a specified module.

Returns the exit status of the application based on the presence of undocumented functions or modules.

Functions

get_undocumented_functions(entry_functions, file)

Returns a list of modules that contain undocumented functions.

Parameters

  • entry_functions - a list of tuples containing module information and their respective function ASTs.
  • file - the file name where the functions are being analyzed.

Description

Iterates over the entry functions and prints warnings for undocumented functions.

get_undocumented_modules(modules, file)

Returns true if undocumented modules are found; otherwise, it returns false.

Parameters

  • modules - a list of modules to check for documentation.
  • file - the name of the file being analyzed for undocumented modules.

Description

Logs warnings for each undocumented module along with the associated file name.

run(args)

Returns the exit status of the application based on the presence of undocumented functions or modules.

Parameters

  • _command_line_args - the command line arguments passed to the function.

Description

Initializes the application, runs the Mix task for configuration, and checks for undocumented functions and modules in extracted data.