refactor: rename 'codes' to 'lines' in Block class and related services#3
Merged
refactor: rename 'codes' to 'lines' in Block class and related services#3
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the codebase by renaming the 'codes' attribute to 'lines' in the Block class and updating all related services to use the new naming. Additionally, it moves BlockType from an enum to a type definition and introduces a Lines type alias.
- Renamed the 'codes' attribute to 'lines' throughout the codebase for better semantic clarity
- Moved BlockType from src/enums/block_type to src/types/block_type
- Added a new Lines type alias as List[str] for improved type safety
Reviewed Changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/entities/block.py | Updated Block class to use 'lines' instead of 'codes' and import from types |
| src/entities/file.py | Updated file writing logic to use block.lines |
| src/services/load_file_service.py | Updated service to use 'lines' attribute and import BlockType from types |
| src/services/generate_import_statement_service.py | Updated to use 'lines' attribute and added Lines type import |
| src/services/move_blocks_to_new_files_service.py | Updated BlockType import path |
| src/services/attach_import_statements_service.py | Added return type annotation |
| src/code_splitter.py | Updated BlockType import path |
| src/types/lines.py | New file defining Lines type alias |
| tests/services/test_load_file_service.py | Updated all test assertions to use 'lines' instead of 'codes' |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.