Skip to content

Commit d0f9f5e

Browse files
committed
lint-staged
1 parent 2ac5ba6 commit d0f9f5e

File tree

5 files changed

+25
-17
lines changed

5 files changed

+25
-17
lines changed

.github/workflows/ab-testing-lambda-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
push:
88
paths:
99
- 'ab-testing/dictionary-deploy-lambda/**'
10+
- 'ab-testing/cdk/**'
1011
- 'ab-testing/lib/**'
1112
- '.github/workflows/ab-testing-lambda-ci.yml'
1213

ab-testing/cdk/lib/__snapshots__/deploymentLambda.test.ts.snap

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ exports[`The ID5 Baton Lambda stack > matches the CODE snapshot 1`] = `
5151
"Tags": [
5252
{
5353
"Key": "App",
54-
"Value": "ab-testing-deployment-lambda-lambda"
54+
"Value": "ab-testing-deployment-lambda"
5555
},
5656
{
5757
"Key": "gu:cdk:version",
@@ -112,7 +112,7 @@ exports[`The ID5 Baton Lambda stack > matches the CODE snapshot 1`] = `
112112
{
113113
"Ref": "DistributionBucketName"
114114
},
115-
"/frontend/CODE/ab-testing-deployment-lambda-lambda/lambda.zip"
115+
"/frontend/CODE/ab-testing-deployment-lambda/lambda.zip"
116116
]
117117
]
118118
}
@@ -129,7 +129,7 @@ exports[`The ID5 Baton Lambda stack > matches the CODE snapshot 1`] = `
129129
{
130130
"Ref": "AWS::AccountId"
131131
},
132-
":parameter/CODE/frontend/ab-testing-deployment-lambda-lambda"
132+
":parameter/CODE/frontend/ab-testing-deployment-lambda"
133133
]
134134
]
135135
}
@@ -148,7 +148,7 @@ exports[`The ID5 Baton Lambda stack > matches the CODE snapshot 1`] = `
148148
{
149149
"Ref": "AWS::AccountId"
150150
},
151-
":parameter/CODE/frontend/ab-testing-deployment-lambda-lambda/*"
151+
":parameter/CODE/frontend/ab-testing-deployment-lambda/*"
152152
]
153153
]
154154
}
@@ -262,7 +262,7 @@ exports[`The ID5 Baton Lambda stack > matches the CODE snapshot 1`] = `
262262
"S3Bucket": {
263263
"Ref": "DistributionBucketName"
264264
},
265-
"S3Key": "frontend/CODE/ab-testing-deployment-lambda-lambda/lambda.zip"
265+
"S3Key": "frontend/CODE/ab-testing-deployment-lambda/lambda.zip"
266266
},
267267
"Environment": {
268268
"Variables": {
@@ -271,7 +271,7 @@ exports[`The ID5 Baton Lambda stack > matches the CODE snapshot 1`] = `
271271
"Ref": "SsmParameterValueaccountservicesdotcomstorebucketC96584B6F00A464EAD1953AFF4B05118Parameter"
272272
},
273273
"STACK": "frontend",
274-
"APP": "ab-testing-deployment-lambda-lambda"
274+
"APP": "ab-testing-deployment-lambda"
275275
}
276276
},
277277
"FunctionName": "ab-testing-deployment-lambda-CODE",
@@ -290,7 +290,7 @@ exports[`The ID5 Baton Lambda stack > matches the CODE snapshot 1`] = `
290290
"Tags": [
291291
{
292292
"Key": "App",
293-
"Value": "ab-testing-deployment-lambda-lambda"
293+
"Value": "ab-testing-deployment-lambda"
294294
},
295295
{
296296
"Key": "gu:cdk:version",
@@ -373,7 +373,7 @@ exports[`The ID5 Baton Lambda stack > matches the PROD snapshot 1`] = `
373373
"Tags": [
374374
{
375375
"Key": "App",
376-
"Value": "ab-testing-deployment-lambda-lambda"
376+
"Value": "ab-testing-deployment-lambda"
377377
},
378378
{
379379
"Key": "gu:cdk:version",
@@ -434,7 +434,7 @@ exports[`The ID5 Baton Lambda stack > matches the PROD snapshot 1`] = `
434434
{
435435
"Ref": "DistributionBucketName"
436436
},
437-
"/frontend/PROD/ab-testing-deployment-lambda-lambda/lambda.zip"
437+
"/frontend/PROD/ab-testing-deployment-lambda/lambda.zip"
438438
]
439439
]
440440
}
@@ -451,7 +451,7 @@ exports[`The ID5 Baton Lambda stack > matches the PROD snapshot 1`] = `
451451
{
452452
"Ref": "AWS::AccountId"
453453
},
454-
":parameter/PROD/frontend/ab-testing-deployment-lambda-lambda"
454+
":parameter/PROD/frontend/ab-testing-deployment-lambda"
455455
]
456456
]
457457
}
@@ -470,7 +470,7 @@ exports[`The ID5 Baton Lambda stack > matches the PROD snapshot 1`] = `
470470
{
471471
"Ref": "AWS::AccountId"
472472
},
473-
":parameter/PROD/frontend/ab-testing-deployment-lambda-lambda/*"
473+
":parameter/PROD/frontend/ab-testing-deployment-lambda/*"
474474
]
475475
]
476476
}
@@ -584,7 +584,7 @@ exports[`The ID5 Baton Lambda stack > matches the PROD snapshot 1`] = `
584584
"S3Bucket": {
585585
"Ref": "DistributionBucketName"
586586
},
587-
"S3Key": "frontend/PROD/ab-testing-deployment-lambda-lambda/lambda.zip"
587+
"S3Key": "frontend/PROD/ab-testing-deployment-lambda/lambda.zip"
588588
},
589589
"Environment": {
590590
"Variables": {
@@ -593,7 +593,7 @@ exports[`The ID5 Baton Lambda stack > matches the PROD snapshot 1`] = `
593593
"Ref": "SsmParameterValueaccountservicesdotcomstorebucketC96584B6F00A464EAD1953AFF4B05118Parameter"
594594
},
595595
"STACK": "frontend",
596-
"APP": "ab-testing-deployment-lambda-lambda"
596+
"APP": "ab-testing-deployment-lambda"
597597
}
598598
},
599599
"FunctionName": "ab-testing-deployment-lambda-PROD",
@@ -612,7 +612,7 @@ exports[`The ID5 Baton Lambda stack > matches the PROD snapshot 1`] = `
612612
"Tags": [
613613
{
614614
"Key": "App",
615-
"Value": "ab-testing-deployment-lambda-lambda"
615+
"Value": "ab-testing-deployment-lambda"
616616
},
617617
{
618618
"Key": "gu:cdk:version",

ab-testing/cdk/lib/deploymentLambda.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class AbTestingDeploymentLambda extends GuStack {
4343
functionName: `${lambdaFunctionName}-${this.stage}`,
4444
fileName: "lambda.zip",
4545
handler: "index.handler",
46-
app: `${lambdaFunctionName}-lambda`,
46+
app: lambdaFunctionName,
4747
runtime: Runtime.NODEJS_22_X,
4848
memorySize: 256,
4949
environment: {

ab-testing/package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,18 @@
1717
"cdk:test": "node --test --test-reporter spec cdk/*/*.test.ts",
1818
"cdk:test-update": "node --test --test-reporter spec --test-update-snapshots cdk/*/*.test.ts",
1919
"synth:ab-testing-config": "cdk synth --path-metadata false --version-reporting false --app 'node cdk/bin/ab-testing-config.cdk.ts' --output ./cdk.out/ab-testing-config",
20-
"synth:deployment-lambda": "cdk synth --path-metadata false --version-reporting false --app 'node cdk/bin/deployment-lambda.cdk.ts' --output ./cdk.out/deployment-lambda"
20+
"synth:deployment-lambda": "cdk synth --path-metadata false --version-reporting false --app 'node cdk/bin/deployment-lambda.cdk.ts' --output ./cdk.out/deployment-lambda",
21+
"lint-staged": "lint-staged"
2122
},
2223
"dependencies": {
2324
"superstruct": "2.0.2"
2425
},
26+
"lint-staged": {
27+
"*.ts": [
28+
"pnpm lint --fix",
29+
"pnpm prettier:fix"
30+
]
31+
},
2532
"devDependencies": {
2633
"@aws-sdk/client-s3": "3.931.0",
2734
"@aws-sdk/client-ssm": "3.621.0",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"lint-staged": {
2323
"*": "prettier --ignore-unknown --write",
24-
"ab-testing/**/*": "cd ab-testing && deno run validate"
24+
"ab-testing/**/*": "pnpm --filter ab-testing lint-staged"
2525
},
2626
"dependencies": {
2727
"@guardian/prettier": "5.0.0",

0 commit comments

Comments
 (0)