Skip to content

Commit

Permalink
chore(eslint): no padded lines for blocks and switches (#33203)
Browse files Browse the repository at this point in the history
Enforce `padded-lines` against blocks and switches.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
kaizencc authored Jan 28, 2025
1 parent ef06f40 commit 0c53765
Show file tree
Hide file tree
Showing 580 changed files with 446 additions and 2,355 deletions.
1 change: 0 additions & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/cli/run-suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ async function main() {
...passWithNoTests ? ['--passWithNoTests'] : [],
...args['test-file'] ? [args['test-file']] : [],
], path.resolve(__dirname, '..', '..', 'resources', 'integ.jest.config.js'));

} finally {
await packageSource.cleanup();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ async function main() {
type: 'string',
requiresArg: true,
}), async (args) => {

await validateDirectory(args);
const repo = await (args.name ? TestRepository.newWithName(args.name) : TestRepository.newRandom());
const usageDir = UsageDir.default();
Expand All @@ -71,7 +70,6 @@ async function main() {
requiresArg: true,
demandOption: true,
}), async (args) => {

const repo = TestRepository.existing(args.name);
const usageDir = UsageDir.default();

Expand Down Expand Up @@ -99,7 +97,6 @@ async function main() {
default: true,
requiresArg: false,
}), async (args) => {

await validateDirectory(args);
const repo = await TestRepository.newRandom();
const usageDir = UsageDir.default();
Expand All @@ -114,7 +111,6 @@ async function main() {
shell: true,
show: 'always',
});

} finally {
if (args.cleanup) {
await repo.delete();
Expand All @@ -128,7 +124,6 @@ async function main() {
type: 'string',
requiresArg: true,
}), async (args) => {

const usageDir = UsageDir.default();

let repositoryName = args.name;
Expand Down
3 changes: 0 additions & 3 deletions packages/@aws-cdk-testing/cli-integ/lib/with-aws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export function withAws<A extends TestContext>(
disableBootstrap: boolean = false,
): (context: A) => Promise<void> {
return async (context: A) => {

if (atmosphereEnabled()) {
const atmosphere = new AtmosphereClient(atmosphereEndpoint());
const allocation = await atmosphere.acquire({ pool: atmospherePool(), requester: context.name });
Expand All @@ -59,7 +58,6 @@ export function withAws<A extends TestContext>(
} finally {
await atmosphere.release(allocation.id, outcome);
}

} else {
return regionPool().using(async (region) => {
const aws = await AwsClients.forRegion(region, context.output);
Expand All @@ -68,7 +66,6 @@ export function withAws<A extends TestContext>(
return block({ ...context, disableBootstrap, aws });
});
}

};
}

Expand Down
5 changes: 0 additions & 5 deletions packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ export class TestFixture extends ShellHelper {
public readonly output: NodeJS.WritableStream,
public readonly aws: AwsClients,
public readonly randomString: string) {

super(integTestDir, output);

this.packages = packageSourceInSubprocess();
Expand Down Expand Up @@ -566,11 +565,9 @@ export class TestFixture extends ShellHelper {
* Cleanup leftover stacks and bootstrapped resources
*/
public async dispose(success: boolean) {

// when using the atmosphere service, it does resource cleanup on our behalf
// so we don't have to wait for it.
if (!atmosphereEnabled()) {

const stacksToDelete = await this.deleteableStacks(this.stackNamePrefix);

this.sortBootstrapStacksToTheEnd(stacksToDelete);
Expand Down Expand Up @@ -603,7 +600,6 @@ export class TestFixture extends ShellHelper {
for (const bucket of this.bucketsToDelete) {
await this.aws.deleteBucket(bucket);
}

}

// If the tests completed successfully, happily delete the fixture
Expand Down Expand Up @@ -644,7 +640,6 @@ export class TestFixture extends ShellHelper {

private sortBootstrapStacksToTheEnd(stacks: Stack[]) {
stacks.sort((a, b) => {

if (!a.StackName || !b.StackName) {
throw new Error('Stack names do not exists. These are required for sorting the bootstrap stacks.');
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@
"publishConfig": {
"tag": "latest"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ integTest('can remove customPermissionsBoundary', withoutBootstrap(async (fixtur
throw new Error('Role not found');
}
expect(role.Role.PermissionsBoundary).toBeUndefined();

} finally {
if (policyArn) {
await fixture.aws.iam.send(new DeletePolicyCommand({ PolicyArn: policyArn }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,6 @@ integTest(
integTest(
'cdk diff doesnt show resource metadata changes',
withDefaultFixture(async (fixture) => {

// GIVEN - small initial stack with default resource metadata
await fixture.cdkDeploy('metadata');

Expand All @@ -1284,7 +1283,6 @@ integTest(
integTest(
'cdk diff shows resource metadata changes with --no-change-set',
withDefaultFixture(async (fixture) => {

// GIVEN - small initial stack with default resource metadata
await fixture.cdkDeploy('metadata');

Expand Down Expand Up @@ -2838,7 +2836,6 @@ integTest(
);

integTest('cdk notices are displayed correctly', withDefaultFixture(async (fixture) => {

const cache = {
expiration: 4125963264000, // year 2100 so we never overwrite the cache
notices: [
Expand Down Expand Up @@ -2872,7 +2869,6 @@ integTest('cdk notices are displayed correctly', withDefaultFixture(async (fixtu

// assert dynamic environments are resolved
expect(output).toContain(`AffectedEnvironments:<aws://${await fixture.aws.account()}/${fixture.aws.region}>`);

}));

integTest('requests go through a proxy when configured',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,4 @@ new TestjsStack(app, 'TestjsStack');
await fs.writeJson(path.join(context.integTestDir, 'cdk.json'), cdkJson);

await shell.shell(['cdk', 'synth']);

})));
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class TestStack extends cdk.Stack {
notificationTarget: new QueueHook(queue),
});
this.hookName = hook.lifecycleHookName;

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class ProfilerGroupIntegrationTest extends Stack {
assumedBy: new AccountRootPrincipal(),
});
profilingGroup.grantRead(readAppRole);

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class TestStack extends Stack {
region: 'eu-west-2',
}],
});

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class TestStack extends Stack {
removalPolicy: RemovalPolicy.DESTROY,
resourcePolicy: docu,
});

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export class TestStack extends Stack {
],
removalPolicy: RemovalPolicy.DESTROY,
});

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class TestStack extends Stack {
writeUnitsPerSecond: 5000,
},
});

}
}

Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
{
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"/faf0712a1359d1e87541a9e7b4d1a3afc6f999593c695d9ae90698b6b51e9168.json"
"/9f9e7436ed98342a4f1f0b598ef9976aa52d9ad4f145e5ef3b06928a267551fd.json"
]
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "9ebfbf95d93057cd65617a9d6f72a0e7dd31520f28cf423c3afd3cbaf0662e6b.zip"
"S3Key": "39472b1c2875cf306d4ba429aeccdd34cb49bcf59dbde81f7e6b6cb9deac23a6.zip"
},
"Description": "AWS CDK resource provider framework - onEvent (aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)",
"Environment": {
Expand Down Expand Up @@ -589,7 +589,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "9ebfbf95d93057cd65617a9d6f72a0e7dd31520f28cf423c3afd3cbaf0662e6b.zip"
"S3Key": "39472b1c2875cf306d4ba429aeccdd34cb49bcf59dbde81f7e6b6cb9deac23a6.zip"
},
"Description": "AWS CDK resource provider framework - isComplete (aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)",
"Environment": {
Expand Down Expand Up @@ -731,7 +731,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "9ebfbf95d93057cd65617a9d6f72a0e7dd31520f28cf423c3afd3cbaf0662e6b.zip"
"S3Key": "39472b1c2875cf306d4ba429aeccdd34cb49bcf59dbde81f7e6b6cb9deac23a6.zip"
},
"Description": "AWS CDK resource provider framework - onTimeout (aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)",
"Environment": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0c53765

Please sign in to comment.