Report Formatter

Report Formatting for Copcon.

This module provides functionality to format the directory structure and file contents into a comprehensive report.

class copcon.core.report.ReportFormatter(project_name, directory_tree, file_contents)

Bases: object

Formats the directory structure and file contents into a structured report.

format()

Format the report as a string.

Returns:

The formatted report.

Return type:

str

write_to_file(report, output_file)

Write the formatted report to a file.

Parameters:
  • report (str) – The formatted report to write.

  • output_file (Path) – The path to the output file.

Raises:

Exception – If there is an error writing to the file.