BaseTask
BaseTask
Kind: global class
new BaseTask(pluginName, context)
Creates a new instance of a BaseTask.
Param | Description |
---|---|
pluginName | The name of the plugin this task is included in. |
context | The runtime task context passed to the Task. |
baseTask.log
Gets a reference to the SARIF log.
Kind: instance property of BaseTask
Read only: true
baseTask.config
Gets an object containing optional configuration for this Task. Tasks can be configured in the .checkuprc file.
Kind: instance property of BaseTask
baseTask.enabled
A boolean indicating whether this task is enabled or not. Tasks can be enabled by specifically configuring them in the .checkuprc file.
Kind: instance property of BaseTask
baseTask.fullyQualifiedTaskName
The fully qualified name for this task, in the format
pluginName/taskName
Kind: instance property of BaseTask
baseTask.addResult(messageText, kind, level, options)
Adds a result object to the Checkup output. Result objects are SARIF Result format.
Kind: instance method of BaseTask
Param | Description |
---|---|
messageText | A non-empty string containing a plain text message |
kind | One of a fixed set of strings that specify the nature of the result |
level | One of a fixed set of strings that specify the severity level of the result |
options | Additional options to pass to the result |
options.location | Specifies a location where the result occurred |
options.properties | A property bag named properties, which stores additional values on the result |
baseTask.flattenLintResults(results) โ
Takes an array of nested lint results, ones that contain a top-level object and a messages array representing each result found for a file, and flattens them into an array of non-nested objects. This allows for easier processing into SARIF result objects.
Kind: instance method of BaseTask
Returns: An array of normalized lint results
Param | Description |
---|---|
results | An array of lint results |
baseTask.addRule(additionalRuleProps) โ
Adds rule metadata to the SARIF log.
Kind: instance method of BaseTask
Returns: The task name, which represents the rule ID in the SARIF log.
Param | Description |
---|---|
additionalRuleProps | Additional properties to be passed to the SARIF rule metadata. |
baseTask.addRuleProperties(properties)
Adds additional properties to the rule metadata's properties in the SARIF log.
Kind: instance method of BaseTask
Param | Type | Description |
---|---|---|
properties | PropertyBag | A to be merged with the rule metadata's properties. |