-
Notifications
You must be signed in to change notification settings - Fork 3
/
.pre-commit-config.yaml
138 lines (138 loc) · 3.63 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# All available hooks: https://pre-commit.com/hooks.html
# R specific hooks: https://github.com/lorenzwalthert/precommit
exclude: '.*\.(csv|tsv|xls)$'
repos:
- repo: https://github.com/lorenzwalthert/precommit
rev: v0.4.3
hooks:
- id: use-tidy-description
- id: codemeta-description-updated
- id: spell-check
exclude: >
(?x)^(
.*\.[rR]|
.*\.feather|
.*\.jpeg|
.*\.pdf|
.*\.png|
.*\.py|
.*\.RData|
.*\.rd(s|a)|
.*\.Rd(s|a)|
.*\.RD(S|A)|
.*\.Rproj|
.*\.sh|
(.*/|)\.gitignore|
(.*/|)\.gitlab-ci\.yml|
(.*/|)\.lintr|
(.*/|)\.pre-commit-.*|
(.*/|)\.Rbuildignore|
(.*/|)\.Renviron|
(.*/|)\.Rprofile|
(.*/|)\.travis\.yml|
(.*/|)appveyor\.yml|
(.*/|)NAMESPACE|
(.*/|)renv/settings\.dcf|
(.*/|)renv\.lock|
(.*/|)WORDLIST|
\.github/workflows/.*|
data/.*|
.*\.(gz|xz|bz2)|
)$
- id: readme-rmd-rendered
- id: parsable-R
- id: no-browser-statement
- id: no-debug-statement
- id: deps-in-desc
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
args: ['--maxkb=500']
- id: file-contents-sorter
files: '^\.Rbuildignore$'
- id: end-of-file-fixer
exclude: '\.Rd'
- id: check-json
- id: check-merge-conflict
- id: mixed-line-ending
args:
- --fix=no
- id: trailing-whitespace
- id: no-commit-to-branch
args:
- --branch
- devel
- --branch
- RELEASE.*
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v4.0.0
hooks:
- args:
- build
- chore
- ci
- docs
- feat
- fix
- perf
- refactor
- revert
- style
- test
- bump
id: conventional-pre-commit
stages:
- commit-msg
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: forbid-crlf
- id: remove-crlf
- id: forbid-tabs
exclude: '.*\.[xls|tsv]$'
- id: remove-tabs
exclude: '.*\.[xls|tsv]$'
- repo: local
hooks:
- id: style_files
name: Apply bioconductor style
entry: >
Rscript --vanilla -e "styler::style_pkg(transformers = styler::tidyverse_style(indent_by = 4))"
language: system
- id: lint_files
name: Apply lintr
entry: >
Rscript --vanilla -e "lintr::lint_package()"
language: system
- id: forbid-to-commit
name: Don't commit common R artifacts
entry: Cannot commit .Rhistory, .RData, .Rds or .rds.
language: fail
files: '\.(Rhistory|RData|Rds|rds)$'
- id: bump-version
name: Bump version
entry: >
./utilities/bump-version.sh
language: system
always_run: true
pass_filenames: false
stages:
- pre-commit
- id: codemeta-json-updated
name: Update codemeta.json
entry: >
Rscript --vanilla -e "codemetar::write_codemeta()"
language: system
files: DESCRIPTION
stages:
- pre-commit
- id: create-version-tag
name: Create Version Tag
entry: >
./utilities/create_tag.sh
language: system
pass_filenames: false
always_run: true
stages:
- post-commit