Skip to content

sections

Symbol Details

class: CommentConfig

class CommentConfig:
    prefix: str
    suffix: str = ''
Field Type Default Since
prefix str - 0.101.0
suffix str '' 0.101.0

function: compare_sections

def compare_sections(baseline_content: str, current_content: str, tool_name: str, config: CommentConfig, skip: set[str] | None = None, filename: str = '') -> list[str]:
    ...

Return section IDs with changes (modified or removed), excluding skipped sections.

function: extract_sections

def extract_sections(content: str, tool_name: str, config: CommentConfig, filename: str = '') -> dict[str, str]:
    ...

function: extract_sections_from_path

def extract_sections_from_path(path: Path, tool_name: str) -> dict[str, str]:
    ...

function: has_sections

def has_sections(content: str, tool_name: str, config: CommentConfig) -> bool:
    ...

function: has_sections_in_path

def has_sections_in_path(path: Path, tool_name: str) -> bool:
    ...

function: parse_sections_from_path

def parse_sections_from_path(path: Path, tool_name: str) -> list[Section]:
    ...

function: slug

def slug(text: str) -> str:
    ...

Convert text to lowercase slug suitable for section marker IDs.

function: wrap_in_default_section

def wrap_in_default_section(content: str, tool_name: str, config: CommentConfig) -> str:
    ...

function: wrap_section

def wrap_section(content: str, section_id: str, tool_name: str, config: CommentConfig) -> str:
    ...

class: SectionChanges

class SectionChanges:
    modified: list[str]
    missing: list[str]
Field Type Default Since
modified list[str] - 0.102.0
missing list[str] - 0.102.0

function: changed_sections

def changed_sections(baseline_content: str, current_content: str, tool_name: str, config: CommentConfig, skip: set[str] | None = None, filename: str = '') -> SectionChanges:
    ...

Return modified and missing sections separately.

function: get_comment_config

def get_comment_config(path: Path | str, override: CommentConfig | None = None) -> CommentConfig:
    ...

function: parse_sections

def parse_sections(content: str, tool_name: str, config: CommentConfig, filename: str = '') -> list[Section]:
    ...