Closed agateau-gg closed 1 month ago
You set this PR to your original fix branch, instead of
garancegourdel/refacto-output-handlers-to-remove-scanable-from-result
is that intentional ?
Oups, I missed that the branch had been created. Going to rebase.
You have functional test failing because they capture a new generic secret in the snapshot.
Should be good now 🤞🏻.
Context
While reviewing #905 I thought it was a bit sad that we had to add a field just for backward-compatibility, so I dived into what could be done to get rid of some of the patch special-cases cruft.
What has been done
Line.content now always contains the full line, including the patch symbol.
This simplifies a bunch of things:
is_patch
boolean. This attribute is only used to decide whether to print patch or file line numbers.If you look at the snapshot diff you will see two things.
First, patch output is more correct: the second
@
at the end of the@@ ... @@
lines does not miss anymore.For multiline secrets, the detector left "arm" (the
|___
symbol) starts one character earlier (see the snapshot diffs). This might be fixable but I don't think it's a problem.Validation
Tests still pass.
PR check list
skip-changelog
label has been added to the PR.