Skip to content

Commit df601b7

Browse files
committed
chore: formatting
1 parent 83d1925 commit df601b7

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

lib/analyzer/image-inspector.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async function pullWithDockerBinary(
5454
"using local docker binary credentials. the credentials you provided will be ignored",
5555
);
5656
}
57-
await docker.pullCli(targetImage, {platform});
57+
await docker.pullCli(targetImage, { platform });
5858
await docker.save(targetImage, saveLocation);
5959
return true;
6060
} catch (err) {
@@ -79,7 +79,9 @@ function handleDockerPullError(err: string, platform?: string) {
7979
"manifest unknown",
8080
];
8181
if (unknownManifestConditions.some((value) => err.includes(value))) {
82-
throw new Error(`The image does not exist for ${platform ?? "the current platform"}`);
82+
throw new Error(
83+
`The image does not exist for ${platform ?? "the current platform"}`,
84+
);
8385
}
8486

8587
if (err.includes("invalid reference format")) {

lib/extractor/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,11 @@ function layersWithLatestFileModifications(
248248
return extractedLayers;
249249
}
250250

251-
/**
252-
* check if a file is 'whited out', which is shown by
253-
* prefixing the filename with a .wh.
254-
* https://www.madebymikal.com/interpreting-whiteout-files-in-docker-image-layers/
255-
*/
251+
/**
252+
* check if a file is 'whited out', which is shown by
253+
* prefixing the filename with a .wh.
254+
* https://www.madebymikal.com/interpreting-whiteout-files-in-docker-image-layers/
255+
*/
256256
export function isWhitedOutFile(filename: string) {
257257
return filename.includes(".wh.");
258258
}

lib/inputs/file-pattern/static.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ function generatePathMatcher(
1414
globsExclude: string[],
1515
): (filePath: string) => boolean {
1616
return (filePath: string): boolean => {
17-
if (globsExclude.some(glob => minimatch(filePath, glob))) {
17+
if (globsExclude.some((glob) => minimatch(filePath, glob))) {
1818
return false;
1919
}
20-
21-
return globsInclude.some(glob => minimatch(filePath, glob));
20+
21+
return globsInclude.some((glob) => minimatch(filePath, glob));
2222
};
2323
}
2424

test/lib/extractor/index.spec.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { getContentAsString } from "../../../lib/extractor";
1+
import { getContentAsString, isWhitedOutFile } from "../../../lib/extractor";
22
import { ExtractAction, ExtractedLayers } from "../../../lib/extractor/types";
3-
import { isWhitedOutFile } from "../../../lib/extractor";
43

54
describe("index", () => {
65
test("getContentAsString() does matches when a pattern is used in the extract action", async () => {
@@ -38,11 +37,11 @@ describe("isWhitedOutFile", () => {
3837
expect(isWhitedOutFile("/etc/wh.hosts")).toBe(false);
3938
expect(isWhitedOutFile("/etc/.whosts")).toBe(false);
4039
expect(isWhitedOutFile("/etc/whhosts")).toBe(false);
41-
40+
4241
// dots in wrong places
4342
expect(isWhitedOutFile("/etc/.w.h.hosts")).toBe(false);
4443
expect(isWhitedOutFile("/etc/..wh..hosts")).toBe(false);
45-
44+
4645
// case sensitive
4746
expect(isWhitedOutFile("/etc/.WH.hosts")).toBe(false);
4847
expect(isWhitedOutFile("/etc/.Wh.hosts")).toBe(false);

0 commit comments

Comments
 (0)