File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8282 files : (?i)\.R$
8383 pass_filenames : true
8484 minimum_pre_commit_version : 0.15.0
85- description : ' Run stylr to format R code'
85+ description : ' Run stylr to format R code'
86+
87+ - id : r-lintr
88+ name : ' Analyse with lintr'
89+ entry : run-r-lintr.R
90+ language : ' script'
91+ files : (?i)\.R$
92+ pass_filenames : true
93+ minimum_pre_commit_version : 0.15.0
94+ description : ' Run lintr against R code'
Original file line number Diff line number Diff line change 1414 without forcing the ` --fix ` argument
1515* ` rust-clippy ` : runs ` cargo clippy ` lints in the repo root
1616* ` r-stylr ` : runs [ ` stylr ` ] to format R code
17+ * ` r-lintr ` : static analysis of R code with [ ` lintr ` ]
1718
1819## Example config
1920
6061
6162 - id : r-stylr
6263 stages : [commit, push]
64+
65+ - id : r-lintr
66+ stages : [commit, push]
6367` ` `
6468
6569## Tagged TODOs
@@ -98,4 +102,5 @@ When adding new hooks you can run `pre-commit try-repo .` for a quick syntax che
98102[`pre-commit`] : https://pre-commit.com
99103[dep] : https://github.com/golang/dep
100104[`post-checkout`] : https://git-scm.com/docs/githooks#_post_checkout
101- [`stylr`] : https://styler.r-lib.org/
105+ [`stylr`] : https://styler.r-lib.org/
106+ [`lintr`] : https://github.com/jimhester/lintr
Original file line number Diff line number Diff line change 1+ # !/usr/bin/env Rscript
2+
3+ files <- commandArgs(trailingOnly = TRUE )
4+ tryCatch(
5+ {
6+ for (f in files ) {
7+ lintr :: lint(f )
8+ }
9+ },
10+ warning = function (w ) stop(conditionMessage(w ), call. = FALSE )
11+ )
You can’t perform that action at this time.
0 commit comments