Skip to content

fix: dont break when given paths that are files. filter on them instead. #13

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 4 commits into from
Jun 26, 2025

Conversation

vic
Copy link
Owner

@vic vic commented Jun 26, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings June 26, 2025 00:06
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 updates the recursive file listing function to safely handle file paths (rather than only directories) and adds a corresponding test to ensure that passing a file path doesn’t break the import-tree logic.

  • listFilesRecursive now checks for directories and returns files unchanged
  • A new test case verifies behavior when given a file path instead of a directory

Reviewed Changes

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

File Description
default.nix Enhanced listFilesRecursive to detect directory vs. file inputs
checkmate.nix Added test case for import-tree behavior when input is a file
Comments suppressed due to low confidence (1)

checkmate.nix:142

  • This test invokes lit.leafs instead of the import-tree function, so it doesn’t actually exercise the new file-path branch. Consider calling the import-tree entrypoint to verify that passing a file path returns the correct singleton list.
          expr = lit.leafs ./tree/x/y.nix;

vic and others added 3 commits June 26, 2025 00:07
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@vic vic merged commit 4ce0367 into main Jun 26, 2025
1 check passed
@vic vic deleted the vic/jj-change-kmmwwlqrwxxu branch June 26, 2025 00:20
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