Skip to content

Commit d0f8e67

Browse files
committed
Update GEMINI.md
1 parent c588eba commit d0f8e67

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

‎GEMINI.md‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ All exported functions must be documented using `roxygen2`-style comments (`#'`)
6666
* Make sure R-version requirements are not too strict
6767
* **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).
6868
* **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()`.
6970

7071
## S3 Object System
7172

@@ -77,7 +78,11 @@ All exported functions must be documented using `roxygen2`-style comments (`#'`)
7778

7879
* Use `tryCatch` for operations that might fail. The internal `.safe()` helper is a good example.
7980
* 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,
88+
not paste them together.

0 commit comments

Comments
 (0)