Skip to content

Conversation

@dennisdoomen
Copy link
Owner

@dennisdoomen dennisdoomen commented Aug 12, 2025

Introduces a new method, FindParentWithFileMatching, to the ChainablePath class. This method enables users to locate the nearest parent directory that contains a file matching one or more provided wildcard patterns (e.g., "*.sln"). It validates the input parameters to ensure that the provided wildcard patterns are non-null and non-empty. If no parent directory contains a matching file, the method returns ChainablePath.Empty. This method enhances the usability of ChainablePath by adding a feature for directory hierarchy traversal based on file patterns.

Closes #44

@dennisdoomen dennisdoomen added the enhancement New feature or request label Aug 12, 2025
@github-actions
Copy link

github-actions bot commented Aug 12, 2025

Test Results

84 tests  +8   84 ✅ +8   0s ⏱️ ±0s
 3 suites ±0    0 💤 ±0 
 3 files   ±0    0 ❌ ±0 

Results for commit 6d1ce05. ± Comparison against base commit 591e917.

This pull request removes 2 and adds 10 tests. Note that renamed tests count towards both.
Pathy.Specs.ChainablePathSpecs ‑ FromFirstExisting_usage_examples_work_as_expected(paths: ["app.config", "config/app.config", ".config/app.config"])
Pathy.Specs.ChainablePathSpecs ‑ FromFirstExisting_usage_examples_work_as_expected(paths: ["config.json", ".subdirectory/config.json"])
Pathy.Specs.ChainablePathSpecs ‑ Case_insensitive_matching_works
Pathy.Specs.ChainablePathSpecs ‑ Closest_parent_directory_is_found
Pathy.Specs.ChainablePathSpecs ‑ Empty_path_returned_when_no_match_found
Pathy.Specs.ChainablePathSpecs ‑ Empty_wildcards_throws_exception
Pathy.Specs.ChainablePathSpecs ‑ Null_or_empty_wildcard_throws_exception
Pathy.Specs.ChainablePathSpecs ‑ Null_wildcards_throws_exception
Pathy.Specs.ChainablePathSpecs ‑ Parent_directory_with_matching_file_is_found
Pathy.Specs.ChainablePathSpecs ‑ Parent_directory_with_multiple_matching_wildcards_is_found
Pathy.Specs.ChainablePathSpecs ‑ Parent_search_works_from_file_path
Pathy.Specs.ChainablePathSpecs ‑ Question_mark_wildcard_matching_works

♻️ This comment has been updated with latest results.

@coveralls
Copy link

coveralls commented Aug 12, 2025

Pull Request Test Coverage Report for Build 16901224408

Details

  • 23 of 23 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.8%) to 96.311%

Totals Coverage Status
Change from base Build 16853187089: 0.8%
Covered Lines: 170
Relevant Lines: 178

💛 - Coveralls

@dennisdoomen dennisdoomen merged commit 7d559f7 into main Aug 12, 2025
3 checks passed
@dennisdoomen dennisdoomen deleted the copilot/fix-44 branch August 12, 2025 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: FindParentWithFileMatching

3 participants