|
| 1 | +# Formatting |
| 2 | + |
| 3 | + Code |
| 4 | + format(is_r_package) |
| 5 | + Output |
| 6 | + [1] "Root criterion: contains a file `DESCRIPTION` with contents matching `^Package: `" |
| 7 | + |
| 8 | +--- |
| 9 | + |
| 10 | + Code |
| 11 | + is_r_package |
| 12 | + Output |
| 13 | + Root criterion: contains a file `DESCRIPTION` with contents matching `^Package: ` |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | + Code |
| 18 | + is_vcs_root |
| 19 | + Output |
| 20 | + Root criterion: one of |
| 21 | + - contains a directory `.git` |
| 22 | + - contains a file `.git` with contents matching `^gitdir: ` |
| 23 | + - contains a directory `.svn` |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | + Code |
| 28 | + criteria |
| 29 | + Output |
| 30 | + $is_rstudio_project |
| 31 | + Root criterion: contains a file matching `[.]Rproj$` with contents matching `^Version: ` in the first line |
| 32 | + |
| 33 | + $is_r_package |
| 34 | + Root criterion: contains a file `DESCRIPTION` with contents matching `^Package: ` |
| 35 | + |
| 36 | + $is_remake_project |
| 37 | + Root criterion: contains a file `remake.yml` |
| 38 | + |
| 39 | + $is_projectile_project |
| 40 | + Root criterion: contains a file `.projectile` |
| 41 | + |
| 42 | + $is_git_root |
| 43 | + Root criterion: one of |
| 44 | + - contains a directory `.git` |
| 45 | + - contains a file `.git` with contents matching `^gitdir: ` |
| 46 | + |
| 47 | + $is_svn_root |
| 48 | + Root criterion: contains a directory `.svn` |
| 49 | + |
| 50 | + $is_vcs_root |
| 51 | + Root criterion: one of |
| 52 | + - contains a directory `.git` |
| 53 | + - contains a file `.git` with contents matching `^gitdir: ` |
| 54 | + - contains a directory `.svn` |
| 55 | + |
| 56 | + $is_testthat |
| 57 | + Root criterion: directory name is `testthat` (also look in subdirectories: `tests/testthat`, `testthat`) |
| 58 | + |
| 59 | + $from_wd |
| 60 | + Root criterion: from current working directory |
| 61 | + |
| 62 | + attr(,"class") |
| 63 | + [1] "root_criteria" |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | + Code |
| 68 | + str(criteria) |
| 69 | + Output |
| 70 | + List of 9 |
| 71 | + $ is_rstudio_project : chr "Root criterion: contains a file matching `[.]Rproj$` with contents matching `^Version: ` in the first line" |
| 72 | + $ is_r_package : chr "Root criterion: contains a file `DESCRIPTION` with contents matching `^Package: `" |
| 73 | + $ is_remake_project : chr "Root criterion: contains a file `remake.yml`" |
| 74 | + $ is_projectile_project: chr "Root criterion: contains a file `.projectile`" |
| 75 | + $ is_git_root : chr [1:3] "Root criterion: one of" "- contains a directory `.git`" "- contains a file `.git` with contents matching `^gitdir: `" |
| 76 | + $ is_svn_root : chr "Root criterion: contains a directory `.svn`" |
| 77 | + $ is_vcs_root : chr [1:4] "Root criterion: one of" "- contains a directory `.git`" "- contains a file `.git` with contents matching `^gitdir: `" "- contains a directory `.svn`" |
| 78 | + $ is_testthat : chr "Root criterion: directory name is `testthat` (also look in subdirectories: `tests/testthat`, `testthat`)" |
| 79 | + $ from_wd : chr "Root criterion: from current working directory" |
| 80 | + |
| 81 | +# Combining criteria |
| 82 | + |
| 83 | + Code |
| 84 | + comb_crit |
| 85 | + Output |
| 86 | + Root criterion: one of |
| 87 | + - contains a file `DESCRIPTION` with contents matching `^Package: ` |
| 88 | + - contains a file matching `[.]Rproj$` with contents matching `^Version: ` in the first line |
| 89 | + |
0 commit comments