Skip to content

Commit 8724251

Browse files
add precommit (#11)
1 parent 4a89847 commit 8724251

2 files changed

Lines changed: 80 additions & 3 deletions

File tree

.Rbuildignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
^glossary\.Rproj$
2-
^\.Rproj\.user$
1+
^LICENSE\.md$
32
^README\.Rmd$
3+
^\.Rproj\.user$
44
^\.github$
5-
^LICENSE\.md$
5+
^\.pre-commit-config\.yaml$
6+
^glossary\.Rproj$
67
^_pkgdown\.yml$
78
^docs$
89
^pkgdown$

.pre-commit-config.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# All available hooks: https://pre-commit.com/hooks.html
2+
# R specific hooks: https://github.com/lorenzwalthert/precommit
3+
repos:
4+
- repo: https://github.com/lorenzwalthert/precommit
5+
rev: v0.4.3.9014
6+
hooks:
7+
- id: style-files
8+
args: [--style_pkg=styler, --style_fun=tidyverse_style]
9+
- id: roxygenize
10+
# codemeta must be above use-tidy-description when both are used
11+
# - id: codemeta-description-updated
12+
- id: use-tidy-description
13+
- id: spell-check
14+
exclude: >
15+
(?x)^(
16+
.*\.[rR]|
17+
.*\.feather|
18+
.*\.jpeg|
19+
.*\.pdf|
20+
.*\.png|
21+
.*\.py|
22+
.*\.RData|
23+
.*\.rds|
24+
.*\.Rds|
25+
.*\.Rproj|
26+
.*\.sh|
27+
(.*/|)\.gitignore|
28+
(.*/|)\.gitlab-ci\.yml|
29+
(.*/|)\.lintr|
30+
(.*/|)\.pre-commit-.*|
31+
(.*/|)\.Rbuildignore|
32+
(.*/|)\.Renviron|
33+
(.*/|)\.Rprofile|
34+
(.*/|)\.travis\.yml|
35+
(.*/|)appveyor\.yml|
36+
(.*/|)NAMESPACE|
37+
(.*/|)renv/settings\.dcf|
38+
(.*/|)renv\.lock|
39+
(.*/|)WORDLIST|
40+
\.github/workflows/.*|
41+
data/.*|
42+
)$
43+
- id: lintr
44+
- id: readme-rmd-rendered
45+
- id: parsable-R
46+
- id: no-browser-statement
47+
- id: no-print-statement
48+
- id: no-debug-statement
49+
- id: deps-in-desc
50+
- id: pkgdown
51+
- repo: https://github.com/pre-commit/pre-commit-hooks
52+
rev: v6.0.0
53+
hooks:
54+
- id: check-added-large-files
55+
args: ['--maxkb=200']
56+
- id: file-contents-sorter
57+
files: '^\.Rbuildignore$'
58+
- id: end-of-file-fixer
59+
exclude: '\.Rd'
60+
- repo: https://github.com/pre-commit-ci/pre-commit-ci-config
61+
rev: v1.6.1
62+
hooks:
63+
# Only required when https://pre-commit.ci is used for config validation
64+
- id: check-pre-commit-ci-config
65+
- repo: local
66+
hooks:
67+
- id: forbid-to-commit
68+
name: Don't commit common R artifacts
69+
entry: Cannot commit .Rhistory, .RData, .Rds or .rds.
70+
language: fail
71+
files: '\.(Rhistory|RData|Rds|rds)$'
72+
# `exclude: <regex>` to allow committing specific files
73+
74+
ci:
75+
autoupdate_schedule: monthly
76+
skip: [pkgdown]

0 commit comments

Comments
 (0)