Skip to content

search in parent dir#306

Merged
eifinger merged 3 commits intomainfrom
search-in-parent-dir
Jan 28, 2026
Merged

search in parent dir#306
eifinger merged 3 commits intomainfrom
search-in-parent-dir

Conversation

@eifinger
Copy link
Collaborator

@eifinger eifinger commented Jan 25, 2026

Fixes: #164

@eifinger eifinger added the bugfix A change that fixes a bug. Leads to a minor version bump. label Jan 26, 2026
@eifinger eifinger marked this pull request as ready for review January 26, 2026 10:35
@eifinger eifinger requested a review from Copilot January 26, 2026 10:36
Copy link

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 pull request implements support for searching pyproject.toml files in parent directories, fixing issue #164 where the action didn't find pyproject.toml files located in parent directories of the specified source path.

Changes:

  • Added a new pyproject-finder.ts utility module that searches for pyproject.toml starting from a given directory and traversing upwards to the workspace root
  • Updated ruff-action.ts to use the new finder instead of checking only the source directory
  • Added comprehensive unit tests and an integration test to verify the parent directory search functionality

Reviewed changes

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

Show a summary per file
File Description
src/utils/pyproject-finder.ts New utility module implementing upward directory search for pyproject.toml files
src/utils/pyproject-finder.test.ts Unit tests for the pyproject finder (includes some misleading test descriptions)
src/ruff-action.ts Updated to use the new finder and removed unused fs import
dist/ruff-action/index.js Bundled distribution file with the new module
tests/fixtures/parent-config-project/ New test fixture with parent/child directory structure
.github/workflows/test.yml Added integration test verifying version detection from parent directory

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

…tory search tests

Address review feedback from Copilot:
- The previous tests used python-project which actually has a pyproject.toml,
  making the tests not properly verify parent directory search functionality
- Now using parent-config-project/subproject which has no pyproject.toml,
  ensuring the tests actually verify searching upward to find parent's config
@eifinger eifinger merged commit 5eee2a4 into main Jan 28, 2026
65 checks passed
@eifinger eifinger deleted the search-in-parent-dir branch January 28, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix A change that fixes a bug. Leads to a minor version bump.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pyproject.toml in parent directory isn't examined

2 participants