Skip to content

Commit daaaa87

Browse files
Prettier fix
1 parent e6c1b06 commit daaaa87

File tree

6 files changed

+10
-18
lines changed

6 files changed

+10
-18
lines changed

tools/spectral/ipa/__tests__/metrics/collector.test.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,8 @@ describe('Collector Class', () => {
1010
{ componentId: 'example.component', ruleName: 'rule-1' },
1111
{ componentId: 'example.component', ruleName: 'rule-2' },
1212
],
13-
adoptions: [
14-
{ componentId: 'example.component', ruleName: 'rule-3' },
15-
],
16-
exceptions: [
17-
{ componentId: 'example.component', ruleName: 'rule-4' },
18-
],
13+
adoptions: [{ componentId: 'example.component', ruleName: 'rule-3' }],
14+
exceptions: [{ componentId: 'example.component', ruleName: 'rule-4' }],
1915
};
2016

2117
beforeEach(() => {
@@ -38,10 +34,7 @@ describe('Collector Class', () => {
3834

3935
collector.flushToFile();
4036
const writtenData = JSON.stringify(expectedOutput, null, 2);
41-
expect(fs.writeFileSync).toHaveBeenCalledWith(
42-
'combined.log',
43-
writtenData
44-
);
37+
expect(fs.writeFileSync).toHaveBeenCalledWith('combined.log', writtenData);
4538
});
4639

4740
it('should not add invalid entries', () => {
@@ -57,4 +50,4 @@ describe('Collector Class', () => {
5750

5851
expect(fs.writeFileSync).not.toHaveBeenCalled();
5952
});
60-
});
53+
});

tools/spectral/ipa/metrics/collector.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Collector {
2727
[EntryType.EXCEPTION]: [],
2828
};
2929

30-
this.fileName = "combined.log"
30+
this.fileName = 'combined.log';
3131

3232
process.on('exit', () => this.flushToFile());
3333
process.on('SIGINT', () => {
@@ -37,9 +37,9 @@ class Collector {
3737
}
3838

3939
add(componentId, ruleName, type) {
40-
if(componentId && ruleName && type) {
40+
if (componentId && ruleName && type) {
4141
componentId = componentId.join('.');
42-
const data = {componentId, ruleName};
42+
const data = { componentId, ruleName };
4343
this.entries[type].push(data);
4444
}
4545
}

tools/spectral/ipa/rulesets/functions/eachEnumValueMustBeUpperSnakeCase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default (input, _, { path, documentInventory }) => {
3434
}
3535
});
3636

37-
if(errors.length === 0) {
37+
if (errors.length === 0) {
3838
collector.add(schemaPath, RULE_NAME, EntryType.ADOPTION);
3939
} else {
4040
collector.add(schemaPath, RULE_NAME, EntryType.VIOLATION);

tools/spectral/ipa/rulesets/functions/exceptionExtensionFormat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default (input, _, { path }) => {
1919
}
2020
});
2121

22-
if(errors.length === 0) {
22+
if (errors.length === 0) {
2323
collector.add(path, RULE_NAME, EntryType.ADOPTION);
2424
} else {
2525
collector.add(path, RULE_NAME, EntryType.VIOLATION);

tools/spectral/ipa/rulesets/functions/singletonHasNoId.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export default (input, opts, { path, documentInventory }) => {
3939
}
4040

4141
collector.add(path, RULE_NAME, EntryType.ADOPTION);
42-
4342
};
4443

4544
function schemaHasIdProperty(schema) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const EXCEPTION_EXTENSION = 'x-xgen-IPA-exception';
1010
*/
1111
export function hasException(object, ruleName, path) {
1212
if (object[EXCEPTION_EXTENSION]) {
13-
collector.add(path, ruleName, EntryType.EXCEPTION)
13+
collector.add(path, ruleName, EntryType.EXCEPTION);
1414
return Object.keys(object[EXCEPTION_EXTENSION]).includes(ruleName);
1515
}
1616
return false;

0 commit comments

Comments
 (0)