Contributing to fmridataset
Source:CONTRIBUTING.md
We welcome contributions to the fmridataset package! This document provides guidelines for contributing.
Code Style
This package follows the tidyverse style guide with some modifications:
- Line length: Maximum 120 characters
- Naming: Use snake_case for functions and variables
- Documentation: All exported functions must have roxygen2 documentation
-
S3 methods: Follow the pattern
method_name.class_name
Development Setup
Fork and clone the repository
-
Install development dependencies:
install.packages(c("devtools", "testthat", "lintr", "roxygen2"))
-
Load the package in development mode:
devtools::load_all()
Making Changes
- Create a new branch for your feature or bug fix
- Write tests for any new functionality
- Ensure all tests pass:
devtools::test()
- Check the package:
devtools::check()
- Run the linter:
lintr::lint_package()
- Update documentation if needed:
devtools::document()
Backend Development
If you’re adding a new storage backend:
- Implement all methods from the
StorageBackend
contract (seeR/storage_backend.R
) - Validate your backend with
validate_backend()
- Add comprehensive tests
- Document the backend in the extending vignette
Testing
- Write tests using testthat
- Place test files in
tests/testthat/
- Name test files as
test-<functionality>.R
- Use descriptive test names