Repository navigation
fix: dont try to convert attrSets that are not paths. - #16
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
isPathLikeandisDirectorypredicates to distinguish real filesystem paths from other Nix attrsets. - Refactor
filterto only stringify values when they are actual paths or outPaths. - Introduce a new test in
checkmate.nixto 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
filtershadows the built-in and can be confusing; consider renaming it to something more descriptive likecombinedFilterorpathAwareFilter.
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 indefault.nixis exercised.
import-tree."test passes non-paths without string conversion" = {
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.