Option C Tools
Loading...
Searching...
No Matches
oct_format.py File Reference

Go to the source code of this file.

Classes

class  oct.formatter.oct_format.FormatterContext

Namespaces

namespace  oct
namespace  oct.formatter
namespace  oct.formatter.oct_format

Functions

list[Path] oct.formatter.oct_format._git_changed_files (Path root)
str oct.formatter.oct_format._get_relative_path (Path path, Path root)
int oct.formatter.oct_format._prune_archive (Path archive_dir, str original_name, int max_backups)
int oct.formatter.oct_format._prune_archive_by_size (Path archive_dir, int max_total_bytes)
None oct.formatter.oct_format._archive_file (Path path, int max_backups=_DEFAULT_MAX_BACKUPS_PER_FILE, int max_archive_bytes=_DEFAULT_MAX_ARCHIVE_BYTES)
str oct.formatter.oct_format._detect_indent_style (List[str] lines)
str oct.formatter.oct_format._get_indent_at_line (List[str] lines, int line_num, str fallback=" ")
List[str] oct.formatter.oct_format._detect_missing_docstring_sections (str text)
Tuple[bool, str, List[str]] oct.formatter.oct_format.fix_header_block (Path path, str text, FormatterContext ctx)
Tuple[bool, str, List[str]] oct.formatter.oct_format.fix_docstring (Path path, str text, FormatterContext ctx)
Tuple[bool, str, List[str]] oct.formatter.oct_format.fix_dbg_import (Path path, str text, FormatterContext ctx)
Tuple[bool, str, List[str]] oct.formatter.oct_format.fix_func_pattern (Path path, str text, FormatterContext ctx)
Dict[str, Any] oct.formatter.oct_format.format_file (Path path, FormatterContext ctx)
Dict[str, Any] oct.formatter.oct_format.compute_summary (List[Dict[str, Any]] file_results)
None oct.formatter.oct_format._print_terminal_report (Dict[str, Any] summary, List[Dict[str, Any]] file_results, bool verbose, bool dry_run)
None oct.formatter.oct_format._print_json_report (Dict[str, Any] summary, List[Dict[str, Any]] file_results, FormatterContext ctx)
None oct.formatter.oct_format.run_formatter (Path project_root, Optional[List[str]] argv=None)

Variables

str oct.formatter.oct_format.SHEBANG = "#!/usr/bin/env python3"
str oct.formatter.oct_format.ENCODING = "# -*- coding: utf-8 -*-"
str oct.formatter.oct_format.IMPORT_BLOCK = "from oc_diagnostics import _dbg\n"
str oct.formatter.oct_format.DOCSTRING_SKELETON
dict oct.formatter.oct_format.MISSING_DOCSTRING_SECTIONS
int oct.formatter.oct_format._DEFAULT_MAX_BACKUPS_PER_FILE = 10
int oct.formatter.oct_format._DEFAULT_MAX_ARCHIVE_BYTES = 5 * 1024 * 1024
 oct.formatter.oct_format.project_root = find_project_root(Path.cwd())