snippet_generate: Generate code snippets

View source: R/setup.R

snippet_generateR Documentation

Generate code snippets

Description

Utility function to generate code snippets:

Usage

snippet_generate(
  snippet = "additional-deps-roxygenize",
  open = rstudioapi::isAvailable(),
  root = here::here()
)

Arguments

snippet

Name of the snippet.

open

Whether or not to open the .pre-commit-config.yaml. The default is TRUE when working in RStudio. Otherwise, we recommend manually opening the file.

root

The path to the root directory of your project.

Details

Currently supported:

  • additional-deps-roxygenize: Code to paste into .pre-commit-config.yaml for the additional dependencies required by the roxygenize hook.

  • additional-deps-lintr: Code to paste into .pre-commit-config.yaml for the additional dependencies required by the lintr hook if you use --load-package.


lorenzwalthert/precommit documentation built on April 12, 2025, 2:51 p.m.