-
Notifications
You must be signed in to change notification settings - Fork 199
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
Pass root path to FullyQualifiedNameProvider #867
Conversation
Codecov ReportBase: 94.79% // Head: 94.79% // Increases project coverage by
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #867 +/- ##
=======================================
Coverage 94.79% 94.79%
=======================================
Files 249 249
Lines 25831 25835 +4
=======================================
+ Hits 24487 24491 +4
Misses 1344 1344
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
FWIW I also ran into this bug and tried the same fix (passing I was just about to start writing a PR for the same thing when I saw this one! 🎉 😍 Also: fixes #722 (someone else there had the same issue and the same solution). |
1b40cfd
to
6ae4c37
Compare
This allows FullyQualifiedNameProvider to work with absolute paths, rather than assuming all paths given will be relative to the current directory. This enables tools like Fixit to provide a root path, and have the FullyQualifiedNameProvider correctly scope the final results relative to that root path. This does require that both the root path and the given file paths match the other as relative or absolute, due to the `calculate_module_and_package` helper comparing file paths relative to the root path, but this seems like a reasonable tradeoff, and unlikely to cause a problem in normal use cases.
Summary
This allows FullyQualifiedNameProvider to work with absolute paths,
rather than assuming all paths given will be relative to the current
directory. This enables tools like Fixit to provide a root path, and
have the FullyQualifiedNameProvider correctly scope the final results
relative to that root path.
This does require that both the root path and the given file paths
match the other as relative or absolute, due to the
calculate_module_and_package
helper comparing file paths relativeto the root path, but this seems like a reasonable tradeoff, and
unlikely to cause a problem in normal use cases.
Test Plan
Updated test cases. Works with in-progress Fixit2 changes.