Group
Module for semantic grouping of diff chunks.
SemanticGroup
Represents a group of semantically related diff chunks.
Source code in src/codemap/git/semantic_grouping/group.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|
__init__
__init__(
chunks: list[DiffChunk] | None = None,
name: str | None = None,
) -> None
Initialize a semantic group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
chunks
|
list[DiffChunk] | None
|
List of DiffChunk objects |
None
|
name
|
str | None
|
Optional name for the group |
None
|
Source code in src/codemap/git/semantic_grouping/group.py
9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
chunks
instance-attribute
chunks = chunks or []
name
instance-attribute
name = name
message
instance-attribute
message: str | None = None
approved
instance-attribute
approved = False
files
property
files: list[str]
Get the set of files affected by this group.
content
property
content: str
Get the combined diff content of all chunks.
merge_with
merge_with(other_group: SemanticGroup) -> SemanticGroup
Merge this group with another group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
other_group
|
SemanticGroup
|
Another SemanticGroup to merge with |
required |
Returns:
Type | Description |
---|---|
SemanticGroup
|
A new SemanticGroup containing chunks from both groups |
Source code in src/codemap/git/semantic_grouping/group.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
__repr__
__repr__() -> str
Return a string representation of the group with file and chunk counts.
Source code in src/codemap/git/semantic_grouping/group.py
51 52 53 |
|