Skip to content

Commit a11b4b8

Browse files
add new local hook
1 parent a6da1da commit a11b4b8

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,9 @@ repos:
5656
language: fail
5757
files: '\.Rhistory|\.RData|\.Rds|\.rds$'
5858
# `exclude: <regex>` to allow committing specific files.
59+
- id: require-news-on-push
60+
name: Require bullet in NEWS.md
61+
description: NEWS.md must be updated with every PR.
62+
entry: inst/hooks/require-news-update.R
63+
stages: [push]
64+
language: script

inst/hooks/require-news-update.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#! /usr/local/bin/Rscript
2+
args <- commandArgs(trailingOnly = TRUE)
3+
if (!any(args == "NEWS.md")) {
4+
rlang::abort("Must have a news entry before pushing.")
5+
}

0 commit comments

Comments
 (0)