10000 [Enhancement] Display Ignored Directories with Marker in File Tree by kasperjunge · Pull Request #28 · kasperjunge/copcon · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Enhancement] Display Ignored Directories with Marker in File Tree #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

kasperjunge
Copy link
Owner

This PR updates the FileTreeGenerator to improve the clarity of the generated context report. The changes include:

  • New Behavior for Ignored Directories:
    When a directory is excluded via .copconignore or .copcontarget, its name is still shown in the file tree. However, instead of recursing into its children, the directory is displayed with a trailing slash and the marker (contents not displayed). This clearly indicates that the directory exists but its contents were intentionally omitted.

  • Implementation Details:

    • In copcon/core/file_tree.py, the generate() method was updated to check for ignored directories. If a directory is determined to be ignored (via the file filter), its entry is appended with the marker, and no recursion is performed into that directory.
    • The directory and file counts are maintained appropriately.
  • Tests Updated:
    A new test in tests/test_file_tree.py verifies that:

    • Ignored directories (e.g., node_modules) are displayed with the correct marker.
    • The children of ignored directories are not listed.
    • The overall directory and file counts match the expected values.

This enhancement helps users understand the structure of their project while clearly indicating which directories were filtered out.

Looking forward to your feedback!

@kasperjunge kasperjunge merged commit 620aee1 into main Feb 27, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0