dotbot icon indicating copy to clipboard operation
dotbot copied to clipboard

Support creating hardlinks

Open kurtmckee opened this issue 11 months ago • 3 comments

Closes #334

kurtmckee avatar Jan 14 '25 13:01 kurtmckee

Codecov Report

Attention: Patch coverage is 80.00000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 85.99%. Comparing base (b8891c5) to head (a74b238). Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
src/dotbot/plugins/link.py 80.00% 7 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #372      +/-   ##
==========================================
+ Coverage   85.56%   85.99%   +0.42%     
==========================================
  Files          20       20              
  Lines         693      721      +28     
==========================================
+ Hits          593      620      +27     
- Misses        100      101       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Jan 14 '25 13:01 codecov[bot]

Hi @anishathalye, have you had a chance to look at this PR? Is there anything else you need in order to merge it? Thanks.

dgiagio avatar Apr 05 '25 02:04 dgiagio

Not a fan of Copilot.

I'll see what I can do to address those concerns, but it's going to take a bit because life is busy currently!

kurtmckee avatar Apr 09 '25 16:04 kurtmckee

@anishathalye I've addressed the cases you suggested.

In addition, I attempted to make the complex warning-message-handling logic clearer by rearranging and regrouping the conditions.

It may be easier to read outside of this PR's diff context:

https://github.com/kurtmckee/pr-dotbot/blob/hardlinks-issue-334/src/dotbot/plugins/link.py#L278-L323

kurtmckee avatar Jun 06 '25 00:06 kurtmckee

Thanks! There was a small bug with the refactor to _link(), which tried creating the link first and showed an error otherwise—it was using os.exists(), but we need os.lexists() to detect broken symbolic links and show the correct error message (the consequence was that we got a "Link failed" error instead of an "Invalid link" error). In the interest of time, I added a test and fixed this small bug.

Squashed in 5614642 and merged in 64d2330b2ee139f5c9603d10f19cadb07c65c234, thank you for submitting this pull request!

anishathalye avatar Jun 09 '25 01:06 anishathalye