From 797cfe15ca605bddfcef72c57a29bcaab087860d Mon Sep 17 00:00:00 2001 From: Kevin Hock Date: Fri, 26 Oct 2018 11:38:02 -0700 Subject: [PATCH 1/2] Improve 'Unable to open baseline file' message, fix comment, bump to 0.10.5, hardcode flake8==3.5.0 --- detect_secrets/__init__.py | 2 +- detect_secrets/main.py | 2 +- detect_secrets/pre_commit_hook.py | 6 ++++-- requirements-dev.txt | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/detect_secrets/__init__.py b/detect_secrets/__init__.py index 1da3331f0..5308a7d1e 100644 --- a/detect_secrets/__init__.py +++ b/detect_secrets/__init__.py @@ -1 +1 @@ -VERSION = '0.10.4' +VERSION = '0.10.5' diff --git a/detect_secrets/main.py b/detect_secrets/main.py index 59291a30c..b0ef5d3b2 100644 --- a/detect_secrets/main.py +++ b/detect_secrets/main.py @@ -107,7 +107,7 @@ def _perform_scan(args, plugins): def _get_existing_baseline(import_filename): - # Favors --import argument over stdin. + # Favors --update argument over stdin. if import_filename: return _read_from_file(import_filename[0]) if not sys.stdin.isatty(): diff --git a/detect_secrets/pre_commit_hook.py b/detect_secrets/pre_commit_hook.py index 63b8999fb..17291f68e 100644 --- a/detect_secrets/pre_commit_hook.py +++ b/detect_secrets/pre_commit_hook.py @@ -122,9 +122,11 @@ def _get_baseline_string_from_file(filename): # pragma: no cover except IOError: log.error( - 'Unable to open baseline file: %s.', filename, + 'Unable to open baseline file: {}\n' + 'Please create it via\n' + ' `detect-secrets scan > .secrets.baseline`\n' + .format(filename), ) - raise diff --git a/requirements-dev.txt b/requirements-dev.txt index accffe15f..7584619e4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ coverage -flake8 +flake8==3.5.0 mock pre-commit pytest From 88b3fb68981bf274d12afddd95870c05bccfac6d Mon Sep 17 00:00:00 2001 From: Kevin Hock Date: Mon, 29 Oct 2018 18:20:26 -0700 Subject: [PATCH 2/2] Don't suggest .secrets.baseline for 'please create baseline' msg --- detect_secrets/pre_commit_hook.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/detect_secrets/pre_commit_hook.py b/detect_secrets/pre_commit_hook.py index 17291f68e..a091089c1 100644 --- a/detect_secrets/pre_commit_hook.py +++ b/detect_secrets/pre_commit_hook.py @@ -124,8 +124,8 @@ def _get_baseline_string_from_file(filename): # pragma: no cover log.error( 'Unable to open baseline file: {}\n' 'Please create it via\n' - ' `detect-secrets scan > .secrets.baseline`\n' - .format(filename), + ' `detect-secrets scan > {}`\n' + .format(filename, filename), ) raise