Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve 'Unable to open baseline file' message #91

Merged
merged 2 commits into from
Oct 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion detect_secrets/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '0.10.4'
VERSION = '0.10.5'
2 changes: 1 addition & 1 deletion detect_secrets/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
6 changes: 4 additions & 2 deletions detect_secrets/pre_commit_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 > {}`\n'
.format(filename, filename),
)

raise


Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
coverage
flake8
flake8==3.5.0
mock
pre-commit
pytest
Expand Down