Skip to content

feat: validate that @depends tags have both a domain and column#70

Merged
akselthomsen merged 1 commit intomainfrom
feat/validate-depends
Apr 16, 2026
Merged

feat: validate that @depends tags have both a domain and column#70
akselthomsen merged 1 commit intomainfrom
feat/validate-depends

Conversation

@matthew-phelps
Copy link
Copy Markdown
Member

@matthew-phelps matthew-phelps commented Mar 31, 2026

Pull request

Summary

Closes #69

tags_to_depends() silently produced an empty-string domain when a @depends tag had only one value (e.g., @depends USUBJID). This adds validation matching what tags_to_params() already does for @param tags.

Changes Made

  • Added validation in tags_to_depends() that checks both domain and column are non-empty, aborting with a clear error listing the invalid tags
  • Fixed @depends limit@depends domain limit in the test_coverage.mustache test fixture
  • Added error-case tests for single-value and mixed valid/invalid @depends tags

Testing

  • Added tests for tags_to_depends("USUBJID") and tags_to_depends(c("data1 var1", "USUBJID")) both expecting errors
  • Full test suite passes

Checklist

  • Code changes have been tested
  • Documentation has been updated, if applicable
  • All automated tests pass
  • Coding style and naming conventions have been followed
  • The PR is ready for review and merge

tags_to_depends() silently produced an empty domain when a
tag had only one value (e.g. "@Depends USUBJID"). Now it
errors, matching the validation already done in tags_to_params().
@github-actions
Copy link
Copy Markdown

Code coverage

Name Coverage (%)
mighty.component 100
R/component.R 100
R/custom_r.R 100
R/mighty_component_rendered.R 100
R/mighty_component_test.R 100
R/mighty_component.R 100
R/standard.R 100
R/utils-validation.R 100
R/validate_component_code.R 100
R/validate_implicit_join.R 100

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown

Github pages

Review the pkgdown webpage for the PR here

@akselthomsen akselthomsen changed the title Validate that @depends tags have both a domain and column feat: validate that @depends tags have both a domain and column Apr 16, 2026
@akselthomsen akselthomsen merged commit 8d32d9d into main Apr 16, 2026
18 checks passed
@akselthomsen akselthomsen deleted the feat/validate-depends branch April 16, 2026 13:00
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.

Validate that @depends tags have both a domain and column

3 participants