Skip to content

chore: lint fixes part 6#258

Open
pawbana wants to merge 1 commit intopb/coder-lint-fix5from
pb/coder-lint-fix6
Open

chore: lint fixes part 6#258
pawbana wants to merge 1 commit intopb/coder-lint-fix5from
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)

Copy link
Copy Markdown
Contributor Author

pawbana commented Apr 10, 2026

// 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 from 6139b9e to d91d17a Compare April 13, 2026 13:19
@pawbana pawbana force-pushed the pb/coder-lint-fix6 branch from d91d17a to 9e01fa4 Compare April 13, 2026 13:39
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