trufflehog
trufflehog copied to clipboard
Change source reporter interfaces to not return errors
Description:
The error was meant to allow the reporter to end scanning, but in practice would only be useful for context cancellations, which sources should be handling anyway. Removing the error simplifies the usage of the interface.
Checklist:
- [ ] Tests passing (
make test-community)? - [ ] Lint passing (
make lintthis requires golangci-lint)?
If I understand this PR correctly, it (effectively) removes context cancellation checks from a lot of places (anywhere that used to check for a non-
nilerror returned from a reporter, and return if one was found). Do we need to re-add them explicitly?
That's correct. Additionally, it removes confirmation of whether the item was successfully handled. That is the main tradeoff of this change. The argument is that sources shouldn't need to care whether the item was handled or not.
They do need to be context aware, though.
If I understand this PR correctly, it (effectively) removes context cancellation checks from a lot of places (anywhere that used to check for a non-
nilerror returned from a reporter, and return if one was found). Do we need to re-add them explicitly?That's correct. Additionally, it removes confirmation of whether the item was successfully handled. That is the main tradeoff of this change. The argument is that sources shouldn't need to care whether the item was handled or not.
They do need to be context aware, though.
Yep, so then should this PR re-add the (implicit) context cancellation checks that it's removed?