Thank you for your interest in contributing. This document describes the expected workflow for proposing changes, reporting issues, and submitting pull requests.
Reporting issues
Before opening an issue, please search existing issues at https://github.com/rgt47/zzpower/issues to confirm the problem has not already been reported. When opening a new issue, include:
- A minimal reproducible example (a
reprex::reprex()is preferred). For Shiny-app issues, describe the input values and the steps that reproduce the problem. - The output of
sessionInfo(). - The version of zzpower in use (
packageVersion('zzpower')). - The expected behaviour and the observed behaviour.
Proposing a change
For non-trivial changes, please open an issue first to discuss the approach. The plugin/registry architecture has well-defined extension points; a brief design discussion saves rework.
Adding a new statistical test
zzpower’s registry pattern makes adding tests straightforward:
- Create a test specification function (see
R/power_test_registry.R) that returns a list withid,name,pwr_function, effect-size methods, and astandardize()callback. - Register the spec in
get_power_test_registry(). - Add specification tests to
tests/testthat/test-framework.Rexercising your effect-size methods and edge cases. - The framework auto-generates the UI tab, server logic, and reports.
Pull request workflow
Fork the repository and create a topic branch off
main.-
Install development dependencies. zzpower uses
renv; restore the pinned environment with:renv::restore() Make your changes. Keep commits focused; prefer many small commits over one large one.
Add or update tests in
tests/testthat/. New exported functions require tests.Run
devtools::document()to regenerateman/andNAMESPACE.-
Run the full check locally:
devtools::check()The check must pass with no errors, warnings, or notes other than the standard ‘New submission’ note.
Update
NEWS.mdwith a one-line bullet under the unreleased section.Open a pull request against
main. Reference any related issues.
Coding style
- Use the native R pipe (
|>); avoid%>%in new code. - Use
<-for assignment, never=. - Use
snake_casefor functions and variables. - Prefer implicit returns; reserve
return()for early exits. - Document all exported functions with
roxygen2. Each must have@title,@description,@param,@return, and@examples. - Two-space indentation. Single quotes for character literals.
- Do not add ‘what’ comments. Reserve comments for non-obvious ‘why’.
Tests
Tests use testthat 3rd edition. Run with:
devtools::test()For coverage reports:
covr::package_coverage()Code of Conduct
By participating in this project, you agree to abide by the Code of Conduct.
