Skip to content

fix: dont try to convert attrSets that are not paths. #16

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
Jul 1, 2025

Conversation

vic
Copy link
Owner

@vic vic commented Jul 1, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings July 1, 2025 16:57
Copy link
Contributor

@Copilot 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 refines the file traversal pipeline to avoid converting non-path attribute sets to strings by introducing explicit path-like checks, updating the filter composition, and adding a test for non-path inputs.

  • Add isPathLike and isDirectory predicates to distinguish real filesystem paths from other Nix attrsets.
  • Refactor filter to only stringify values when they are actual paths or outPaths.
  • Introduce a new test in checkmate.nix to verify non-path values pass through unchanged.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
default.nix Define isPathLike/isDirectory, replace inline path checks and the previous filter logic.
checkmate.nix Add a test case to ensure non-path values aren’t stringified by the import-tree pipeline.
Comments suppressed due to low confidence (2)

default.nix:44

  • [nitpick] The local name filter shadows the built-in and can be confusing; consider renaming it to something more descriptive like combinedFilter or pathAwareFilter.
          filter = x: if isPathLike x then pathFilter x else filterf x;

checkmate.nix:206

  • It would be helpful to add a complementary test for directory paths (via isDirectory) to ensure that the new directory branch in default.nix is exercised.
        import-tree."test passes non-paths without string conversion" = {

@vic vic merged commit 7a0649e into main Jul 1, 2025
1 check passed
@vic vic deleted the vic/jj-change-lstylmxotrst branch July 1, 2025 16:58
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