-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
_snaps | ||
CITATION | ||
allpackages.csv | ||
results.md |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
|
||
library(cffr) | ||
|
||
installed <- as.data.frame(installed.packages()[, c("Package", "Version")]) | ||
installed <- installed[order(installed$Package), ] | ||
# installed <- installed[1:50, ] | ||
Check warning on line 6 in tests/testthat/test_ci/test-new.R GitHub Actions / Run lintr scanning
Check notice Code scanning / lintr Commented code should be removed. Note test
Commented code should be removed.
|
||
|
||
rownames(installed) <- seq_len(nrow(installed)) | ||
|
||
l <- nrow(installed) | ||
|
||
dir_path <- "./tests/testthat/test_ci/" | ||
dbcsv <- file.path(dir_path, "allpackages.csv") | ||
|
||
# Initial set of packages | ||
write.csv(installed, file = dbcsv, row.names = FALSE) | ||
|
||
res <- c() | ||
withcit <- c() | ||
note <- c() | ||
for (i in seq_len(nrow(installed))) { | ||
pkg <- installed[i, ]$Package | ||
# Display some advances | ||
message( | ||
"Testing ", i, "/", nrow(installed), | ||
Check warning on line 25 in tests/testthat/test_ci/test-new.R GitHub Actions / Run lintr scanning
Check notice Code scanning / lintr Hanging indent should be 10 spaces but is 4 spaces. Note test
Hanging indent should be 10 spaces but is 4 spaces.
|
||
" (", sprintf("%05.02f", i / nrow(installed) * 100), "%) [" | ||
,installed[i, ]$Package, "]") | ||
Check warning on line 27 in tests/testthat/test_ci/test-new.R GitHub Actions / Run lintr scanning
Check notice Code scanning / lintr Hanging indent should be 10 spaces but is 2 spaces. Note test
Hanging indent should be 10 spaces but is 2 spaces.
Check notice Code scanning / lintr Commas should always have a space after. Note test
Commas should always have a space after.
|
||
cit_path <- file.path(find.package(installed[i, ]$Package), "CITATION") | ||
|
||
|
||
if (file.exists(cit_path)) { | ||
withcit <- c(withcit, TRUE) | ||
} else { | ||
withcit <- c(withcit, FALSE) | ||
} | ||
|
||
# Add cffobj | ||
cffobj <- try( | ||
cff_create(pkg, gh_keywords = FALSE, dependencies = FALSE), silent = TRUE) | ||
Check notice Code scanning / lintr Hanging indent should be 16 spaces but is 4 spaces. Note test
Hanging indent should be 16 spaces but is 4 spaces.
|
||
|
||
if(inherits(cffobj, "cff")){ | ||
Check notice Code scanning / lintr Place a space before left parenthesis, except in a function call. Note test
Place a space before left parenthesis, except in a function call.
Check notice Code scanning / lintr There should be a space before an opening curly brace. Note test
There should be a space before an opening curly brace.
Check notice Code scanning / lintr There should be a space between a right parenthesis and a body expression. Note test
There should be a space between a right parenthesis and a body expression.
|
||
s <- try(cff_validate(cffobj, verbose = FALSE), silent = TRUE) | ||
Check notice Code scanning / lintr Indentation should be 4 spaces but is 2 spaces. Note test
Indentation should be 4 spaces but is 2 spaces.
|
||
if(!is.logical(s)) s <- FALSE | ||
Check notice Code scanning / lintr Place a space before left parenthesis, except in a function call. Note test
Place a space before left parenthesis, except in a function call.
|
||
|
||
res <- c(res, s) | ||
Check notice Code scanning / lintr Indentation should be 4 spaces but is 2 spaces. Note test
Indentation should be 4 spaces but is 2 spaces.
|
||
note <- c(note, "ok, cff") | ||
} else { | ||
res <- c(res, FALSE) | ||
note <- c(note, "Other errors") | ||
} | ||
} | ||
|
||
installed$with_citation <- withcit | ||
installed$is_ok <- res | ||
installed$note <- note | ||
|
||
|
||
outmd <- file.path(dir_path, "results.md") | ||
capture.output(knitr::kable(installed), file = outmd) | ||
|
||
Check notice Code scanning / lintr Trailing blank lines are superfluous. Note test
Trailing blank lines are superfluous.
|
||
|
||
Check notice Code scanning / lintr Trailing blank lines are superfluous. Note test
Trailing blank lines are superfluous.
|