Skip to content

Latest commit

 

History

History
73 lines (52 loc) · 2.18 KB

File metadata and controls

73 lines (52 loc) · 2.18 KB

Contributing to entropiaR

Thanks for helping out! This document covers the development workflow for the package itself. If you are here to use entropiaR, see the README.

Requirements

  • R >= 4.1; the package is tested with R 4.5.2.
  • Windows: R is typically not on PATH. Either add C:\Program Files\R\R-4.5.2\bin to your PATH, or invoke R by full path, e.g. "C:\Program Files\R\R-4.5.2\bin\Rscript.exe" -e "...".

Development environment

Install the development dependencies:

install.packages(c("devtools", "roxygen2", "testthat", "usethis", "lintr",
                   "styler", "covr", "pkgdown", "rmarkdown", "knitr", "spelling"))

The full test suite also needs the optional Suggests:

install.packages(c("ggplot2", "arrow", "bit64", "vdiffr", "tidyr",
                   "lubridate", "forcats"))

Common commands

# Load the package in the current session
Rscript -e "devtools::load_all()"

# Run the testthat suite
Rscript -e "devtools::test()"

# Full package check (must finish with 0 errors / 0 warnings)
Rscript -e "devtools::check()"

# Lint
Rscript -e "lintr::lint_package()"

# Style check (verification only, no auto-commit)
Rscript -e "styler::style_pkg(dry = 'fail')"

# Spelling (English docs only; README.md is Spanish and intentionally skipped)
Rscript -e "spelling::spell_check_package(vignettes = TRUE)"

# Coverage
Rscript -e "covr::package_coverage(type = 'tests')"

# Build the documentation site
Rscript -e "pkgdown::build_site()"

Test fixtures

  • Generated by data-raw/make_fixtures.R into tests/testthat/fixtures/.
  • Gitignored — regenerated in CI before tests run.
  • Each test receives a temp copy (via ent_fixture()), so tests never mutate the originals.
  • Never use data-test/entropia.sqlite as a test fixture (reference only).

Conventions

  • Commits: Conventional Commits, e.g. feat:, fix:, test:, docs:. No AI attribution lines.
  • Errors: all conditions go through ent_abort() with a stable entropia_error_<kind> class — no bare stop()/warning() in R/.
  • Docs: public API is documented with roxygen2; regenerate with devtools::document().