oct.formatter package#
Formatter module for OCT.
Purpose#
Provides auto-fixing capabilities for Option C compliance violations.
Responsibilities#
Export the main formatter entry point (run_formatter).
Enable CLI integration of the formatter command.
Diagnostics#
Domain: OCT.FORMATTER Levels:
L2 — formatter lifecycle and command execution L3 — file processing and fix application L4 — detailed fixer operation (header, docstring, import, func pattern)
Contracts#
All public exports are guaranteed to be importable from this module.
- oct.formatter.run_formatter(project_root: Path, argv: List[str] | None = None) None[source]#
Run the Option C formatter on the given project root.
- Parameters:
project_root (Path) – The detected Option C project root directory.
argv (list[str] | None) – Optional list of command-line arguments. If None, argparse will use sys.argv[1:].
Submodules#
- oct.formatter.oct_format module
- Purpose
- Responsibilities
- Diagnostics
- Contracts
- Dependencies
FormatterContextFormatterContext.diagnostics_dirFormatterContext.docs_dirFormatterContext.dry_run_modeFormatterContext.fix_modeFormatterContext.json_modeFormatterContext.max_archive_bytesFormatterContext.max_backups_per_fileFormatterContext.project_nameFormatterContext.project_rootFormatterContext.tests_dirFormatterContext.verbose
compute_summary()fix_dbg_import()fix_docstring()fix_func_pattern()fix_header_block()format_file()run_formatter()