forked from todogroup/repolinter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresult.js
More file actions
28 lines (25 loc) · 1022 Bytes
/
result.js
File metadata and controls
28 lines (25 loc) · 1022 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright 2017 TODO Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
/**
* @typedef {Object} ResultTarget
* @property {string} [path] The filepath or axiom value executed on.
* @property {string} [pattern] The file pattern used to search, can be present if path is not available.
* @property {boolean} passed Whether or not this target passed the check.
* @property {string} [message] A message relating to this target.
*/
/**
* Object representing the result of a rule or fix job.
*
* @memberof repolinter
* @param {string?} message Message to display to console indications the output of the job. Does not need to contain the list of files checked.
* @param {ResultTarget[]} targets A list of paths that this rule/fix changed or checked
* @param {boolean} passed Whether or not the rule/fix succeeded
*/
class Result {
constructor(message, targets, passed) {
if (message) this.message = message
this.targets = targets
this.passed = passed
}
}
module.exports = Result