Validate a CITATION.cff
file or a cff
object created with
cff_create()
using the corresponding validation
schema.json.
Arguments
- x
This is expected to be either a
cff
object created withcff_create()
or the path to aCITATION.cff
file to be validated.- verbose
Logical
TRUE/FALSE
. OnTRUE
the function would display informative messages.
See also
Guide to Citation File Format schema version 1.2.0.
Other core functions:
cff_create()
,
cff_read()
,
cff_write()
Examples
# \donttest{
# Full .cff example
cff_validate(system.file("examples/CITATION_complete.cff", package = "cffr"))
#>
#> cff_validate results-----
#> Congratulations! This .cff file is valid
# Validate a cffr object
cffr <- cff_create("jsonlite")
class(cffr)
#> [1] "cff"
cff_validate(cffr)
#>
#> cff_validate results-----
#> Congratulations! This cff object is valid
# }
if (FALSE) {
# .cff with errors
cff_validate(system.file("examples/CITATION_error.cff", package = "cffr"))
# If a CITATION file (note that is not .cff) it throws an error
cff_validate(system.file("CITATION", package = "cffr"))
}