From 91bdbf68dd2ad478bcf79c612025a8d22bb157b5 Mon Sep 17 00:00:00 2001 From: adcondev <38170282+adcondev@users.noreply.github.com> Date: Thu, 12 Feb 2026 21:53:12 +0000 Subject: [PATCH] chore(graphics): remove ambiguous linter suppression TODO The `//nolint:gosec` suppression in `SetPixel` is verified to be safe. The bounds check `x < 0` ensures `x` is non-negative, so `x % 8` is in [0, 7] and `7 - (x % 8)` is also in [0, 7]. Converting this to `uint` is safe from overflow. Verified with unit tests. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- pkg/graphics/bitmap.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/graphics/bitmap.go b/pkg/graphics/bitmap.go index 7a9e4c9..bc0faf1 100644 --- a/pkg/graphics/bitmap.go +++ b/pkg/graphics/bitmap.go @@ -29,8 +29,6 @@ func (m *MonochromeBitmap) SetPixel(x, y int, black bool) { return } - // TODO: Make sure linter suppression is safe here - bytesPerRow := (m.Width + 7) / 8 byteIndex := y*bytesPerRow + x/8 bitIndex := uint(7 - (x % 8)) //nolint:gosec