You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: GEMINI.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,7 @@ All exported functions must be documented using `roxygen2`-style comments (`#'`)
66
66
* Make sure R-version requirements are not too strict
67
67
***Package Functions:** Always use the `::` operator to call functions from other packages (e.g., `stats::shapiro.test`, `insight::model_info`). Do not use `library()` or `require()` at the top of a file (no full import, only selective import of functions).
68
68
***Conditional Checks:** Use `insight::check_if_installed("pkg_name")` to check if a package is available before using it, especially for optional ("Suggests") dependencies.
69
+
***Argument validation:** Use `insight::validate_argument()` instead of `match.arg()` to validate correct input of arguments, unless you need `several.ok`. In this case, rely on `match.arg()`.
69
70
70
71
## S3 Object System
71
72
@@ -77,7 +78,11 @@ All exported functions must be documented using `roxygen2`-style comments (`#'`)
77
78
78
79
* Use `tryCatch` for operations that might fail. The internal `.safe()` helper is a good example.
79
80
* Use the `insight` package's functions for user-facing messages:
80
-
*`insight::format_error()`
81
-
*`insight::format_warning()`
82
-
*`insight::format_alert()`
83
-
*`insight::print_color()`
81
+
* For errors: `insight::format_error()`
82
+
* For warnings: `insight::format_warning()`
83
+
* For messages: `insight::format_alert()`
84
+
* To highlight messages: `insight::print_color()`
85
+
Note that character vectors are not pasted together, unlike in `message()`,
86
+
thus you usually want to use something like `paste()` to concatenate the
87
+
string. Character vectors will add a new paragraph for each string element,
0 commit comments