Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/codegate/extract_snippets/message_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,23 @@ def fill_file_extension(self) -> Self:
self.file_extension = Path(self.filepath).suffix
return self

def __hash__(self):
# Create a hashable representation using immutable fields
return hash(
(self.code, self.language, self.filepath, self.file_extension, tuple(self.libraries))
)

def __eq__(self, other):
if not isinstance(other, CodeSnippet):
return False
return (
self.code == other.code
and self.language == other.language
and self.filepath == other.filepath
and self.file_extension == other.file_extension
and self.libraries == other.libraries
)


class CodeSnippetExtractor(ABC):

Expand Down
Loading