r-lib / rprojroot

Finding files in project subdirectories
https://rprojroot.r-lib.org/
Other
149 stars 23 forks source link

Return absolute paths unchanged #59

Closed krlmlr closed 3 years ago

krlmlr commented 3 years ago

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 https://github.com/r-lib/here/issues/34, fixes https://github.com/r-lib/here/issues/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}?

StevenMMortimer commented 3 years ago

@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!

jthurner commented 3 years ago

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

codecov-io commented 3 years ago

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%) :arrow_down:
R/file.R 100.00% <100.00%> (ø)
R/thisfile.R 51.21% <0.00%> (-9.44%) :arrow_down:
R/has-file.R 98.27% <0.00%> (+0.09%) :arrow_up:

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.

czeildi commented 3 years ago

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

krlmlr commented 3 years ago

Thanks for your feedback!

lgaborini commented 3 years ago

Looking good! Thanks!

yihui commented 3 years ago

@krlmlr That makes sense to me. Thanks!