Skip to content

Commit 5f589ee

Browse files
committed
use_claude_code() (again)
1 parent 250a006 commit 5f589ee

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

.claude/CLAUDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ air format .
4444
- All new code should have an accompanying test.
4545
- If there are existing tests, place new tests next to similar existing tests.
4646
- Strive to keep your tests minimal with few comments.
47+
- Avoid `expect_true()` and `expect_false()` in favour of a specific expectation which will give a better failure message. A few expectations in newer releases that you might not know about are `expect_all_true()`, `expect_all_equal()`, and `expect_r6_class()`.
48+
- When testing errors and warnings, don't us `expect_error()` or `expect_warning()`. Instead, use `expect_snapshot(error = TRUE)` for errors and `expect_snapshot()` for warnings because these allow the user to review the full text of the output.
49+
- Avoid the `.package` argument to `local_mocked_bindings()`; this modifies the namespace of another package which is not good practice. Instead create a mockable version of the function in the current package. See `?local_mocked_bindings` for more details.
4750

4851
### Documentation
4952

.claude/settings.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
2-
2+
"$schema": "https://json.schemastore.org/claude-code-settings.json",
33
"permissions": {
4-
"$schema": "https://json.schemastore.org/claude-code-settings.json",
5-
"defaultMode": "acceptEdits",
4+
"defaultMode": "acceptEdits",
65
"allow": [
76
"Bash(air:*)",
87
"Bash(cat:*)",
@@ -19,13 +18,13 @@
1918
"Bash(rm:*)",
2019
"Bash(Rscript:*)",
2120
"Bash(sed:*)",
22-
"Skill(*)",
21+
"Skill",
2322
"WebFetch(domain:cran.r-project.org)",
2423
"WebFetch(domain:github.com)",
2524
"WebFetch(domain:raw.githubusercontent.com)"
2625
],
2726
"deny": [
28-
"Read(.Renviron)",
27+
"Read(.Renviron)",
2928
"Read(.env)"
3029
]
3130
}

.claude/skills/tidy-argument-checking/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ These functions are exported by rlang.
7373

7474
Note that partial matching is an error, unlike `base::match.arg()`.
7575

76-
- `check_exclusive()` ensures only one of two arguments can be supplied. Supplying both together (i.e. both of them are non-`NULL`) is an error. Use `.require = TRUE` if both can be omitted.
76+
- `check_exclusive()` ensures only one of two arguments can be supplied. Supplying both together (i.e. both of them are non-`NULL`) is an error. Use `.require = FALSE` if both can be omitted.
7777

78-
- `check_required()`: Nice error message if required argument is not supplied.
78+
- `check_required()`: Nice error message if required argument (i.e. can't be `missing()`) is not supplied.
7979

8080
## `call` and `arg` arguments
8181

0 commit comments

Comments
 (0)