ValidateSingleFile (open)

Validates a single file

Syntax

LOADLIB "mod::system/lib/validation.whlib";

RECORD FUNCTION ValidateSingleFile(STRING resourcename, RECORD options)

Parameters

STRING resourcename

resource to validate

RECORD options

Options

STRING ARRAY eslintmasks

List of masks for files to validate with eslint

BOOLEAN nomissingtids

Whether to fail validation when any tids are missing

BOOLEAN nowarnings

Whether to fail validation when any warnings are found (does not necessarily include warnings added since 2024)

BOOLEAN onlytids

If TRUE, only scan and validate tids

BLOB overridedata

If present, use this data instead of the data from disk

BOOLEAN perfectcompile

Whether to fail validation when any harescript file has a warning

Return value

RECORD

Validation results

STRING ARRAY eventmasks

Event masks for invalidation of this validation result

RECORD ARRAY messages

List of errors, warnings and hints

INTEGER messages.col

Column number for this message

INTEGER messages.line

Line number for this message

STRING messages.message

Message

RECORD messages.metadata

metadata (only when source != "unknown")

STRING messages.resourcename

Resource name for this message

STRING messages.source

Source for this message

STRING messages.type

"error", "warning" or "hint"

RECORD ARRAY tids

List of tids

STRING tids.attrname

Attribute where this tid was defined

INTEGER tids.col

Column number for this message

INTEGER tids.line

Line number for this message

STRING tids.resourcename

Resource where this tid was defined

STRING tids.tid

Tid