18 compress the excluded paths from the tree#19
Merged
simone-viozzi merged 2 commits intomainfrom Mar 9, 2025
Merged
Conversation
- Refactor generate_tree() in src/gpt_copy/gpt_copy.py to compress directories excluded by the -e option.
Directories matching the exclude patterns now display only one level of children (up to 3 items)
followed by an ellipsis ("[...]") if additional items exist.
- Update main() to pass the exclude patterns to generate_tree().
- Bump project version in pyproject.toml to 2.3.0.
- Add tests/test_tree_compression.py to verify the compressed view for excluded directories.
- Extract helper functions _get_visible_entries, _compress_directory, and _process_file to improve code modularity and readability. - Update generate_tree to use these helpers for filtering visible entries and compressing excluded directories. - Simplify collect_files_content by delegating file processing to _process_file.
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.
Compress excluded paths in tree output and add tests
Directories matching the exclude patterns now display only one level of children (up to 3 items)
followed by an ellipsis ("[...]") if additional items exist.
Refactor generate_tree and collect_files_content with helper functions