inst/lint.R

# Lint
if (!require(styler, quietly = TRUE)) {
  install.packages("styler")
}
docOrg <- lapply(dir("R", pattern = "*.R", recursive = TRUE, full.names = TRUE), readLines)
styler::style_pkg(filetype = c("R", "Rmd"))
styler::style_dir("inst", filetype = c("R", "Rmd"))
docNew <- lapply(dir("R", pattern = "*.R", recursive = TRUE, full.names = TRUE), readLines)
# Test
if (!identical(docOrg, docNew)) {
  stop("Lint was not performed, try running styler::style_pkg().")
}
adimajo/scoring documentation built on March 7, 2024, 11:18 p.m.