From 4f244ada50c38034ef9f9bd358d36b2423c2c03c Mon Sep 17 00:00:00 2001 From: Brendan Jurd Date: Tue, 21 Nov 2023 09:03:06 +1100 Subject: [PATCH 1/3] Reword audit prompt message for clarity The old audit prompt message was confusing in the case of a false positive. This new wording suits both genuine findings and false positives. Fixes https://github.com/Yelp/detect-secrets/issues/734 --- detect_secrets/audit/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detect_secrets/audit/io.py b/detect_secrets/audit/io.py index 15ecc504e..1b20cc773 100644 --- a/detect_secrets/audit/io.py +++ b/detect_secrets/audit/io.py @@ -130,7 +130,7 @@ def __init__(self, allow_labelling: bool, allow_backstep: bool) -> None: def __str__(self) -> str: if 'Y' in self.valid_input: - output = 'Is this a secret that should be committed to this repository?' + output = 'Should this be committed to the repository?' else: output = 'What would you like to do?' From c9e0beb4acd20926b7b453b4c03cb6ce03a77bfa Mon Sep 17 00:00:00 2001 From: Brendan Jurd Date: Tue, 21 Nov 2023 09:10:04 +1100 Subject: [PATCH 2/3] Update docs and tests for new prompt wording. --- docs/audit.md | 2 +- tests/audit/io_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/audit.md b/docs/audit.md index 5446ba1f6..4451ba0b2 100644 --- a/docs/audit.md +++ b/docs/audit.md @@ -29,7 +29,7 @@ Secret Type: Secret Keyword 68: } 69: ], ---------- -Is this a secret that should be committed to this repository? (y)es, (n)o, (s)kip, (q)uit: +Should this be committed to the repository? (y)es, (n)o, (s)kip, (q)uit: ``` There are two common cases for manual labelling: diff --git a/tests/audit/io_test.py b/tests/audit/io_test.py index a75b829a0..b8b29127b 100644 --- a/tests/audit/io_test.py +++ b/tests/audit/io_test.py @@ -12,7 +12,7 @@ 'allow_backstep': True, }, ( - 'Is this a secret that should be committed to this repository? ' + 'Should this be committed to the repository? ' '(y)es, (n)o, (s)kip, (b)ack, (q)uit: ' ), ), From 22463fe9a4394e2f52d3e6391e0f506419813c9a Mon Sep 17 00:00:00 2001 From: Brendan Jurd Date: Sat, 25 Nov 2023 12:31:15 +1100 Subject: [PATCH 3/3] Update prompt wording per request from @lorenzodb1 --- detect_secrets/audit/audit.py | 2 +- detect_secrets/audit/io.py | 2 +- docs/audit.md | 2 +- tests/audit/io_test.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/detect_secrets/audit/audit.py b/detect_secrets/audit/audit.py index da8972d3e..35ff049b2 100644 --- a/detect_secrets/audit/audit.py +++ b/detect_secrets/audit/audit.py @@ -78,7 +78,7 @@ def _classify_secrets(iterator: BidirectionalIterator) -> bool: if decision == io.InputOptions.BACK: iterator.step_back_on_next_iteration() - # The question asked is: "Should this be committed to the repository?" + # The question asked is: "Should this string be committed to the repository?" elif decision == io.InputOptions.NO: secret.is_secret = True has_changes = True diff --git a/detect_secrets/audit/io.py b/detect_secrets/audit/io.py index 1b20cc773..ab5086b70 100644 --- a/detect_secrets/audit/io.py +++ b/detect_secrets/audit/io.py @@ -130,7 +130,7 @@ def __init__(self, allow_labelling: bool, allow_backstep: bool) -> None: def __str__(self) -> str: if 'Y' in self.valid_input: - output = 'Should this be committed to the repository?' + output = 'Should this string be committed to the repository?' else: output = 'What would you like to do?' diff --git a/docs/audit.md b/docs/audit.md index 4451ba0b2..42ed5f7a7 100644 --- a/docs/audit.md +++ b/docs/audit.md @@ -29,7 +29,7 @@ Secret Type: Secret Keyword 68: } 69: ], ---------- -Should this be committed to the repository? (y)es, (n)o, (s)kip, (q)uit: +Should this string be committed to the repository? (y)es, (n)o, (s)kip, (q)uit: ``` There are two common cases for manual labelling: diff --git a/tests/audit/io_test.py b/tests/audit/io_test.py index b8b29127b..775e18b2d 100644 --- a/tests/audit/io_test.py +++ b/tests/audit/io_test.py @@ -12,7 +12,7 @@ 'allow_backstep': True, }, ( - 'Should this be committed to the repository? ' + 'Should this string be committed to the repository? ' '(y)es, (n)o, (s)kip, (b)ack, (q)uit: ' ), ),