igraph / rigraph

igraph R package
https://r.igraph.org
544 stars 200 forks source link

ci: is sanitizer actually working? #1286

Closed Antonov548 closed 5 months ago

aviator-app[bot] commented 6 months ago

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes. Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was closed without merging. If you still want to merge this PR, re-open it.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.
maelle commented 6 months ago

when I ran the code in run_examples.R on my machine, my R session aborted. :sweat_smile:

Antonov548 commented 6 months ago

when I ran the code in run_examples.R on my machine, my R session aborted. 😅

I see. It runs much more examples with this option and seems some of them failing.

Antonov548 commented 6 months ago

Let's see what sanitizer will show in this case.

maelle commented 6 months ago

I'm so sorry I didn't think about the dontrun before.

maelle commented 6 months ago

For the record, how to put all examples in an Rmd file to then be knit

#! /usr/bin/env Rscript

library(igraph)
library(magrittr)

target_file <- file.path("vignettes", "articles", "examples.Rmd")

lines <- c(
  "---", 'title: "examples"', "---", "",
  "```{r}", "library(igraph)", "```", ""
)

rd_files <- list.files("./man", pattern = "\\.Rd$", full.names = TRUE)

exfile <- tempfile()

for (rd_file in rd_files) {
  tools::Rd2ex(rd_file, out = exfile, commentDontrun = FALSE)

  if (!file.exists(exfile)) {
    next
  }

  example <- readLines(exfile)

  lines <- c(
    lines, "",
    sprintf("```{r rd='%s'}", rd_file),
    example,
    "```", ""
  )
}

brio::write_lines(lines, target_file)
krlmlr commented 5 months ago

Let's open a new PR for debugging when needed.