cockroachdb / cockroachdb/cockroach
build: add linter to flag uses of `redact.StripMarkers()`
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
We've previously had code merged that explicitly removed redaction markers from strings prior to logging them, we should add a linter to flag these situations as no one should be doing this. Instead, we should either pass `RedactableString` to the logger, or implement `redact.SafeFormatter`.
Example PR with such changes: https://github.com/cockroachdb/cockroach/pull/126507/files#diff-e5a646fccbaa96a87ee8f4b10a481cbe30467306e77ee63b808b2df0678ad9e5R573
One caveat with this usage that we *should* allow is that a typical implementation of `Error` will call `StripMarkers()` on the redactable implementation of the error string (like here: https://github.com/cockroachdb/cockroach/pull/134224
Jira issue: CRDB-44352
Epic CRDB-49081
Contributor guide
Assessment
This issue has not been assessed yet.