Closed tigrato closed 2 months ago
Hello, thank you for the PR, I like the idea!
I noticed that you first named it --forbidden-key
, which I actually like better, because there might be other reasons why a log key is forbidden (e.g., a styleguide). In general, I think sloglint
does not need to know the semantics behind the keys, it just needs to forbid them.
@tmzane thanks.
I reverted the feature to its original name forbbiden-key
.
I just remembered that strconv.Unquote
exists. And it is used in the standard library exactly for this case!
@tigrato thanks, this is a great feature to have!
@mattdowdell as always, thanks for the review!
Oh, and we should bump Go version in go.mod, because the slices
package only exists since 1.21.
This PR implements a linter rule to deny usages of certain keys as attributes to enforce that developers don't override reserved keys managed by custom handlers.