Skip to content

Commit 28a3d33

Browse files
committed
mv desc hook -> .hooks
1 parent 21f0154 commit 28a3d33

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

.hooks/description

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env Rscript
2+
3+
s <- gert::git_status()
4+
chk <- ("DESCRIPTION" %in% s$file &&
5+
(s$status [s$file == "DESCRIPTION"] == "modified" |
6+
s$status [s$file == "DESCRIPTION"] == "new"))
7+
if (!chk)
8+
stop ("DESCRIPTION has not been updated")
9+
10+
f <- file.path (rprojroot::find_root("DESCRIPTION"), "DESCRIPTION")
11+
x <- system2 ("git", args = c ("diff", "--cached", "-U0", f), stdout = TRUE)
12+
if (!any (grepl ("^\\+Version", x)))
13+
stop ("Version number in DESCRIPTION has not been incremented")

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ repos:
4848
files: '\.Rhistory|\.RData|\.Rds|\.rds$'
4949
- id: description version
5050
name: Version has been incremeneted in DESCRIPTION
51-
entry: /home/smexus/bin/precommit/description
51+
entry: .hooks/description
5252
language: script
5353
# `exclude: <regex>` to allow committing specific files.

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: allcontributors
22
Title: Acknowledge all Contributors to a Project
3-
Version: 0.0.2.006
3+
Version: 0.0.2.007
44
Authors@R:
55
person(given = "Mark",
66
family = "Padgham",

codemeta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"codeRepository": "https://github.com/ropenscilabs/allcontributors",
1111
"issueTracker": "https://github.com/ropenscilabs/allcontributors/issues",
1212
"license": "https://spdx.org/licenses/GPL-3.0",
13-
"version": "0.0.2.6",
13+
"version": "0.0.2.007",
1414
"programmingLanguage": {
1515
"@type": "ComputerLanguage",
1616
"name": "R",

0 commit comments

Comments
 (0)