Skip to contents

Handle .pre-commit-config file for running pre-commit hooks

Usage

create_precommit_config(filename = path_precommit_files(), force = FALSE)

edit_precommit_config()

Arguments

filename

the name of the file to create

force

overwrite the file if it already exists

Details

create_precommit_config() will create a .pre-commit-config file in the current project. Only one file is allowed in the project and should be in the root directory or in the inst directory such as:

  • inst/.pre-commit-config.yml

  • inst/.pre-commit-config.yaml