Skip to content

Conversation

@vic
Copy link
Owner

@vic vic commented Oct 22, 2025

for example, if user does import-tree ./_foo,

explicitly asking to traverse ./_foo, then results must be ./_foo/bar.nix but not ./_foo/_baz.nix.

that is, filtering occurs only on after-root paths.

for example, if user does `import-tree ./_foo`,

explicitly asking to traverse `./_foo`, then results must be
`./_foo/bar.nix` but not `./_foo/_baz.nix`.

that is, filtering occurs only on after-root paths.
Copilot AI review requested due to automatic review settings October 22, 2025 08:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies the filtering behavior for import-tree to apply filtering only to paths after the root directory, not to the root itself. This allows users to explicitly traverse directories with underscore prefixes (e.g., ./_foo) while still filtering out underscore-prefixed subdirectories.

Key changes:

  • Introduced relative path tracking to distinguish between root paths and their subdirectories
  • Modified the filtering logic to apply filters only to paths after the root directory
  • Added test coverage for loading from hidden directories while excluding sub-hidden paths

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tree/a/b/_c/d/_f.nix Added test fixture file in underscore-prefixed directory
default.nix Implemented makeRelative and rootRelative functions to track relative paths and apply filtering only after root
checkmate.nix Added test case verifying that underscore-prefixed root can be traversed while filtering its subdirectories

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@vic vic merged commit a037ed2 into main Oct 22, 2025
1 check passed
@vic vic deleted the root_prefix branch October 22, 2025 08:11
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.

2 participants