Skip to content

chore: lint fixes part 6#258

Merged
pawbana merged 1 commit into
mainfrom
pb/coder-lint-fix6
Apr 13, 2026
Merged

chore: lint fixes part 6#258
pawbana merged 1 commit into
mainfrom
pb/coder-lint-fix6

Conversation

@pawbana
Copy link
Copy Markdown
Contributor

@pawbana pawbana commented Apr 10, 2026

  • unhandled-error (26): explicitly handled return values from in-memory buffer writes (bytes.Buffer, strings.Builder — never fail), os.File.Close (best-effort cleanup), io.PipeWriter.Write/Close (error
    handled via pipe read side); properly checked errors from circuitbreaker.Execute and responseCopier.forwardResp in tests
  • exported stutter (3): messages.MessagesRequestPayload → messages.RequestPayload (+ constructor NewRequestPayload); responses.ResponsesRequestPayload → responses.RequestPayload (+ constructor
    NewRequestPayload); recorder.RecorderWrapper → recorder.WrappedRecorder (+ constructor NewWrappedRecorder)

// Methods provide package-specific reads and rewrites while preserving the
// original body for upstream pass-through.
type MessagesRequestPayload []byte
type RequestPayload []byte
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of at odds with #257 where errorResponse became chatCompletionResponseError.

Let's pick one approach and use it consistently.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good catch. There are 2 different rules:
- errname: error types need to have Error suffix
- exported stutter: exported symbols cannot start with package name

RequestPayload types are exported so it is enforced while error types from #257 are internal.
I'll update #257 to match stutter rule even thou error types are not exported.

@pawbana pawbana force-pushed the pb/coder-lint-fix6 branch from 95d767c to 523ed94 Compare April 13, 2026 11:30
@pawbana pawbana force-pushed the pb/coder-lint-fix5 branch from 31f8bd5 to 240e79c Compare April 13, 2026 11:30
@pawbana pawbana force-pushed the pb/coder-lint-fix6 branch from 523ed94 to 6139b9e Compare April 13, 2026 11:41
@pawbana pawbana force-pushed the pb/coder-lint-fix5 branch from 240e79c to 02b6daf Compare April 13, 2026 11:41
@pawbana pawbana force-pushed the pb/coder-lint-fix6 branch 2 times, most recently from d91d17a to 9e01fa4 Compare April 13, 2026 13:39
Copy link
Copy Markdown
Contributor Author

pawbana commented Apr 13, 2026

Merge activity

  • Apr 13, 3:10 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 13, 3:13 PM UTC: Graphite couldn't merge this pull request because a downstack PR chore: lint fixes part 1 (automatic fixes) #253 failed to merge.
  • Apr 13, 3:24 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 13, 3:34 PM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 13, 3:35 PM UTC: @pawbana merged this pull request with Graphite.

@pawbana pawbana force-pushed the pb/coder-lint-fix5 branch from 3720ab4 to f206eb4 Compare April 13, 2026 15:22
@pawbana pawbana force-pushed the pb/coder-lint-fix6 branch from 9e01fa4 to 5aff9e5 Compare April 13, 2026 15:22
@pawbana pawbana changed the base branch from pb/coder-lint-fix5 to graphite-base/258 April 13, 2026 15:32
@pawbana pawbana changed the base branch from graphite-base/258 to main April 13, 2026 15:33
@pawbana pawbana force-pushed the pb/coder-lint-fix6 branch from 5aff9e5 to b9d8cc5 Compare April 13, 2026 15:34
@pawbana pawbana merged commit b0989c9 into main Apr 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants