Skip to content

Commit

Permalink
chore: PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
P0lip committed Dec 20, 2019
1 parent 3f2c731 commit 334bf49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/spectral.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class Spectral {
this._parsedRefs,
);

let validationResults = [...refDiagnostics, ...results, ...formatResolverErrors(resolved)];
const validationResults = [...refDiagnostics, ...results, ...formatResolverErrors(resolved)];

if (resolved.formats === void 0) {
const registeredFormats = Object.keys(this.formats);
Expand All @@ -115,11 +115,12 @@ export class Spectral {
}
}

validationResults = validationResults.concat(runRules(resolved, this.rules, this.functions));

return {
resolved: resolved.resolved,
results: prepareResults(validationResults, this._computeFingerprint),
results: prepareResults(
[...validationResults, ...runRules(resolved, this.rules, this.functions)],
this._computeFingerprint,
),
};
}

Expand Down
4 changes: 1 addition & 3 deletions src/utils/prepareResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ export const prepareResults = (results: IRuleResult[], computeFingerprint: Compu
const decorateResultsWithFingerprint = (results: IRuleResult[], computeFingerprint: ComputeFingerprintFunc) => {
for (const r of results) {
Object.defineProperty(r, 'fingerprint', {
get() {
return computeFingerprint(r, md5);
},
value: computeFingerprint(r, md5),
});
}

Expand Down

0 comments on commit 334bf49

Please sign in to comment.