Thank you for your interest in contributing to ggforge! This document provides guidelines for contributing to the project.
Getting Started
Fork and Clone Workflow
Fork the repository on GitHub
-
Clone your fork locally:
-
Add the upstream repository as a remote:
Create a new branch for your changes (see Branch Naming below)
Make your changes, commit, and push to your fork
Open a Pull Request against the upstream repository
Branch Naming Conventions
Use descriptive branch names that reflect the type of change:
-
fix/- Bug fixes (e.g.,fix/volcano-plot-labels) -
feat/- New features (e.g.,feat/new-chord-plot-option) -
docs/- Documentation only (e.g.,docs/update-readme) -
refactor/- Code refactoring (e.g.,refactor/validator-module) -
test/- Adding or updating tests (e.g.,test/heatmap-coverage)
Before Submitting a Pull Request
1. Run Package Checks
Your contribution must pass devtools::check() before submitting a PR:
devtools::check()Resolve any errors, warnings, or notes before submitting.
2. Document Your Code
- Use roxygen2 for all function documentation
- Run
devtools::document()after adding or modifying exported functions - Follow the existing documentation style (e.g.,
@inheritParams,@keywords internalfor internal functions)
3. Follow Existing Code Style
- Match the coding style used in the rest of the package
- Use consistent indentation and naming conventions
- For new plot types, follow the existing API conventions (see API Consistency below)
4. Add or Update Tests
- Run tests with
devtools::test() - Add tests for new functionality
- Ensure existing tests continue to pass
5. Include a Reprex for Bug Reports
When reporting bugs (in issues or PR descriptions), include a minimal reproducible example using the reprex package when possible. This helps maintainers reproduce and fix the issue quickly.
API Consistency
ggforge uses a consistent API pattern across its plotting functions. When adding new plot types:
- Use the
*Plotnaming convention (e.g.,BarPlot,ScatterPlot,VolcanoPlot) - Follow the
forge()-like pattern: high-level wrapper functions that acceptdata,x,y, and common parameters (theme,palette,facet_by,split_by, etc.) - Implement an internal
*PlotAtomicfunction for the single-plot logic - Use
build_plot()from the plot-builder system for split/facet/combine support - Reuse shared parameters from
parameters.Rvia@inheritParams
Development Setup
# Install dependencies
install.packages("devtools")
devtools::install_deps(dependencies = TRUE)
# Load the package in development mode
devtools::load_all()
# Run checks
devtools::check()
devtools::test()
devtools::document()