Skip to content

Commit 81cde0e

Browse files
authored
chore: enforce eol-last rule (#32335)
### Reason for this change This rule was previously not enforced and implementation inconsistent. Enforcing a new line at the end of the file makes it easier to append files. ### Description of changes **No code changes! Only formatting.** 💅🏻 And a bit of config: - Added a new eslint rule for `eol-last` - Added a VSCode seting to automatically insert newlines - Applied the rule to all non-compliant files Best reviewed with whitespace changes ignored: https://github.com/aws/aws-cdk/pull/32335/files?w=1 ### Description of how you validated changes No code changes, purely formatting. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent dc7574a commit 81cde0e

File tree

778 files changed

+840
-839
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

778 files changed

+840
-839
lines changed

aws-cdk.code-workspace

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"folders": [{ "path": "." }],
33
"settings": {
4+
"files.insertFinalNewline": true,
45
"jest.jestCommandLine": "node_modules/.bin/jest",
56
"jest.autoRun": "off",
67
"jest.virtualFolders": [
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import * as path from 'path';
22
// eslint-disable-next-line no-console
3-
console.log(path.resolve(__dirname, '..'));
3+
console.log(path.resolve(__dirname, '..'));

packages/@aws-cdk-testing/cli-integ/lib/eventually.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ const eventually = async <T>(call: () => Promise<T>, options?: EventuallyOptions
3939
throw new Error('An unexpected error has occurred.');
4040
};
4141

42-
export default eventually;
42+
export default eventually;

packages/@aws-cdk-testing/cli-integ/lib/github.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ export async function fetchPreviousVersion(token: string, options?: {
4040
if (previousMVRelease) { return previousMVRelease; }
4141

4242
throw new Error(`Unable to find previous version given ${JSON.stringify(options)}`);
43-
};
43+
};

packages/@aws-cdk-testing/cli-integ/lib/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ export * from './with-aws';
1010
export * from './with-cdk-app';
1111
export * from './with-packages';
1212
export * from './with-temporary-directory';
13-
export * from './resources';
13+
export * from './resources';

packages/@aws-cdk-testing/cli-integ/lib/lists.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ export function chunk<A>(n: number, xs: A[]): A[][] {
66
}
77

88
return ret;
9-
}
9+
}

packages/@aws-cdk-testing/cli-integ/lib/memoize.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ export function memoize0<A>(fn: () => Promise<A>): () => Promise<A> {
1111
}
1212
return promise;
1313
};
14-
}
14+
}

packages/@aws-cdk-testing/cli-integ/lib/package-sources/release-source.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ export class ReleasePackageSource implements IPackageSource {
7878
return `${frameworkVersion}-alpha.0`;
7979
}
8080
}
81-
}
81+
}

packages/@aws-cdk-testing/cli-integ/lib/package-sources/repo-tools/npm.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ child.once('close', code => {
4545
if (code) {
4646
process.exitCode = code;
4747
}
48-
});
48+
});

packages/@aws-cdk-testing/cli-integ/lib/package-sources/source.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ export interface IPackageSource {
3232
* Not all tests will respect this.
3333
*/
3434
requestedAlphaVersion(): string;
35-
}
35+
}

packages/@aws-cdk-testing/cli-integ/lib/package-sources/subprocess.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ export function packageSourceInSubprocess(): IPackageSource {
1212
case 'release': return new ReleasePackageSource();
1313
default: throw new Error(`Unrecognized package source: ${process.env.PACKAGE_SOURCE}`);
1414
}
15-
}
15+
}

packages/@aws-cdk-testing/cli-integ/lib/staging/npm.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ async function writeNpmLoginToken(usageDir: UsageDir, endpoint: string, token: s
5959
return rcFile;
6060
}
6161

62-
// Environment variable, .npmrc in same directory as package.json or in home dir
62+
// Environment variable, .npmrc in same directory as package.json or in home dir

