Skip to content

Commit 4628363

Browse files
committed
fix(tools): address faulty CRAN mirrors and lint issues
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: passed - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent c4dd716 commit 4628363

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tools/lint/r/linter.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
# [1]: https://github.com/jimhester/lintr
2626

2727
# Ensure that the `lintr` package is installed...
28-
if ( !require( 'lintr', quietly = TRUE, character.only = TRUE ) ) {
29-
install.packages( 'lintr', repos = 'http://lib.stat.cmu.edu/R/CRAN/', quiet = TRUE );
28+
if ( !requireNamespace( 'lintr', quietly = TRUE, character.only = TRUE ) ) {
29+
install.packages( 'lintr', repos = 'https://archive.linux.duke.edu/cran/', quiet = TRUE );
3030
}
3131

3232
# Get only the trailing command-line arguments:
@@ -39,7 +39,7 @@ if ( n == 0L ) {
3939
}
4040

4141
# Specify which linters to use...
42-
linters <- lintr::linters_with_defaults( defaults = default_linters,
42+
linters <- lintr::linters_with_defaults( defaults = lintr::default_linters,
4343
# Check that no absolute paths are used:
4444
absolute_path_linter = lintr::absolute_path_linter(),
4545

@@ -111,7 +111,7 @@ linters <- lintr::linters_with_defaults( defaults = default_linters,
111111
T_and_F_symbol_linter = lintr::T_and_F_symbol_linter(),
112112

113113
# Report the use of undesirable functions (e.g., `attach` or `sapply`) and suggest an alternative:
114-
undesirable_function_linter = lintr::undesirable_function_linter( fun = within( default_undesirable_functions, rm( options ) ) ),
114+
undesirable_function_linter = lintr::undesirable_function_linter( fun = within( lintr::default_undesirable_functions, rm( options ) ) ),
115115

116116
# Report the use of undesirable operators (e.g., `:::` or `<<-`) and suggest an alternative:
117117
undesirable_operator_linter = lintr::undesirable_operator_linter(),

tools/scripts/install_r_pkgs.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ args <- commandArgs( trailingOnly = TRUE );
2626

2727
# Check that at least one package name has been provided...
2828
n <- length( args );
29-
if ( n == 0 ) {
30-
stop( "Must provide at least one package to install.", call. = FALSE );
29+
if ( n == 0L ) {
30+
stop( 'Must provide at least one package to install.', call. = FALSE );
3131
}
3232
# Install each package...
33-
for ( i in 1:n ) {
34-
install.packages( args[ i ], repos = "http://lib.stat.cmu.edu/R/CRAN/" );
33+
for ( i in 1L:n ) {
34+
install.packages( args[ i ], repos = 'https://archive.linux.duke.edu/cran/' );
3535
}

0 commit comments

Comments
 (0)