Skip to content
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

Documentation: Guidance for creating toy datasets in testthat #478

Open
3 tasks
bms63 opened this issue Dec 12, 2024 · 2 comments
Open
3 tasks

Documentation: Guidance for creating toy datasets in testthat #478

bms63 opened this issue Dec 12, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@bms63
Copy link
Collaborator

bms63 commented Dec 12, 2024

Background

So...this might seem a bit trivial/pedantic/crazy-town, but having the toy datasets readable for testing is really nice! When you run styler on it it can squish everything together making it unreadable.

However, with some finessing we can stop styler from doing the squish and keep things readable. There is some nuances to it

  • Character variables should be left-aligned
  • numeric variables should be right-aligned.
  • The spacing counts, check out BASETYPE in image

image

See this PR for some more discussion:
pharmaverse/admiral#2560

Definition of Done:

  • Enhance testing documentation to draw attention to this readability enhancement
  • Create a few toy examples showcasing this
  • Stress in documentation that this is nice to have but not required
@bms63 bms63 added the documentation Improvements or additions to documentation label Dec 12, 2024
@bms63
Copy link
Collaborator Author

bms63 commented Dec 12, 2024

@bundfussr sorry threw this together, but I think we should make some updates to testing that we can encourage users to take a look at to help with readability of the tests.

@bundfussr
Copy link
Collaborator

Once the guidance is available we could add a link to it in the pull request template. Then it is easier to find. The issue comes up frequently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Development

No branches or pull requests

2 participants