View source: R/02_checkStyle.R
checkStyle | R Documentation |
Checks a file for violations of the INWT style conventions using
lint
.
The linters
are partly taken from the package
lintr
, and partly from this package.
checkStyle(files, linters = selectLinters(...), ...)
files |
character vector: One or more filepaths |
linters |
list: Named list of used linter functions |
... |
Arguments passed to |
Per default, the used linters are selected via
selectLinters
. If you pass a list of linters directly via the
linters
argument, all arguments passed to selectLinters
via ...
will be ignored.
## Not run:
writeLines(con = "lintExample.txt",
text = c("# Example script to demonstrate INWT's own linters",
# nolint start
"",
"foo <- function(x = 1, y) {",
" 2*x + 1",
"}",
"",
paste0("# This line contains double spaces and is ",
"very long. The following lines will use = ",
"instead of <- and access an internal INWT ",
"function."),
"z = 1",
"print(INWTUtils:::scriptLinters())",
""))
# nolint end
checkStyle("lintExample.txt", type = "script")
unlink("lintExample.txt") # Remove file
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.