From efc5b9ecc12e8feeba6418ca18acc6dd7808c95d Mon Sep 17 00:00:00 2001 From: Ryan Delaney Date: Sun, 28 Oct 2018 12:05:42 -0700 Subject: [PATCH 1/4] Add missing parameter --allow-missing-credentials --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ddf5776..b848ce6 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,8 @@ Add this to your `.pre-commit-config.yaml` - `--credentials-file` - additional AWS CLI style configuration file in a non-standard location to fetch configured credentials from. Can be repeated multiple times. + - `--allow-missing-credentials` - Allow hook to pass when no credentials are + detected. - `detect-private-key` - Checks for the existence of private keys. - `double-quote-string-fixer` - This hook replaces double quoted strings with single quoted strings. From 4b8eb6f96a06c74f9c867d6516394e75bd25a19e Mon Sep 17 00:00:00 2001 From: Ryan Delaney Date: Sun, 28 Oct 2018 12:07:03 -0700 Subject: [PATCH 2/4] Add required argument to cli parameter --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b848ce6..fc574ed 100644 --- a/README.md +++ b/README.md @@ -58,9 +58,9 @@ Add this to your `.pre-commit-config.yaml` - `detect-aws-credentials` - Checks for the existence of AWS secrets that you have set up with the AWS CLI. The following arguments are available: - - `--credentials-file` - additional AWS CLI style configuration file in a - non-standard location to fetch configured credentials from. Can be repeated - multiple times. + - `--credentials-file CREDENTIAL_FILES` - additional AWS CLI style + configuration file in a non-standard location to fetch configured + credentials from. Can be repeated multiple times. - `--allow-missing-credentials` - Allow hook to pass when no credentials are detected. - `detect-private-key` - Checks for the existence of private keys. From 2d4833c73eb51d6f5a28b2effeb7929477df5313 Mon Sep 17 00:00:00 2001 From: Ryan Delaney Date: Sun, 28 Oct 2018 15:58:14 -0700 Subject: [PATCH 3/4] Rename metavar to clarify required usage syntax --- README.md | 2 +- pre_commit_hooks/detect_aws_credentials.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fc574ed..43b9887 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Add this to your `.pre-commit-config.yaml` - `detect-aws-credentials` - Checks for the existence of AWS secrets that you have set up with the AWS CLI. The following arguments are available: - - `--credentials-file CREDENTIAL_FILES` - additional AWS CLI style + - `--credentials-file CREDENTIALS_FILE` - additional AWS CLI style configuration file in a non-standard location to fetch configured credentials from. Can be repeated multiple times. - `--allow-missing-credentials` - Allow hook to pass when no credentials are diff --git a/pre_commit_hooks/detect_aws_credentials.py b/pre_commit_hooks/detect_aws_credentials.py index 47a69bf..35638b7 100644 --- a/pre_commit_hooks/detect_aws_credentials.py +++ b/pre_commit_hooks/detect_aws_credentials.py @@ -87,7 +87,7 @@ def main(argv=None): parser.add_argument('filenames', nargs='+', help='Filenames to run') parser.add_argument( '--credentials-file', - dest='credential_files', + dest='credentials_file', action='append', default=[ '~/.aws/config', '~/.aws/credentials', '/etc/boto.cfg', '~/.boto', @@ -105,7 +105,7 @@ def main(argv=None): ) args = parser.parse_args(argv) - credential_files = set(args.credential_files) + credential_files = set(args.credentials_file) # Add the credentials files configured via environment variables to the set # of files to to gather AWS secrets from. From 0d83fed4fa2a53a097074bce4e8412878ba471eb Mon Sep 17 00:00:00 2001 From: Ryan Delaney Date: Sun, 28 Oct 2018 15:59:39 -0700 Subject: [PATCH 4/4] Reword usage info to clarify required usage syntax --- pre_commit_hooks/detect_aws_credentials.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pre_commit_hooks/detect_aws_credentials.py b/pre_commit_hooks/detect_aws_credentials.py index 35638b7..ecd9d40 100644 --- a/pre_commit_hooks/detect_aws_credentials.py +++ b/pre_commit_hooks/detect_aws_credentials.py @@ -93,8 +93,8 @@ def main(argv=None): '~/.aws/config', '~/.aws/credentials', '/etc/boto.cfg', '~/.boto', ], help=( - 'Location of additional AWS credential files from which to get ' - 'secret keys from' + 'Location of additional AWS credential file from which to get ' + 'secret keys. Can be passed multiple times.' ), ) parser.add_argument(