Skip to content

feat: Import rlang types-check standalone and implement improvements #433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

krlmlr
Copy link
Member

@krlmlr krlmlr commented Jun 19, 2025

Import comprehensive type checking functions from rlang standalone and apply them throughout the DBItest codebase to improve argument validation and error handling.

Changes

New Files

  • Add R/import-standalone-types-check.R with 20+ type checking functions
  • Add R/import-standalone-obj-type.R with supporting object type utilities

Enhanced Type Validation

  • context.R: Add validation for set_as_default (bool), name (string, nullable), default_skip (character vector, nullable)
  • run.R: Add validation for skip (character, nullable), run_only (character, nullable), test_suite (string)
  • spec-meta-bind-.R: Add validation for requires_names (bool, nullable), placeholder_fun (character/function)
  • utils.R: Enhanced check_df() to use check_data_frame() for better error messages

Benefits

  • More informative error messages with automatic argument context
  • Consistent validation patterns and error handling
  • Built-in flexibility with allow_null, allow_na options
  • Enhanced user experience with clearer type guidance

Closes #432

🤖 Generated with Claude Code

… improvements

Import comprehensive type checking functions from rlang standalone and apply them throughout the DBItest codebase to improve argument validation and error handling.

## Changes

### New Files
- Add `R/import-standalone-types-check.R` with 20+ type checking functions
- Add `R/import-standalone-obj-type.R` with supporting object type utilities

### Enhanced Type Validation
- `context.R`: Add validation for `set_as_default` (bool), `name` (string, nullable), `default_skip` (character vector, nullable)
- `run.R`: Add validation for `skip` (character, nullable), `run_only` (character, nullable), `test_suite` (string)
- `spec-meta-bind-.R`: Add validation for `requires_names` (bool, nullable), `placeholder_fun` (character/function)
- `utils.R`: Enhanced `check_df()` to use `check_data_frame()` for better error messages

## Benefits
- More informative error messages with automatic argument context
- Consistent validation patterns and error handling
- Built-in flexibility with `allow_null`, `allow_na` options
- Enhanced user experience with clearer type guidance

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Kirill Müller <[email protected]>
@krlmlr
Copy link
Member Author

krlmlr commented Jun 19, 2025

CC @moodymudskipper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use type check standalone
1 participant