|
3 | 3 | Code |
4 | 4 | format(is_r_package) |
5 | 5 | Output |
6 | | - [1] "Root criterion: contains a file \"DESCRIPTION\" with contents matching \"^Package: \"" |
| 6 | + [1] "Root criterion: contains a file 'DESCRIPTION' with contents matching '^Package: '" |
7 | 7 |
|
8 | 8 | --- |
9 | 9 |
|
10 | 10 | Code |
11 | 11 | is_r_package |
12 | 12 | Output |
13 | | - Root criterion: contains a file "DESCRIPTION" with contents matching "^Package: " |
| 13 | + Root criterion: contains a file 'DESCRIPTION' with contents matching '^Package: ' |
14 | 14 |
|
15 | 15 | --- |
16 | 16 |
|
17 | 17 | Code |
18 | 18 | is_vcs_root |
19 | 19 | Output |
20 | 20 | Root criterion: one of |
21 | | - - contains a directory ".git" |
22 | | - - contains a file ".git" with contents matching "^gitdir: " |
23 | | - - contains a directory ".svn" |
| 21 | + - contains a directory '.git' |
| 22 | + - contains a file '.git' with contents matching '^gitdir: ' |
| 23 | + - contains a directory '.svn' |
24 | 24 |
|
25 | 25 | --- |
26 | 26 |
|
27 | 27 | Code |
28 | 28 | has_file("a", contents = "foo", fixed = TRUE) |
29 | 29 | Output |
30 | | - Root criterion: contains a file "a" with contents "foo" |
| 30 | + Root criterion: contains a file 'a' with contents 'foo' |
31 | 31 |
|
32 | 32 | --- |
33 | 33 |
|
34 | 34 | Code |
35 | 35 | has_file_pattern("a.*b", contents = "foo", fixed = TRUE) |
36 | 36 | Output |
37 | | - Root criterion: contains a file matching "a.*b" with contents "foo" |
| 37 | + Root criterion: contains a file matching 'a.*b' with contents 'foo' |
38 | 38 |
|
39 | 39 | --- |
40 | 40 |
|
41 | 41 | Code |
42 | 42 | criteria |
43 | 43 | Output |
44 | 44 | $is_rstudio_project |
45 | | - Root criterion: contains a file matching "[.]Rproj$" with contents matching "^Version: " in the first line |
| 45 | + Root criterion: contains a file matching '[.]Rproj$' with contents matching '^Version: ' in the first line |
46 | 46 | |
47 | 47 | $is_vscode_project |
48 | | - Root criterion: contains a directory ".vscode" |
| 48 | + Root criterion: contains a directory '.vscode' |
49 | 49 | |
50 | 50 | $is_r_package |
51 | | - Root criterion: contains a file "DESCRIPTION" with contents matching "^Package: " |
| 51 | + Root criterion: contains a file 'DESCRIPTION' with contents matching '^Package: ' |
52 | 52 | |
53 | 53 | $is_remake_project |
54 | | - Root criterion: contains a file "remake.yml" |
| 54 | + Root criterion: contains a file 'remake.yml' |
55 | 55 | |
56 | 56 | $is_pkgdown_project |
57 | 57 | Root criterion: one of |
58 | | - - contains a file "_pkgdown.yml" |
59 | | - - contains a file "_pkgdown.yaml" |
60 | | - - contains a file "pkgdown/_pkgdown.yml" |
61 | | - - contains a file "pkgdown/_pkgdown.yaml" |
62 | | - - contains a file "inst/_pkgdown.yml" |
63 | | - - contains a file "inst/_pkgdown.yaml" |
| 58 | + - contains a file '_pkgdown.yml' |
| 59 | + - contains a file '_pkgdown.yaml' |
| 60 | + - contains a file 'pkgdown/_pkgdown.yml' |
| 61 | + - contains a file 'pkgdown/_pkgdown.yaml' |
| 62 | + - contains a file 'inst/_pkgdown.yml' |
| 63 | + - contains a file 'inst/_pkgdown.yaml' |
64 | 64 | |
65 | 65 | $is_renv_project |
66 | | - Root criterion: contains a file "renv.lock" with contents matching ""Packages":\s*\{" |
| 66 | + Root criterion: contains a file 'renv.lock' with contents matching '"Packages":\s*\{' |
67 | 67 | |
68 | 68 | $is_projectile_project |
69 | | - Root criterion: contains a file ".projectile" |
| 69 | + Root criterion: contains a file '.projectile' |
70 | 70 | |
71 | 71 | $is_quarto_project |
72 | | - Root criterion: contains a file "_quarto.yml" |
| 72 | + Root criterion: contains a file '_quarto.yml' |
73 | 73 | |
74 | 74 | $is_git_root |
75 | 75 | Root criterion: one of |
76 | | - - contains a directory ".git" |
77 | | - - contains a file ".git" with contents matching "^gitdir: " |
| 76 | + - contains a directory '.git' |
| 77 | + - contains a file '.git' with contents matching '^gitdir: ' |
78 | 78 | |
79 | 79 | $is_svn_root |
80 | | - Root criterion: contains a directory ".svn" |
| 80 | + Root criterion: contains a directory '.svn' |
81 | 81 | |
82 | 82 | $is_vcs_root |
83 | 83 | Root criterion: one of |
84 | | - - contains a directory ".git" |
85 | | - - contains a file ".git" with contents matching "^gitdir: " |
86 | | - - contains a directory ".svn" |
| 84 | + - contains a directory '.git' |
| 85 | + - contains a file '.git' with contents matching '^gitdir: ' |
| 86 | + - contains a directory '.svn' |
87 | 87 | |
88 | 88 | $is_testthat |
89 | 89 | Root criterion: directory name is "testthat" (also look in subdirectories: `tests/testthat`, `testthat`) |
|
100 | 100 | str(criteria) |
101 | 101 | Output |
102 | 102 | List of 13 |
103 | | - $ is_rstudio_project : chr "Root criterion: contains a file matching \"[.]Rproj$\" with contents matching \"^Version: \" in the first line" |
104 | | - $ is_vscode_project : chr "Root criterion: contains a directory \".vscode\"" |
105 | | - $ is_r_package : chr "Root criterion: contains a file \"DESCRIPTION\" with contents matching \"^Package: \"" |
106 | | - $ is_remake_project : chr "Root criterion: contains a file \"remake.yml\"" |
107 | | - $ is_pkgdown_project : chr [1:7] "Root criterion: one of" "- contains a file \"_pkgdown.yml\"" "- contains a file \"_pkgdown.yaml\"" "- contains a file \"pkgdown/_pkgdown.yml\"" ... |
108 | | - $ is_renv_project : chr "Root criterion: contains a file \"renv.lock\" with contents matching \"\"Packages\":\\s*\\{\"" |
109 | | - $ is_projectile_project: chr "Root criterion: contains a file \".projectile\"" |
110 | | - $ is_quarto_project : chr "Root criterion: contains a file \"_quarto.yml\"" |
111 | | - $ is_git_root : chr [1:3] "Root criterion: one of" "- contains a directory \".git\"" "- contains a file \".git\" with contents matching \"^gitdir: \"" |
112 | | - $ is_svn_root : chr "Root criterion: contains a directory \".svn\"" |
113 | | - $ 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\"" |
| 103 | + $ is_rstudio_project : chr "Root criterion: contains a file matching '[.]Rproj$' with contents matching '^Version: ' in the first line" |
| 104 | + $ is_vscode_project : chr "Root criterion: contains a directory '.vscode'" |
| 105 | + $ is_r_package : chr "Root criterion: contains a file 'DESCRIPTION' with contents matching '^Package: '" |
| 106 | + $ is_remake_project : chr "Root criterion: contains a file 'remake.yml'" |
| 107 | + $ is_pkgdown_project : chr [1:7] "Root criterion: one of" "- contains a file '_pkgdown.yml'" "- contains a file '_pkgdown.yaml'" "- contains a file 'pkgdown/_pkgdown.yml'" ... |
| 108 | + $ is_renv_project : chr "Root criterion: contains a file 'renv.lock' with contents matching '\"Packages\":\\s*\\{'" |
| 109 | + $ is_projectile_project: chr "Root criterion: contains a file '.projectile'" |
| 110 | + $ is_quarto_project : chr "Root criterion: contains a file '_quarto.yml'" |
| 111 | + $ is_git_root : chr [1:3] "Root criterion: one of" "- contains a directory '.git'" "- contains a file '.git' with contents matching '^gitdir: '" |
| 112 | + $ is_svn_root : chr "Root criterion: contains a directory '.svn'" |
| 113 | + $ 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'" |
114 | 114 | $ is_testthat : chr "Root criterion: directory name is \"testthat\" (also look in subdirectories: `tests/testthat`, `testthat`)" |
115 | 115 | $ from_wd : chr "Root criterion: from current working directory" |
116 | 116 |
|
|
120 | 120 | comb_crit |
121 | 121 | Output |
122 | 122 | Root criterion: one of |
123 | | - - contains a file "DESCRIPTION" with contents matching "^Package: " |
124 | | - - contains a file matching "[.]Rproj$" with contents matching "^Version: " in the first line |
| 123 | + - contains a file 'DESCRIPTION' with contents matching '^Package: ' |
| 124 | + - contains a file matching '[.]Rproj$' with contents matching '^Version: ' in the first line |
| 125 | + |
| 126 | +# is_renv_project prints regex-friendly-ish text |
| 127 | + |
| 128 | + Code |
| 129 | + is_renv_project |
| 130 | + Output |
| 131 | + Root criterion: contains a file 'renv.lock' with contents matching '"Packages":\s*\{' |
125 | 132 |
|
0 commit comments