packages/@aws-cdk-testing/cli-integ/lib/staging/nuget.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ async function writeNuGetConfigFile(filename: string, login: LoginInformation) {
7272
</configuration>`);
7373
}
7474

75-
// NuGet.Config in current directory
75+
// NuGet.Config in current directory

packages/@aws-cdk-testing/cli-integ/lib/staging/parallel-shell.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ export async function parallelShell<A>(
4848
}));
4949

5050
await q.onEmpty();
51-
}
51+
}

packages/@aws-cdk-testing/cli-integ/lib/staging/pypi.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ export async function uploadPythonPackages(packages: string[], login: LoginInfor
4747
}
4848
return 'fail';
4949
});
50-
}
50+
}

packages/@aws-cdk-testing/cli-integ/lib/staging/usage-dir.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@ export class UsageDir {
9696
// eslint-disable-next-line no-console
9797
console.log(` source ${this.directory}/activate.bash`);
9898
}
99-
}
99+
}

packages/@aws-cdk-testing/cli-integ/lib/with-packages.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ export function withPackages<A extends object>(block: (context: A & PackageConte
1212
packages: packageSourceInSubprocess(),
1313
});
1414
};
15-
}
15+
}

packages/@aws-cdk-testing/cli-integ/lib/with-timeout.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ export function withTimeout<A>(seconds: number, block: (x: A) => Promise<void>)
3030
timeOut,
3131
]);
3232
};
33-
}
33+
}

packages/@aws-cdk-testing/cli-integ/test/resource-pool.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ function* range(n: number) {
8484
for (let i = 0; i < n; i++) {
8585
yield i;
8686
}
87-
}
87+
}

packages/@aws-cdk-testing/cli-integ/test/xpmutex.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ function waitFor(pred: () => boolean): Promise<void> {
4242
}
4343
}, 5);
4444
});
45-
}
45+
}

packages/@aws-cdk-testing/cli-integ/tests/init-python/init-python.integtest.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ import { integTest, withTemporaryDirectory, ShellHelper, withPackages } from '..
1717
await shell.shell([`${venvPath}/bin/pytest`], { modEnv: venv });
1818
await shell.shell(['cdk', 'synth'], { modEnv: venv });
1919
})));
20-
});
20+
});

packages/@aws-cdk-testing/cli-integ/tests/init-typescript-app/init-typescript-app.integtest.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ async function removeDevDependencies(context: TemporaryDirectoryContext) {
6363
const pj = JSON.parse(await fs.readFile(filename, { encoding: 'utf-8' }));
6464
delete pj.devDependencies;
6565
await fs.writeFile(filename, JSON.stringify(pj, undefined, 2), { encoding: 'utf-8' });
66-
}
66+
}

packages/@aws-cdk-testing/cli-integ/tests/init-typescript-lib/init-typescript-lib.integtest.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ integTest('typescript init lib', withTemporaryDirectory(withPackages(async (cont
1010
await shell.shell(['npm', 'ls']); // this will fail if we have unmet peer dependencies
1111
await shell.shell(['npm', 'run', 'build']);
1212
await shell.shell(['npm', 'run', 'test']);
13-
})));
13+
})));

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.cors.handler/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ exports.handler = async (evt: any) => {
88
'Access-Control-Allow-Origin': '*',
99
},
1010
};
11-
};
11+
};

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi-default-apikey.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ new integ.IntegTest(app, 'LambdaTest', {
2929
testCases: [stack],
3030
});
3131

32-
app.synth();
32+
app.synth();

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.import-deploymentstage.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ new integ.IntegTest(app, 'specrestapi-import-deployment-stage', {
7171
testCases: [stack],
7272
});
7373

74-
app.synth();
74+
app.synth();

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ const app = new cdk.App();
9292
const testCase = new Test(app, 'test-apigateway-spec-restapi');
9393
new IntegTest(app, 'apigateway-spec-restapi', {
9494
testCases: [testCase],
95-
});
95+
});

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.stepfunctions-startexecution-without-default-method-responses.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ new IntegTest(app, 'aws-apigateway-stepfunctions-startexecution-without-default-
4141
],
4242
});
4343

44-
app.synth();
44+
app.synth();

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.stepfunctions-startexecution.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ new IntegTest(app, 'aws-apigateway-stepfunctions-startexecution', {
4848
],
4949
});
5050

51-
app.synth();
51+
app.synth();

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/auth-handler/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ export const handler = async (event: AWSLambda.APIGatewayProxyEventV2) => {
66
return {
77
isAuthorized: key === '123',
88
};
9-
};
9+
};

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/integ.lambda.handler/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ export const handler = async () => {
66
'Content-Type': 'application/json',
77
},
88
};
9-
};
9+
};

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/integ.user-pool.handler/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ export const handler = async (event: any, _context: any = {}): Promise<any> => {
2020
} else {
2121
throw new Error('Unauthorized');
2222
}
23-
};
23+
};

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-integrations/test/http/integ.add-subroute-integration.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ integ.assertions.httpApiCall(httpApi.apiEndpoint + '/thirdroute').expect(Expecte
110110
integ.assertions.httpApiCall(httpApi.apiEndpoint + '/thirdroute/subroute').expect(ExpectedResult.objectLike({
111111
body: 'success-hit-third-lambda',
112112
status: 200,
113-
}));
113+
}));

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-integrations/test/http/integ.http-proxy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ function lambdaProxyEndpoint(s: Stack): HttpApi {
3333
return new HttpApi(s, 'LambdaProxyApi', {
3434
defaultIntegration: new HttpLambdaIntegration('DefaultIntegration', handler),
3535
});
36-
}
36+
}

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-integrations/test/http/integ.lambda-proxy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ const endpoint = new HttpApi(stack, 'LambdaProxyApi', {
2424

2525
new CfnOutput(stack, 'Endpoint', {
2626
value: endpoint.url!,
27-
});
27+
});

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-integrations/test/http/integ.stepfunctions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ httpApi.addRoutes({
5353
new integ.IntegTest(app, 'stepfunctions-integration-integ-test', {
5454
testCases: [stack],
5555
});
56-
app.synth();
56+
app.synth();

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-integrations/test/websocket/integ.lambda-connect-disconnect-trigger.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ new WebSocketStage(
7878

7979
new IntegTest(app, 'Integ', { testCases: [stack] });
8080

81-
app.synth();
81+
app.synth();

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api-apikey.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ new apigw.WebSocketApi(stack, 'MyWebsocketApi', {
1010
apiKeySelectionExpression: apigw.WebSocketApiKeySelectionExpression.HEADER_X_API_KEY,
1111
});
1212

13-
app.synth();
13+
app.synth();

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.application.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ Application.addAgentToEcs(taskDef);
2121

2222
new IntegTest(app, 'appconfig-application', {
2323
testCases: [stack],
24-
});
24+
});

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.configuration.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,4 +287,4 @@ function generateDummyRole(): iam.Role {
287287
}));
288288

289289
return role;
290-
}
290+
}

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.appsync-disable-introspection.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ new IntegTest(app, 'api', {
2020
testCases: [stack],
2121
});
2222

23-
app.synth();
23+
app.synth();

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.appsync-eventbridge.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ new IntegTest(app, 'api', {
2727
testCases: [stack],
2828
});
2929

30-
app.synth();
30+
app.synth();

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.appsync-global-api.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ new IntegTest(app, 'api', {
2020
testCases: [stack],
2121
});
2222

23-
app.synth();
23+
app.synth();

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.appsync-limit-configs.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ new IntegTest(app, 'api', {
2121
testCases: [stack],
2222
});
2323

24-
app.synth();
24+
app.synth();

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.appsync-merged-api-arn-flag-enabled.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ new IntegTest(app, 'api', {
4949
testCases: [stack],
5050
});
5151

52-
app.synth();
52+
app.synth();

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.appsync-merged-api.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ new IntegTest(app, 'api', {
4949
testCases: [stack],
5050
});
5151

52-
app.synth();
52+
app.synth();

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.appsync-none.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ new IntegTest(app, 'api', {
1919
testCases: [stack],
2020
});
2121

22-
app.synth();
22+
app.synth();

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.appsync-private-api.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ new IntegTest(app, 'api', {
2020
testCases: [stack],
2121
});
2222

23-
app.synth();
23+
app.synth();

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.appsync-source-api-association.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ new IntegTest(app, 'api', {
7272
testCases: [stack],
7373
});
7474

75-
app.synth();
75+
app.synth();

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.environment-variables.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ api.addEnvironmentVariable('EnvKey2', 'non-empty-2');
1818

1919
new IntegTest(app, 'IntegTestEnvironmentVariables', { testCases: [stack] });
2020

21-
app.synth();
21+
app.synth();

packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-instance-termination-policy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ function asgHandler(_event: any, _context: any, callback: any) {
5555
// eslint-disable-next-line quote-props
5656
const result = { 'InstanceIDs': instanceIds };
5757
return callback(undefined, result);
58-
}
58+
}

packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup-selection.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ const stack = new TestStack(app, 'cdk-backup-selection');
6161

6262
new IntegTest(app, 'BackupSelectionTest', {
6363
testCases: [stack],
64-
});
64+
});

packages/@aws-cdk-testing/framework-integ/test/aws-certificatemanager/test/integ.certificate-key-algorithm.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ new IntegTest(app, 'integ-test', {
4747
testCases: [stack],
4848
diffAssets: true,
4949
enableLookups: true,
50-
});
50+
});

packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.rest-api-origin-custom-origin-path.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ new cloudfront.Distribution(stack, 'Distribution', {
1717

1818
new IntegTest(app, 'rest-api-origin-custom-origin-path', {
1919
testCases: [stack],
20-
});
20+
});

packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.s3-bucket-origin-default.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ integ.assertions.awsApiCall('CloudFront', 'getDistributionConfig', {
3636
]),
3737
},
3838
}),
39-
}));
39+
}));

packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.s3-encrypted-bucket-origin-oac.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ const integ = new IntegTest(app, 's3-encrypted-bucket-origin-oac', {
3636
const call = integ.assertions.httpApiCall(`https://${distribution.distributionDomainName}/test.html`);
3737
call.expect(ExpectedResult.objectLike({
3838
body: 'ecb13420-3826-4f11-a1b5-a4ac2f65c7c6',
39-
}));
39+
}));

packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.s3-origin-oac.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ integ.assertions.awsApiCall('CloudFront', 'getOriginAccessControlConfig', {
5353
SigningBehavior: 'always',
5454
OriginAccessControlOriginType: 's3',
5555
},
56-
}));
56+
}));

0 commit comments

Comments
 (0)