Skip to content

Commit

Permalink
fix: apply prettier-3.0 formatter
Browse files Browse the repository at this point in the history
Signed-off-by: Valeriy Svydenko <[email protected]>
  • Loading branch information
svor committed Jul 6, 2023
1 parent 49f1054 commit a45ae41
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
10 changes: 5 additions & 5 deletions tools/build/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class Build {
cheEditorsYaml.editors.map(async (cheEditorYaml: CheEditorYaml) => {
const cheEditorMetaInfo: CheEditorMetaInfo = { ...cheEditorYaml };
return cheEditorMetaInfo;
})
}),
);

return cheEditors;
Expand All @@ -101,7 +101,7 @@ export class Build {
if (promise) {
promise.then(
() => task.success(),
() => task.error()
() => task.error(),
);
}
return promise;
Expand All @@ -113,7 +113,7 @@ export class Build {
const cheEditors = await this.wrapIntoTask('Analyze che-editors.yaml file', this.analyzeCheEditorsYaml());
const cheEditorsMetaYaml = await this.wrapIntoTask(
'Compute meta.yaml for che-editors',
this.cheEditorsMetaYamlGenerator.compute(cheEditors)
this.cheEditorsMetaYamlGenerator.compute(cheEditors),
);

const computedYamls = [...cheEditorsMetaYaml];
Expand All @@ -123,7 +123,7 @@ export class Build {
// update all images to use digest instead of tags
allMetaYamls = await this.wrapIntoTask(
'Update tags by digests for OCI images',
this.digestImagesHelper.updateImages(computedYamls)
this.digestImagesHelper.updateImages(computedYamls),
);
}

Expand All @@ -133,7 +133,7 @@ export class Build {
// generate v3/plugins folder
const generatedYamls = await this.wrapIntoTask(
'Write meta.yamls in v3/plugins folder',
this.metaYamlWriter.write(allMetaYamls)
this.metaYamlWriter.write(allMetaYamls),
);

// generate index.json
Expand Down
2 changes: 1 addition & 1 deletion tools/build/src/editor/che-editors-meta-yaml-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class CheEditorsMetaYamlGenerator {
spec,
skipMetaYaml,
} as MetaYamlPluginInfo;
})
}),
);

return metaYamlPluginInfos;
Expand Down
10 changes: 5 additions & 5 deletions tools/build/src/meta-yaml/digest-images-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ export class DigestImagesHelper {
if (spec.containers) {
await Promise.all(
spec.containers.map(
async container => (container.image = await this.registryHelper.getImageDigest(container.image))
)
async container => (container.image = await this.registryHelper.getImageDigest(container.image)),
),
);
}
if (spec.initContainers) {
await Promise.all(
spec.initContainers.map(
async container => (container.image = await this.registryHelper.getImageDigest(container.image))
)
async container => (container.image = await this.registryHelper.getImageDigest(container.image)),
),
);
}
}
return plugin;
})
}),
);
}
}
4 changes: 2 additions & 2 deletions tools/build/src/meta-yaml/meta-yaml-writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ export class MetaYamlWriter {
const devfileYamlString = jsyaml.dump(devfileYaml, { noRefs: true, lineWidth: -1 });
promises.push(fs.writeFile(devfilePath, devfileYamlString));
}
})
}),
);
return Promise.all(promises);
})
}),
);
return metaYamlPluginGenerated;
}
Expand Down
2 changes: 1 addition & 1 deletion tools/build/src/registry/registry-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class RegistryHelper {
// do not grab digest of an image that is being published (if tag contains the current sha1)
if (dockerImageName.tag && dockerImageName.tag.includes(this.shortSha1)) {
console.log(
`Do not fetch digest for ${imageName} as the tag ${dockerImageName.tag} includes the current sha1 ${this.shortSha1}`
`Do not fetch digest for ${imageName} as the tag ${dockerImageName.tag} includes the current sha1 ${this.shortSha1}`,
);
return imageName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ describe('Test ChePluginsMetaYamlGenerator', () => {
const cheEditorMetaInfo = await generateEditorMetaInfo('my/incomplete');
const cheEditorMetaInfos: CheEditorMetaInfo[] = [cheEditorMetaInfo];
await expect(cheEditorsMetaYamlGenerator.compute(cheEditorMetaInfos)).rejects.toThrow(
'is not composed of 3 parts separated by /'
'is not composed of 3 parts separated by /',
);
});

Expand Down
16 changes: 8 additions & 8 deletions tools/build/tests/meta-yaml/meta-yaml-writer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('Test MetaYamlWriter', () => {

expect(fsCopyFileSpy).toHaveBeenCalledWith(
'/fake-dir/icon.png',
'/fake-output/v3/images/my-publisher-my-name-icon.png'
'/fake-output/v3/images/my-publisher-my-name-icon.png',
);
expect(fsEnsureDirSpy).toHaveBeenNthCalledWith(1, '/fake-output/v3/plugins');
expect(fsEnsureDirSpy).toHaveBeenNthCalledWith(2, '/fake-output/v3/images');
Expand All @@ -110,7 +110,7 @@ spec:
expect(fsWriteFileSpy).toHaveBeenNthCalledWith(
1,
'/fake-output/v3/plugins/custom-publisher/custom-name/latest/meta.yaml',
content
content,
);

// check that alias is also being written (and alias is deprecated)
Expand All @@ -121,7 +121,7 @@ spec:
expect(fsWriteFileSpy).toHaveBeenNthCalledWith(
2,
'/fake-output/v3/plugins/first/alias/latest/meta.yaml',
aliasContent
aliasContent,
);
});

Expand All @@ -145,7 +145,7 @@ spec:
expect(fsEnsureDirSpy).toHaveBeenNthCalledWith(3, '/fake-output/v3/resources');
expect(fsEnsureDirSpy).toHaveBeenNthCalledWith(
4,
'/fake-output/v3/plugins/custom-publisher/custom-name/my-version'
'/fake-output/v3/plugins/custom-publisher/custom-name/my-version',
);
// icon is the default one
const content = `apiVersion: v2
Expand All @@ -169,7 +169,7 @@ spec:
expect(fsWriteFileSpy).toHaveBeenNthCalledWith(
1,
'/fake-output/v3/plugins/custom-publisher/custom-name/my-version/meta.yaml',
content
content,
);
// no version written with disable Latest
expect(fsWriteFileSpy).toHaveBeenCalledTimes(1);
Expand Down Expand Up @@ -229,7 +229,7 @@ spec:
expect(fsWriteFileSpy).toHaveBeenNthCalledWith(
1,
'/fake-output/v3/plugins/foo/bar/latest/devfile.yaml',
'devfileFakeResult: dummy\n'
'devfileFakeResult: dummy\n',
);
});

Expand Down Expand Up @@ -271,7 +271,7 @@ spec:
expect(fsWriteFileSpy).toHaveBeenNthCalledWith(
2,
'/fake-output/v3/plugins/foo/bar/latest/devfile.yaml',
'devfileFakeResult: dummy\n'
'devfileFakeResult: dummy\n',
);
});

Expand Down Expand Up @@ -320,7 +320,7 @@ spec:
expect(fsWriteFileSpy).toHaveBeenNthCalledWith(
2,
'/fake-output/v3/plugins/foo/bar/latest/devfile.yaml',
'devfileFakeResult: dummy\n'
'devfileFakeResult: dummy\n',
);
});
});

0 comments on commit a45ae41

Please sign in to comment.