Skip to content

Commit dc56c6a

Browse files
prettier fix
1 parent b3d0b3d commit dc56c6a

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

tools/spectral/ipa/metrics/metricCollection.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,21 @@ import spectral from '@stoplight/spectral-core';
22
import { fileURLToPath } from 'node:url';
33
import * as fs from 'node:fs';
44
import * as path from 'node:path';
5-
import { loadOpenAPIFile, extractTeamOwnership, loadRuleset, loadCollectorResults, getSeverityPerRule, merge } from './utils.js';
5+
import {
6+
loadOpenAPIFile,
7+
extractTeamOwnership,
8+
loadRuleset,
9+
loadCollectorResults,
10+
getSeverityPerRule,
11+
merge,
12+
} from './utils.js';
613
const { Spectral } = spectral;
714

815
//TBD
916
const oasFile = '../../../../openapi/v2.json';
1017
const dirname = path.dirname(fileURLToPath(import.meta.url));
1118
const collectorResultsFile = path.join(dirname, '../ipa-collector-results-combined.log');
1219

13-
1420
async function runMetricCollectionJob() {
1521
try {
1622
console.log('Loading OpenAPI file...');
@@ -44,7 +50,6 @@ async function runMetricCollectionJob() {
4450
}
4551
}
4652

47-
4853
runMetricCollectionJob()
4954
.then((results) => fs.writeFileSync('results.log', JSON.stringify(results)))
5055
.catch((error) => console.error(error.message));

tools/spectral/ipa/metrics/utils.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import fs from 'node:fs';
2-
import {
3-
bundleAndLoadRuleset
4-
} from '@stoplight/spectral-ruleset-bundler/with-loader';
2+
import { bundleAndLoadRuleset } from '@stoplight/spectral-ruleset-bundler/with-loader';
53
import { EntryType } from './collector.js';
64

75
export function loadOpenAPIFile(filePath) {
@@ -80,8 +78,8 @@ export function merge(spectralResults, ownershipData, collectorResults, ruleSeve
8078

8179
function addEntry(entryType, adoptionStatus) {
8280
for (const entry of collectorResults[entryType]) {
83-
const existing = results.find((result) =>
84-
result.component_id === entry.componentId && result.ipa_rule === entry.ruleName
81+
const existing = results.find(
82+
(result) => result.component_id === entry.componentId && result.ipa_rule === entry.ruleName
8583
);
8684

8785
if (existing) {
@@ -107,4 +105,4 @@ export function merge(spectralResults, ownershipData, collectorResults, ruleSeve
107105
addEntry(EntryType.EXCEPTION, 'exempted');
108106

109107
return results;
110-
}
108+
}

0 commit comments

Comments
 (0)