oct
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)
int oct.formatter.oct_format._leading_comment_block_end (List[str] lines)
str oct.formatter.oct_format._leading_whitespace (str line)
int oct.formatter.oct_format._statement_start_index (ast.stmt stmt)
bool oct.formatter.oct_format._begins_its_own_line (ast.stmt stmt, List[str] lines)
Optional[Tuple[str, int]] oct.formatter.oct_format._module_docstring_span (str text)
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)
int oct.formatter.oct_format._dbg_import_insert_index (ast.Module tree, List[str] lines)
Optional[str] oct.formatter.oct_format._import_block_package ()
Tuple[Optional[str], Optional[str]] oct.formatter.oct_format._import_block_binding ()
Tuple[set, int] oct.formatter.oct_format._conflicting_import_lines (ast.Module tree, str module, str symbol)
Optional[str] oct.formatter.oct_format._owning_top_level_package (Path path)
Tuple[bool, str, List[str]] oct.formatter.oct_format.fix_dbg_import (Path path, str text, FormatterContext ctx)
Optional[Tuple[int, str]] oct.formatter.oct_format._func_pattern_insert_point (Any node, List[str] lines)
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)
List[str] oct.formatter.oct_format._formatter_flag_argv (args)
bool oct.formatter.oct_format._maybe_dispatch_format_by_lens (Path project_root, args)
None oct.formatter.oct_format.run_formatter (Path project_root, Optional[List[str]] argv=None, *, Optional[List[Path]] _files=None, bool _dispatch=True)

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())