Skip to content
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

Add fsext.Abs helper function #3452

Merged
merged 2 commits into from
Nov 10, 2023
Merged

Add fsext.Abs helper function #3452

merged 2 commits into from
Nov 10, 2023

Conversation

oleiade
Copy link
Member

@oleiade oleiade commented Nov 10, 2023

What?

This PR adds a fsext.Abs helper function to facilitate computing the absolute path of a file.

Why?

Similar code already exists in the current master branch:

// Here IsAbs should be enough but unfortunately it doesn't handle absolute paths starting from
and as the fs module also relies on the same operation, I took this opportunity to refactor it in a the lib/fsext package.

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (make lint) and all checks pass.
  • I have run tests locally (make tests) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Related PR(s)/Issue(s)

ref #3165 (blocks)

@oleiade oleiade self-assigned this Nov 10, 2023
@codecov-commenter
Copy link

codecov-commenter commented Nov 10, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0db029a) 73.34% compared to head (6fb6f99) 73.38%.
Report is 2 commits behind head on master.

❗ Current head 6fb6f99 differs from pull request most recent head 3a16a29. Consider uploading reports for the commit 3a16a29 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3452      +/-   ##
==========================================
+ Coverage   73.34%   73.38%   +0.03%     
==========================================
  Files         261      261              
  Lines       19769    19779      +10     
==========================================
+ Hits        14500    14514      +14     
+ Misses       4371     4368       -3     
+ Partials      898      897       -1     
Flag Coverage Δ
ubuntu 73.32% <94.73%> (+0.05%) ⬆️
windows 73.22% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
cmd/root.go 94.37% <100.00%> (+0.14%) ⬆️
cmd/version.go 100.00% <100.00%> (ø)
js/initcontext.go 93.54% <100.00%> (-0.90%) ⬇️
lib/fsext/filepath.go 100.00% <100.00%> (ø)
lib/strvals/parser.go 100.00% <100.00%> (ø)
log/file.go 79.66% <100.00%> (ø)
log/loki.go 69.08% <100.00%> (ø)

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@oleiade oleiade merged commit d26bde8 into master Nov 10, 2023
23 checks passed
@oleiade oleiade deleted the feature/fsext-abs branch November 10, 2023 11:33
@olegbespalov olegbespalov added this to the v0.48.0 milestone Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants