From 71965f1383ec09f12eb2c83e13d9420dc4191a83 Mon Sep 17 00:00:00 2001 From: Peter Jung Date: Mon, 3 Feb 2025 10:53:13 +0100 Subject: [PATCH] Add necessary code to support it --- .pre-commit-hooks.yaml | 6 ++++++ README.md | 3 +++ ...tect_web3_private_keys.py => detect_web3_private_key.py} | 0 setup.cfg | 1 + 4 files changed, 10 insertions(+) rename pre_commit_hooks/{detect_web3_private_keys.py => detect_web3_private_key.py} (100%) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index b71169b..7c7ae6d 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -128,6 +128,12 @@ entry: detect-private-key language: python types: [text] +- id: detect-web3-private-key + name: detect web3 private key + description: detects the presence of web3 private keys. + entry: detect-web3-private-key + language: python + types: [text] - id: double-quote-string-fixer name: fix double quoted strings description: replaces double quoted strings with single quoted strings. diff --git a/README.md b/README.md index c0f678f..1924e70 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,9 @@ The following arguments are available: #### `detect-private-key` Checks for the existence of private keys. +#### `detect-web3-private-key` +Checks for the existence of web3 private keys. Add `# web3-private-key-ok` to the end of the line to ignore false positives. + #### `double-quote-string-fixer` This hook replaces double quoted strings with single quoted strings. diff --git a/pre_commit_hooks/detect_web3_private_keys.py b/pre_commit_hooks/detect_web3_private_key.py similarity index 100% rename from pre_commit_hooks/detect_web3_private_keys.py rename to pre_commit_hooks/detect_web3_private_key.py diff --git a/setup.cfg b/setup.cfg index 3b7e5ee..f780ba2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -49,6 +49,7 @@ console_scripts = destroyed-symlinks = pre_commit_hooks.destroyed_symlinks:main detect-aws-credentials = pre_commit_hooks.detect_aws_credentials:main detect-private-key = pre_commit_hooks.detect_private_key:main + detect-web3-private-key = pre_commit_hooks.detect_web3_private_key:main double-quote-string-fixer = pre_commit_hooks.string_fixer:main end-of-file-fixer = pre_commit_hooks.end_of_file_fixer:main file-contents-sorter = pre_commit_hooks.file_contents_sorter:main