Skip to content

Conversation

@DecSmith42
Copy link
Owner

Introduced FileFinder, a reusable, extensible utility to locate files within a directory hierarchy. Implements upward root-marker detection and breadth-first downward search, with exclusions for ignored folders. Integrated the new tool into RunCommand to streamline file and project discovery logic.

BREAKING CHANGE: Replaces custom directory traversal logic in RunCommand with FileFinder. Ensure project searches follow the updated hierarchy detection rules.

…structure

Introduced `FileFinder`, a reusable, extensible utility to locate files within a directory hierarchy. Implements upward root-marker detection and breadth-first downward search, with exclusions for ignored folders. Integrated the new tool into `RunCommand` to streamline file and project discovery logic.

BREAKING CHANGE: Replaces custom directory traversal logic in `RunCommand` with `FileFinder`. Ensure project searches follow the updated hierarchy detection rules.
Copilot AI review requested due to automatic review settings December 18, 2025 11:09
@DecSmith42 DecSmith42 enabled auto-merge December 18, 2025 11:15
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 introduces a centralized FileFinder utility to replace custom directory traversal logic in RunCommand. The new utility implements a two-phase search strategy: first searching upward from the starting directory (stopping at project root markers like .git or .sln), then performing a breadth-first downward search with depth limits and folder exclusions.

  • Adds FileFinder class with configurable upward/downward file search
  • Refactors RunCommand to use FileFinder instead of manual directory traversal
  • Simplifies test suite to focus on key FileFinder behaviors

Reviewed changes

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

File Description
DecSm.Atom.Tool/FileFinder.cs New utility class implementing upward and BFS downward file search with root marker detection and folder exclusions
DecSm.Atom.Tool/Commands/RunCommand.cs Refactored to delegate file discovery to FileFinder, removing custom traversal logic
DecSm.Atom.Tool.Tests/RunCommandTests.cs Reduced test suite from comprehensive scenario coverage to 3 focused tests on FileFinder behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Excluded the 'build' folder from the default ignored directories list, as it might be a valid search target in some use cases. Also added a condition to return early if the starting path is already a file. This improves flexibility and optimizes file search logic.
Lowered the default `MaxDownstreamDepth` from 8 to 4 to limit unnecessary deep directory traversals during file searches. Balances performance and depth coverage for typical use cases.
Changed the `execute` call to always pass `true` for the `isInteractive` parameter when a file is found. This aligns execution behavior with expected operational use cases for `RunCommand`.
@DecSmith42 DecSmith42 merged commit 9c302a4 into main Dec 18, 2025
31 of 33 checks passed
@DecSmith42 DecSmith42 deleted the fix/tool-search-paths branch December 18, 2025 11:42
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