The package is not yet available from CRAN but can be downloaded with the following line of code. Also you need to have conda installed.
Once you installed what you need you just run
to initiate the use of pre-commit.
Now every time you run
git commit the hooks listed in your
.pre-commit-config.yaml will be executed before the commit.
The package website includes a section on available hooks included in the package. This includes things like
readme-rmd-rendered:Make sure README.Rmd hasn’t been edited more recently than README.md, i.e. remind you to render the .Rmd to .md before committing.
no-browser-statement: Guarantees you that you don’t accidentally commit code with a browser() statement in it.
precommit::open_config() to start configuring the hooks you want.
Lastly, I’ll quote a word of warning from the README > Do not abort while hooks are running. Non-staged changes are stashed to a temp directory when the hooks are run and may not easily be recovered afterwards.