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

Return absolute paths unchanged #59

merged 6 commits into from Nov 10, 2020

Return absolute paths unchanged #59

merged 6 commits into from Nov 10, 2020


Copy link

@krlmlr krlmlr commented Nov 8, 2020

If the first component is already an absolute path, everything is returned unchanged. This applies to find_root_file() and the criteria's "member functions".

Fixes r-lib/here#34, fixes r-lib/here#31.

Closes #46.

@jthurner @StevenMMortimer @czeildi @lgaborini: Would that make {here} easier to use?

@yihui: What do you think about this approach for handling paths that are already absolute, in {here} and {rprojroot}?

Copy link

@krlmlr Makes sense and seems to be a great solution to dealing with a combination of absolute and relative paths. Thanks for working on it!

Copy link

jthurner commented Nov 9, 2020

Yes, much better fix for r-lib/here#34 and r-lib/here#31 than my PR. Thanks!

Copy link

Codecov Report

Merging #59 (b9e5eac) into master (4999f9a) will decrease coverage by 1.25%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #59      +/-   ##
- Coverage   81.25%   80.00%   -1.25%     
  Files           5        6       +1     
  Lines         192      185       -7     
- Hits          156      148       -8     
- Misses         36       37       +1     
Impacted Files Coverage Δ
R/absolute.R 100.00% <100.00%> (ø)
R/criterion.R 81.13% <100.00%> (-8.00%) ⬇️
R/file.R 100.00% <100.00%> (ø)
R/thisfile.R 51.21% <0.00%> (-9.44%) ⬇️
R/has-file.R 98.27% <0.00%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4999f9a...54a8b09. Read the comment docs.

Copy link

czeildi commented Nov 9, 2020

Looks great, thanks a lot for your work, this will definitely improve my workflow.

@krlmlr krlmlr merged commit cc5131a into master Nov 10, 2020
2 checks passed
@krlmlr krlmlr deleted the f-abs branch November 10, 2020 04:45
Copy link
Member Author

krlmlr commented Nov 10, 2020

Thanks for your feedback!

Copy link

Looking good! Thanks!

Copy link

yihui commented Nov 23, 2020

@krlmlr That makes sense to me. Thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
None yet

Successfully merging this pull request may close these issues.

Append to a path created by here() do not modify absolute paths
7 participants