-
Notifications
You must be signed in to change notification settings - Fork 74
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
Interactive Mode #105
Comments
This seems like a really good idea. 👍 |
This does sound like a great idea! Thanks for starting the work on this @dclayton-godaddy. I think that there are a few things we are going to want to work through to be sure that we get this implemented in the best way for all cases. Some things that come to mind right off:
|
I guess
Good point. Maybe the added entries need to be put to an interactive results file so the user can put them where they want?
I thought about that but, due to security, I did not want accidental selection.
This would function similar to other tools that accept interactive. If you add |
One mitigation for this concern might be that the user will have to git add (hopefully -p) the modified tartufo configuration, so if they're reviewing what they're commiting, errors in the exceptions flagging would potentially be caught.
I think interactive would or should be incompatible for use with pre-commit.
Since it's interactive, we could resolve the available / used configuration files with the existing logic and then present the user with a selection of files to choose from? |
I'd also have to reference another non-standard that got past the "single character" reviewers... https://github.com/godaddy/tartufo/blob/master/tartufo/cli.py#L97
Since there is no harm in supporting it, why not allow a dev to scan the pre-commit with interactive? Interactive only adds value.
That works too. I'd hate to be prompted on every issue, however some issues might be better suited to be in a repo ignore file. |
True, true.
I haven't seen any other pre-commit hooks that were interactive, but if it works, that's cool. |
This was a choice made specifically after a design discussion, to avoid another common convention. #11 (comment) -- but the convention I'm referring to here is specifically with interactive CLI loops like this one. For example, when using
Yeah if it works, that could be interesting. I'm just wondering how intuitive this would end up being. Let's say you've got
What if, instead of automatically appending to a file, we give the user the exclusions to add as output at the end of the run? |
That |
I'm not sure we want to remove a feature on the assumption that someone is going to specify |
I thought about that at first, but if someone was halfway through a review and had to CTRL-C, they would lose all their progress. |
Feature Request
To boost the time it takes takes ignore false flags, I propose we add an interactive mode
--interactive
where the CLI will prompt on each issue providing the ability to ignore by file, signature, or specify a regular expression. Each of these ignores will be added to one of the ignore files and be automatically added to the context ignore similar issues going forward.Is your feature request related to a problem? Please describe.
Running tartufo on a repo can lead to 300K+ lines of stdout to sift through. You find something, ignore it, run it again. Repeat. This is a long process.
Describe the solution you'd like
Add
--interactive
flag that will prompt on each issue showing a region around the identified secret.Ignore regular expression
IR
will prompt for the regular expression. It will validate the regex on the matched content. Empty will return back to Action prompt.Flag
F
will append the flagged secret to atartufoflagged.json
file.Describe alternatives you've considered
None available.
Teachability, Documentation, Adoption, Migration Strategy
The text was updated successfully, but these errors were encountered: