Closed jborden closed 2 years ago
You can try running something simple like this:
# devtools::install_github("biobricks-ai/bricktools")
bricks <- list.files()
brick_check = lapply(bricks, FUN=bricktools::check_brick)
result = as.data.frame(cbind(directories, brick_check), stringsAsFactors=FALSE)
print(result)
thanks!
library(bricktools)
library(fs)
library(purrr)
context="orgs"
org="biobricks-ai"
page=1
# Clone all Repos
stringr::str_interp('curl "https://api.github.com/${context}/${org}/repos?page=${page}&per_page=100" |
grep -e \"clone_url\" |
cut -d \\" -f 4 | xargs -L1 git clone') |>
system()
bricks <- fs::dir_ls(type = "directory") |>
purrr::discard(~ .x %in% c("biobricks-r", "biobricks-issues", "bricktools"))
brick_check <- lapply(bricks, FUN = bricktools::valid)
result <- as.data.frame(cbind(bricks, brick_check), stringsAsFactors = FALSE)
print(result)
errors <- bricks |>
map(bricktools::errors) |>
purrr::discard(~ .x |>
names() |>
length() == 0)
errors |>
names() |>
walk(~ {
sprintf("Brick %s errors:", .x) |> cat()
cat("\n")
errors[[.x]] |>
stringr::str_flatten(collapse = "\n") |>
cat()
cat("\n\n")
})
you can run this in an empty dir (for example, /tmp/biobricks-ai
) to see which repos are passing and what each repos errors are
Here are the instructions for running bricktools:
devtools::install_github("biobricks-ai/bricktools")
bricktools::check_brick(dir)
where dir is the path of the directory for the brick. The function will print out whether or not dir meets each of the requirements for a brick based on our typical format.
For example:
`bricktools::check_brick("clinvar")
A functioning brick should pass all of the checks above. The function will return TRUE if all checks are passed for a given directory. It should be relatively easy to put into a loop to check all of the bricks in biobricks.