Skip to content

Commit c9ce6ed

Browse files
committed
Check if dependency is installed
1 parent 329567c commit c9ce6ed

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/lint/r/linter.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
#
99
# [1]: https://github.com/jimhester/lintr
1010

11+
# Ensure that the `lintr` package is installed...
12+
if ( !require( "lintr", quietly = TRUE, character.only = TRUE ) ) {
13+
install.packages( "lintr", repos = "http://lib.stat.cmu.edu/R/CRAN/" );
14+
}
15+
1116
# Get only the trailing command-line arguments:
1217
args <- commandArgs( trailingOnly = TRUE );
1318

@@ -16,6 +21,7 @@ n <- length( args );
1621
if ( n == 0 ) {
1722
stop( "Must provide at least one file to lint.", call. = FALSE );
1823
}
24+
1925
# Specify which linters to use...
2026
linters <- lintr::with_defaults( default = list(),
2127
# Check that no absolute paths are used:

0 commit comments

Comments
 (0)