-
Notifications
You must be signed in to change notification settings - Fork 968
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
100 changed files
with
2,151 additions
and
960 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
for (f in list.files('ci/linters', full.names=TRUE)) source(f) | ||
rm(f) | ||
|
||
linters = all_linters( | ||
packages = "lintr", # TODO(lintr->3.2.0): Remove this. | ||
# eq_assignment_linter(), | ||
brace_linter(allow_single_line = TRUE), | ||
# TODO(michaelchirico): Activate these incrementally. These are the | ||
# parameterizations that match our style guide. | ||
# implicit_assignment_linter(allow_lazy = TRUE, allow_scoped = TRUE), | ||
# implicit_integer_linter(allow_colon = TRUE), | ||
# system_time_linter = undesirable_function_linter(c( | ||
# system.time = "Only run timings in benchmark.Rraw" | ||
# )), | ||
# undesirable_function_linter(modify_defaults( | ||
# default_undesirable_functions, | ||
# ifelse = "Use fifelse instead.", | ||
# Sys.setenv = NULL, | ||
# library = NULL, | ||
# options = NULL, | ||
# par = NULL, | ||
# setwd = NULL | ||
# )), | ||
undesirable_operator_linter(modify_defaults( | ||
default_undesirable_operators, | ||
`<<-` = NULL | ||
)), | ||
# TODO(lintr#2441): Use upstream implementation. | ||
assignment_linter = NULL, | ||
# TODO(lintr#2442): Use this once x[ , j, by] is supported. | ||
commas_linter = NULL, | ||
commented_code_linter = NULL, | ||
# TODO(linter->3.2.0): Activate this. | ||
consecutive_assertion_linter = NULL, | ||
cyclocomp_linter = NULL, | ||
function_argument_linter = NULL, | ||
indentation_linter = NULL, | ||
infix_spaces_linter = NULL, | ||
# TODO(R>3.2.0): Activate this, extending to recognize vapply_1i(x, length). | ||
lengths_linter = NULL, | ||
line_length_linter = NULL, | ||
missing_package_linter = NULL, | ||
namespace_linter = NULL, | ||
nonportable_path_linter = NULL, | ||
object_name_linter = NULL, | ||
object_usage_linter = NULL, | ||
quotes_linter = NULL, | ||
semicolon_linter = NULL, | ||
spaces_inside_linter = NULL, | ||
spaces_left_parentheses_linter = NULL, | ||
# TODO(michaelchirico): Only exclude from vignettes, not sure what's wrong. | ||
strings_as_factors_linter = NULL, | ||
# TODO(lintr->3.2.0): Fix on a valid TODO style, enforce it, and re-activate. | ||
todo_comment_linter = NULL, | ||
# TODO(michaelchirico): Enforce these and re-activate them one-by-one. Also stop using '<<-'. | ||
brace_linter = NULL, | ||
condition_call_linter = NULL, | ||
conjunct_test_linter = NULL, | ||
fixed_regex_linter = NULL, | ||
function_left_parentheses_linter = NULL, | ||
if_not_else_linter = NULL, | ||
implicit_assignment_linter = NULL, | ||
implicit_integer_linter = NULL, | ||
keyword_quote_linter = NULL, | ||
length_levels_linter = NULL, | ||
matrix_apply_linter = NULL, | ||
missing_argument_linter = NULL, | ||
nzchar_linter = NULL, | ||
object_overwrite_linter = NULL, | ||
paren_body_linter = NULL, | ||
redundant_equals_linter = NULL, | ||
rep_len_linter = NULL, | ||
repeat_linter = NULL, | ||
return_linter = NULL, | ||
sample_int_linter = NULL, | ||
scalar_in_linter = NULL, | ||
seq_linter = NULL, | ||
undesirable_function_linter = NULL, | ||
unnecessary_concatenation_linter = NULL, | ||
unnecessary_lambda_linter = NULL, | ||
unnecessary_nesting_linter = NULL, | ||
unreachable_code_linter = NULL, | ||
unused_import_linter = NULL | ||
) | ||
# TODO(lintr#2172): Glob with lintr itself. | ||
exclusions = local({ | ||
exclusion_for_dir <- function(dir, exclusions) { | ||
files = list.files(dir, pattern = "\\.(R|Rmd)$") | ||
stats::setNames(rep(list(exclusions), length(files)), files) | ||
} | ||
c( | ||
exclusion_for_dir("tests", list( | ||
quotes_linter = Inf, | ||
# TODO(michaelchirico): Enforce these and re-activate them one-by-one. | ||
implicit_integer_linter = Inf, | ||
infix_spaces_linter = Inf, | ||
undesirable_function_linter = Inf | ||
)), | ||
exclusion_for_dir("vignettes", list( | ||
quotes_linter = Inf | ||
# strings_as_factors_linter = Inf | ||
# system_time_linter = Inf | ||
)) | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
on: | ||
schedule: | ||
- cron: '18 13 8 * *' # 8th of month at 13:18 UTC | ||
|
||
# A more complete suite of checks to run monthly; each PR/merge need not pass all these, but they should pass before CRAN release | ||
name: R-CMD-check-occasional | ||
|
||
jobs: | ||
R-CMD-check-occasional: | ||
runs-on: ${{ matrix.os }} | ||
|
||
name: ${{ matrix.os }} (${{ matrix.r }}) | ||
|
||
strategy: | ||
matrix: | ||
os: [macOS-latest, windows-latest, ubuntu-latest] | ||
r: ['devel', 'release', '3.2', '3.3', '3.4', '3.5', '3.6', '4.0', '4.1', '4.2', '4.3'] | ||
locale: ['en_US.utf8', 'zh_CN.utf8', 'lv_LV.utf8'] # Chinese for translations, Latvian for collate order (#3502) | ||
exclude: # only run non-English locale CI on Ubuntu | ||
- os: macOS-latest | ||
locale: 'zh_CN.utf8' | ||
- os: macOS-latest | ||
locale: 'lv_LV.utf8' | ||
- os: windows-latest | ||
locale: 'zh_CN.utf8' | ||
- os: windows-latest | ||
locale: 'lv_LV.utf8' | ||
|
||
env: | ||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | ||
TEST_DATA_TABLE_WITH_OTHER_PACKAGES: true | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- name: Set locale | ||
if: matrix.locale == 'en_US.utf8' | ||
run: | | ||
sudo locale-gen en_US | ||
echo "LC_ALL=en_US.utf8" >> $GITHUB_ENV | ||
- name: Set locale | ||
if: matrix.locale == 'zh_CN.utf8' | ||
run: | | ||
sudo locale-gen zh_CN | ||
echo "LC_ALL=zh_CN.utf8" >> $GITHUB_ENV | ||
echo "LANGUAGE=zh_CN" >> $GITHUB_ENV | ||
- name: Set locale | ||
if: matrix.locale == 'lv_LV.utf8' | ||
run: | | ||
sudo locale-gen lv_LV | ||
echo "LC_ALL=lv_LV.utf8" >> $GITHUB_ENV | ||
echo "LANGUAGE=lv_LV" >> $GITHUB_ENV | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: ${{ matrix.r }} | ||
|
||
|
||
- name: Query dependencies | ||
run: | | ||
install.packages('remotes') | ||
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) | ||
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") | ||
shell: Rscript {0} | ||
|
||
- name: Restore R package cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.R_LIBS_USER }} | ||
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} | ||
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- | ||
|
||
- name: Install system dependencies | ||
if: runner.os == 'Linux' | ||
run: | | ||
while read -r cmd | ||
do | ||
eval sudo $cmd | ||
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') | ||
- name: Install dependencies | ||
run: | | ||
remotes::install_deps(dependencies = TRUE) | ||
remotes::install_cran("rcmdcheck") | ||
shell: Rscript {0} | ||
|
||
- name: Check | ||
env: | ||
_R_CHECK_CRAN_INCOMING_REMOTE_: false | ||
run: | | ||
options(crayon.enabled = TRUE) | ||
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") | ||
shell: Rscript {0} | ||
|
||
- name: Upload check results | ||
if: failure() | ||
uses: actions/upload-artifact@main | ||
with: | ||
name: ${{ runner.os }}-r${{ matrix.r }}-results | ||
path: check |
Oops, something went wrong.