Resolve relative repo paths from config file directory#1443
Merged
j178 merged 2 commits intoj178:masterfrom Jan 22, 2026
Merged
Resolve relative repo paths from config file directory#1443j178 merged 2 commits intoj178:masterfrom
j178 merged 2 commits intoj178:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1443 +/- ##
=======================================
Coverage 90.74% 90.75%
=======================================
Files 82 82
Lines 16776 16786 +10
=======================================
+ Hits 15224 15234 +10
Misses 1552 1552 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📦 Cargo Bloat ComparisonBinary size change: +0.00% (22.5 MiB → 22.5 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
Relative paths like `../hook-repo` in `.pre-commit-config.yaml` were being resolved against the process's current working directory instead of the directory containing the config file. This broke configs in subprojects that used relative paths to hook repositories. The fix resolves relative repo paths in `Project::from_config_file` right after loading the config, using the config file's parent directory as the base. Fixes j178#1065
d9316f3 to
106c88e
Compare
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.
Relative paths like
../hook-repoin.pre-commit-config.yamlwere being resolved against the process's current working directory instead of the directory containing the config file. This broke configs in subprojects that used relative paths to hook repositories.The fix resolves relative repo paths in
Project::from_config_fileright after loading the config, using the config file's parent directory as the base.Fixes #1065