r-lib / rprojroot

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

#27: add "and" logic to criteria #28

Closed bcipolli closed 3 years ago

bcipolli commented 7 years ago

Closes #27.

This turned out to be more involved than I expected, as there were some core assumptions in the code about vectors of testfun / desc being for or logic.

I refactored quite a bit, such that testfun is always a single function, and desc is always a single string, and the operators do a bit more work (but not much) to make that happen.

I think it makes things more extensible, but it also may not be doable without potentially breaking things that others have done. If so, glad to look at alternate solutions.

The other downside is that the format output could not be so pretty so easily, as nesting of | with & at multiple levels would not be easy to deal with. I opted instead for very simple formatting:

Root criterion: (contains a directory `src`) and (contains a directory `reports`)
bcipolli commented 7 years ago

@krlmlr Yep, happy to try and update the vignettes. That's new for me, so it'll be a nice exercise anyway :)

krlmlr commented 6 years ago

Are you still interested in updating this PR?

bcipolli commented 6 years ago

@krlmlr Definitely. Need this for work, but am pulled onto other projects at the moment. Am hoping to have time over Thanksgiving break to circle back on it.

krlmlr commented 6 years ago

The bulleted list is important for the here package, it needs to stay. I can see that this will make the formatting code more complex.

krlmlr commented 3 years ago

This is a good start but needs more work:

Please open a new pull request if still relevant.