inst/good_pkg/README.md

inteRgrate: Very opinated package development

Lifecycle:
experimental Build
Status CRAN

The goal of inteRgrate is to provide an very opinionated set of rules for R package development. The idea is that when many people contribute to a package, it’s easy for standards to diverge. We think that CI can help here. This package has the same functions for both travis and Gitlab-CI environments. Currently, the package is used by Jumping Rivers on GitHub and GitLab.

The rationale behind this package is

This package is still being developed, but we are now actively using it, so hopefully we can avoid breaking changes.

Installation

As the package is currently being developed, it isn’t yet on CRAN. The development version can be installed from GitHub with:

install.packages("remotes")
remotes::install_github("jumpingrivers/inteRgrate")

Functions

The package is meant to be used within a continuous integration framework, e.g. travis, GitLab runner. This package contains a number functions that are useful for CI:

See the help pages for customisation.

There’s also a pre-commit hook to help. Run inteRgrate::add_pre_commit() in root git directory of your repo and checks will be run before committing.

Example .travis.yml file

Within a CI file, it’s often better to use check_via_env() that will automatically call all checks. Specific checks can be switch on/off via environment variables.

language: r
cache: packages
env:
  global:
    - ALLOWED_WARNINGS=0
    - ALLOWED_NOTES=0
    - NO_IMPORTS=0

script:
  - Rscript -e "inteRgrate::check_via_env(default = 'true')"

Example .gitlab.yml file

image: rocker/r-ubuntu:18.04
variables:
  ALLOWED_WARNINGS: 0
  ALLOWED_NOTES: 0
  NO_IMPORTS: 0

before_script:
  - Rscript -e "install.packages('remotes')"
  - Rscript -e "remotes::install_github('jumpingrivers/inteRgrate')"

check:
  script:
    - Rscript -e "inteRgrate::check_via_env(default = 'true')"

Command line

You can also use it at the command line

library("inteRgrate")
check_pkg()
check_r_filenames()

Other information

Development of this package was supported by Jumping Rivers



jumpingrivers/inteRgrate documentation built on May 20, 2022, 11:08 p.m.