Skip to content

Commit 8ac2973

Browse files
run formatter
Signed-off-by: nkomonen <[email protected]>
1 parent 84d87a7 commit 8ac2973

File tree

5 files changed

+17
-23
lines changed

5 files changed

+17
-23
lines changed

src/lambda/wizards/samInitWizard.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,7 @@ export class CreateNewSamAppWizard extends Wizard<CreateNewSamAppWizardForm> {
274274

275275
this.form.name.bindPrompter(state =>
276276
createNamePrompter(
277-
getNonexistentFilenameSync(
278-
state.location!.fsPath,
279-
`lambda-${state.runtimeAndPackage!.runtime}`,
280-
'',
281-
99
282-
)
277+
getNonexistentFilenameSync(state.location!.fsPath, `lambda-${state.runtimeAndPackage!.runtime}`, '', 99)
283278
)
284279
)
285280
}

src/shared/filesystemUtilities.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,12 @@ export const makeTemporaryToolkitFolder = async (...relativePathParts: string[])
113113
}
114114

115115
// Add random characters to the leaf folder to ensure it is unique
116-
relativePathParts[relativePathParts.length - 1] = relativePathParts[relativePathParts.length - 1] + crypto.randomBytes(4).toString('hex')
116+
relativePathParts[relativePathParts.length - 1] =
117+
relativePathParts[relativePathParts.length - 1] + crypto.randomBytes(4).toString('hex')
117118

118119
const tmpPath = path.join(tempDirPath, ...relativePathParts)
119120
await fsCommon.mkdir(tmpPath)
120-
return tmpPath
121+
return tmpPath
121122
}
122123

123124
/**
@@ -220,7 +221,7 @@ export async function getNonexistentFilename(
220221
/**
221222
* @deprecated this is a synchronous duplicate of {@link getNonexistentFilename}. We are only keeping it
222223
* since some code needs to do this process synchronously and the platform agnostic file system is async.
223-
*
224+
*
224225
* Returns `name.suffix` if it does not already exist in directory `dir`, else appends
225226
* a number ("foo-1.txt", "foo-2.txt", etc.).
226227
*

src/test/shared/extensionUtilities.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ import {
1717
initializeComputeRegion,
1818
mostRecentVersionKey,
1919
} from '../../shared/extensionUtilities'
20-
import {
21-
isDifferentVersion,
22-
safeGet,
23-
setMostRecentVersion,
24-
} from '../../shared/extensionUtilities'
20+
import { isDifferentVersion, safeGet, setMostRecentVersion } from '../../shared/extensionUtilities'
2521
import * as filesystemUtilities from '../../shared/filesystemUtilities'
2622
import { FakeExtensionContext } from '../fakeExtensionContext'
2723
import { InstanceIdentity } from '../../shared/clients/ec2MetadataClient'

src/test/shared/filesystemUtilities.test.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,10 @@ describe('filesystemUtilities', function () {
4242
describe('getNonexistentFilename()', function () {
4343
const methods = [getNonexistentFilename, getNonexistentFilenameSync]
4444

45-
methods.forEach((methodUnderTest) => {
45+
methods.forEach(methodUnderTest => {
4646
it(`${methodUnderTest.name}: failure modes`, async function () {
47-
await assert.rejects(async () =>
48-
methodUnderTest('/bogus/directory/', 'foo', '.txt', 99)
49-
)
50-
await assert.rejects(async () =>
51-
methodUnderTest('zzz', 'foo', '.txt', 99)
52-
)
47+
await assert.rejects(async () => methodUnderTest('/bogus/directory/', 'foo', '.txt', 99))
48+
await assert.rejects(async () => methodUnderTest('zzz', 'foo', '.txt', 99))
5349
})
5450
it(`${methodUnderTest.name}: returns a filename that does not exist in the directory`, async function () {
5551
const dir = tempFolder

src/test/shared/fs/templateRegistry.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,14 @@ describe('CloudFormation Template Registry', async function () {
442442
})
443443

444444
it('checks for an exact handler match for C# files in a Dockerfile for image functions', async function () {
445-
await toFile('CMD: ["HelloWorld::HelloWorld.Function::FunctionHandler"]', path.join(helloPath, 'Dockerfile'))
446-
await toFile('CMD: ["HelloWorld::HelloWorld.Function::FunctionHandler"]', path.join(nestedPath, 'Dockerfile'))
445+
await toFile(
446+
'CMD: ["HelloWorld::HelloWorld.Function::FunctionHandler"]',
447+
path.join(helloPath, 'Dockerfile')
448+
)
449+
await toFile(
450+
'CMD: ["HelloWorld::HelloWorld.Function::FunctionHandler"]',
451+
path.join(nestedPath, 'Dockerfile')
452+
)
447453

448454
const helloWorldResource = {
449455
...resource,

0 commit comments

Comments
 (0)