Skip to content

Commit a9ec769

Browse files
authored
Add git-secrets and lint to pre commit (#269)
1 parent 4f97776 commit a9ec769

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

.husky/pre-commit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
git secrets --register-aws || (echo 'Please install git-secrets https://github.com/awslabs/git-secrets to check for accidentally commited secrets!' && exit 1)
2+
git secrets --pre_commit_hook -- ""
3+
npm run lint

package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"test:integration": "NODE_ENV=test vitest run --config vitest.integration.config.ts",
2929
"test:unit": "NODE_ENV=test vitest run --config vitest.unit.config.ts",
3030
"test:leaks": "NODE_ENV=test vitest run --pool=forks --logHeapUsage",
31-
"lint": "eslint --max-warnings 0 .",
31+
"lint": "eslint --cache --cache-location node_modules/.cache/eslint --max-warnings 0 .",
3232
"lint:fix": "npm run lint -- --fix",
3333
"build:go:dev": "GOPROXY=direct go build -C cfn-init/cmd -v -o ../../bundle/development/bin/cfn-init",
3434
"build:go:prod": "GOPROXY=direct go build -C cfn-init/cmd -v -o ../../bundle/production/bin/cfn-init",
@@ -42,7 +42,8 @@
4242
"generate-metrics": "NODE_ENV=development AWS_ENV=alpha node --max-old-space-size=16384 -r ts-node/register tools/telemetry-generator.ts",
4343
"debug-tree": "node -r ts-node/register tools/debug_tree.ts",
4444
"generate:guard-rules": "node -r ts-node/register tools/generate-guard-rules.ts",
45-
"check:duplicates": "jscpd"
45+
"check:duplicates": "jscpd",
46+
"prepare": "husky"
4647
},
4748
"dependencies": {
4849
"@aws-sdk/client-cloudcontrol": "3.873.0",
@@ -115,6 +116,7 @@
115116
"eslint-plugin-promise": "7.2.1",
116117
"eslint-plugin-security": "3.0.1",
117118
"eslint-plugin-unicorn": "60.0.0",
119+
"husky": "9.1.7",
118120
"jscpd": "4.0.5",
119121
"minimatch": "10.0.3",
120122
"node-loader": "2.1.0",

0 commit comments

Comments
 (0)