Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAxthelm committed Apr 9, 2024
1 parent 6b773d0 commit cfc4da0
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 14 deletions.
1 change: 1 addition & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
linters: all_linters()
exclusions: list(
"tests/testthat.R",
"tests/testthat/test-generate_package_table.R",
"R/generate_package_table.R",
"R/repo_lists.R" = c(
nonportable_path_linter = Inf
Expand Down
8 changes: 5 additions & 3 deletions R/dependencies.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
identify_gh_deps <- function(repo_fullname) {
deps <- tryCatch(
expr = {pak::pkg_deps(repo_fullname)},
expr = {
pak::pkg_deps(repo_fullname)
},
error = function(e) {
NULL
}
Expand Down Expand Up @@ -38,8 +40,8 @@ identify_if_dep <- function(
for (i in seq_along(dep_lists)) {
if (
repo_fullname %in% dep_lists[[i]] ||
repo_fullname %in% repos_to_check[[i]]
) {
repo_fullname %in% repos_to_check[[i]]
) {
dep_levels <- c(names(dep_lists)[i], dep_levels)
}
}
Expand Down
4 changes: 2 additions & 2 deletions R/get_gh_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ get_gh_dir_listing <- function(repo_fullname, dir_path) {
response,
function(x) {
list(
name = x[["name"]],
path = x[["path"]]
name = x[["name"]],
path = x[["path"]]
)
}
)
Expand Down
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ list_is_subset <- function(x, y) {
all(vapply(x, function(x_elem) {
any(vapply(y, function(y_elem) {
list_is_subset(x_elem, y_elem)
}, logical(1)))
}, logical(1)))
}, logical(1L)))
}, logical(1L)))
} else {
identical(x, y)
}
Expand Down
9 changes: 5 additions & 4 deletions R/workflows.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ workflow_summary <- function(
if (
!("push" %in% names(workflows[[wf]][["triggers"]])) ||
is.null(workflows[[wf]][["triggers"]][["push"]])
) {
) {
checks_main <- FALSE
} else {
checks_main <- "main" %in% workflows[[wf]][["triggers"]][["push"]]
Expand All @@ -102,9 +102,10 @@ workflow_summary <- function(
)
}
workflow_summary[["all_standard"]] <- all(
sapply(
workflow_summary,
function(x) x[["standard"]]
vapply(
X = workflow_summary,
FUN = function(x) x[["standard"]],
FUN.VALUE = logical(1L)
)
)
return(workflow_summary)
Expand Down
9 changes: 6 additions & 3 deletions inst/extdata/github-repos.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ output:
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(
knitr::opts_chunk[["set"]](
echo = TRUE,
cache = TRUE
)
Expand All @@ -33,7 +33,11 @@ active_repos <- all_repos |>
}
)
#remove null elements
active_repos <- active_repos[!sapply(active_repos, is.null)]
active_repos <- active_repos[!vapply(
X = active_repos,
FUN = is.null,
FUN.VALUE = logical(1L)
)]
```


Expand Down Expand Up @@ -92,5 +96,4 @@ prod_tibble |>
use_filter = TRUE,
use_search = TRUE
)
```

0 comments on commit cfc4da0

Please sign in to comment.