This function reads a YAML template and an options file, flattens both structures, and then checks that:
Every option defined in the template is present in the options file.
The value for each option is of the correct type.
(Optionally) It warns about extra options in the file that are not defined in the template.
options.validate(
options_file_name = NULL,
options_dir = NULL,
should_flag_redundant = FALSE,
template_path = NULL,
failure_action = "abort_verbose",
verbose = TRUE
)[list] The validation errors
[character] Name of the user options file to validate, including the suffix.
[character, optional] Full path to the folder that contains user options files. If not provided, the default folder is chosen. Defaults to NULL.
[logical, optional] If TRUE, warn the user about any extraneous options (i.e., options not defined in the options template, such as custom options that the user might have added). Defaults to FALSE.
[character, optional] Full path to the options template file. Defaults to NULL.
[character] Action to take if validation fails. Can be one of: 'abort_verbose', 'abort_quiet', 'return_errors_verbose', 'return_errors_quiet'. Defaults to 'abort_verbose'.
[logical, optional] If TRUE, print additional information about the validation process. Defaults to TRUE.
list Invisibly returns a list of error messages (empty if no errors).
For each problem found (missing option or type mismatch), an error message is printed.