diff --git a/detect_secrets/core/audit.py b/detect_secrets/core/audit.py index 5ab6de432..a1b553f34 100644 --- a/detect_secrets/core/audit.py +++ b/detect_secrets/core/audit.py @@ -131,27 +131,13 @@ def _print_context(filename, secret, count, total, plugin_settings): # pragma: :raises: SecretNotFoundOnSpecifiedLineError """ - secrets_left = '{}/{}'.format( - count, - total, - ) - print('{} {}\n{} {}'.format( - BashColor.color( - 'Secrets Left:', - Color.BOLD, - ), - BashColor.color( - secrets_left, - Color.PURPLE, - ), - BashColor.color( - 'Filename: ', - Color.BOLD, - ), - BashColor.color( - filename, - Color.PURPLE, - ), + print('{} {} {} {}\n{} {}'.format( + BashColor.color('Secret', Color.BOLD), + BashColor.color(str(count), Color.PURPLE), + BashColor.color('of', Color.BOLD), + BashColor.color(str(total), Color.PURPLE), + BashColor.color('Filename:', Color.BOLD), + BashColor.color(filename, Color.PURPLE), )) print('-' * 10) diff --git a/tests/core/audit_test.py b/tests/core/audit_test.py index 501cf995f..bdc7d0e18 100644 --- a/tests/core/audit_test.py +++ b/tests/core/audit_test.py @@ -362,8 +362,8 @@ def test_basic(self, mock_printer): assert sed_call.call_args[0][0] == 'sed -n 10,20p filenameA'.split() assert mock_printer.message == textwrap.dedent(""" - Secrets Left: 1/2 - Filename: filenameA + Secret 1 of 2 + Filename: filenameA ---------- 10:a 11:b @@ -394,8 +394,8 @@ def test_secret_at_top_of_file(self, mock_printer): assert sed_call.call_args[0][0] == 'sed -n 1,6p filenameA'.split() assert mock_printer.message == textwrap.dedent(""" - Secrets Left: 1/2 - Filename: filenameA + Secret 1 of 2 + Filename: filenameA ---------- 1:-----BEGIN PRIVATE KEY----- 2:e @@ -421,8 +421,8 @@ def test_secret_not_found(self, mock_printer): ) assert mock_printer.message == textwrap.dedent(""" - Secrets Left: 1/2 - Filename: filenameA + Secret 1 of 2 + Filename: filenameA ---------- ERROR: Secret not found on line 15! Try recreating your baseline to fix this issue. @@ -450,8 +450,8 @@ def test_secret_in_yaml_file(self, mock_printer): ) assert mock_printer.message == textwrap.dedent(""" - Secrets Left: 1/2 - Filename: filenameB + Secret 1 of 2 + Filename: filenameB ---------- 10:a 11:b diff --git a/tests/main_test.py b/tests/main_test.py index c66ac0163..63ffe9870 100644 --- a/tests/main_test.py +++ b/tests/main_test.py @@ -254,8 +254,8 @@ def test_audit_short_file(self, filename, expected_output): main('audit will_be_mocked'.split()) assert printer_shim.message == textwrap.dedent(""" - Secrets Left: 1/1 - Filename: {} + Secret 1 of 1 + Filename: {} ---------- {} ----------