Skip to content

Commit e2b25a0

Browse files
address the comments
1 parent 911bd0c commit e2b25a0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/spectral/ipa/rulesets/functions/utils/collectionUtils.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { EXCEPTION_EXTENSION, getUnnecessaryExceptionError, hasException } from
44
/**
55
* Evaluates and collects adoptions, exceptions and violations based on the rule, evaluated object and the validation errors.
66
* If the object is violating the rule, but has an exception, the validation error is ignored
7-
* If the object is adopting the rule, but has an exception, a validation error will be returned
7+
* If the object is adopting the rule, but has an exception, an unnecessary exception error is returned, but the object is counted as adopting the rule
88
*
99
* @param {Array<{path: Array<string>, message: string}>} validationErrors the error results from the rule
1010
* @param {string} ruleName the name of the rule
@@ -20,10 +20,11 @@ export function evaluateAndCollectAdoptionStatus(validationErrors, ruleName, obj
2020
}
2121
return collectAndReturnViolation(objectPath, ruleName, validationErrors);
2222
}
23+
collectAdoption(objectPath, ruleName);
24+
2325
if (hasException(object, ruleName)) {
2426
return returnViolation(getUnnecessaryExceptionError(objectPath, ruleName));
2527
}
26-
collectAdoption(objectPath, ruleName);
2728
}
2829

2930
/**

0 commit comments

Comments
 (0)