Reports

Base

class markdown_checker.reports.base.GeneratorBase

Bases: ABC

Base class for all report generators.

current_dir: Path
templates: dict[str, str]
abstractmethod generate(function_name, formatted_output)

Generate a report based on the formatted output.

Parameters:
  • function_name (str)

  • formatted_output (str)

Return type:

None

Markdown

class markdown_checker.reports.markdown.MarkdownGenerator(contributing_guide_url=None, output_file_name='comment')

Bases: GeneratorBase

Parameters:
  • contributing_guide_url (str | None)

  • output_file_name (str)

current_dir: Path = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/markdown-checker/checkouts/latest/src/markdown_checker/reports')
generate(function_name, formatted_output)

Generate a markdown report based on the formatted output.

Args:

function_name (str): The name of the function to determine the header for the markdown file. formatted_output (str): The formatted output to be written to the markdown file.

Parameters:
  • function_name (str)

  • formatted_output (str)

Return type:

None

Format Output

Module to format check results into markdown output.

Formats a List of links into a string with numbered bullets.

Args:

links (list[MarkdownLinkBase]): The list of links to format. output_mode: “ci” omits file links; “local” includes clickable links.

Returns:

formatted_links (str): The formatted string with numbered bullets.

Parameters:
Return type:

str

markdown_checker.reports.format_output.format_issues_table(file_issues, output_mode='local')

Format all per-file issues into a complete markdown table.

Args:

file_issues: List of (file_path, issues) tuples. output_mode: “ci” omits file links; “local” includes clickable links.

Returns:

A markdown table string with header and all rows.

Parameters:
Return type:

str