Skip to content

Fix named string conversion diagnostics in bytescomparestring - #53582

Merged
pelikhan merged 3 commits into
mainfrom
copilot/fix-bytescomparestring-diagnostic-message
Aug 18, 2026
Merged

Fix named string conversion diagnostics in bytescomparestring#53582
pelikhan merged 3 commits into
mainfrom
copilot/fix-bytescomparestring-diagnostic-message

Conversation

Copilot AI commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

bytescomparestring recognized named string-type conversions but reported them as string(...), misrepresenting the flagged source expression.

  • Diagnostic rendering
    • Preserve each conversion’s source type expression when building messages.
    • Render named types independently on both comparison sides.
type Password string

Password(a) == Password(b)
// diagnostic: Password(a) == Password(b) ...
  • Regression coverage
    • Add golden coverage for Password(a) == Password(b).
    • Retain the existing bytes.Equal(a, b) suggested fix.

Copilot AI and others added 2 commits August 18, 2026 04:27
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix hardcoded diagnostic message in bytescomparestring Fix named string conversion diagnostics in bytescomparestring Aug 18, 2026
Copilot AI requested a review from pelikhan August 18, 2026 04:34
@pelikhan
pelikhan marked this pull request as ready for review August 18, 2026 04:53
Copilot AI balanced review requested due to automatic review settings August 18, 2026 04:53
@pelikhan
pelikhan merged commit 996c9bf into main Aug 18, 2026
5 checks passed
@pelikhan
pelikhan deleted the copilot/fix-bytescomparestring-diagnostic-message branch August 18, 2026 04:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Corrects bytescomparestring diagnostics for named string conversions while preserving existing suggested fixes.

Changes:

  • Render each conversion’s source type independently.
  • Add named-string regression fixtures.
  • Regenerate two unrelated workflow lockfiles, disabling strict mode.
Show a summary per file
File Description
pkg/linters/bytescomparestring/bytescomparestring.go Preserves conversion type expressions in diagnostics.
pkg/linters/bytescomparestring/testdata/src/bytescomparestring/bytescomparestring.go Adds named-string regression coverage.
pkg/linters/bytescomparestring/testdata/src/bytescomparestring/bytescomparestring.go.golden Verifies the unchanged suggested fix.
.github/workflows/mcp-inspector.lock.yml Introduces unrelated non-strict workflow output.
.github/workflows/daily-team-evolution-insights.lock.yml Introduces unrelated non-strict workflow output.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Balanced

GH_AW_INFO_CACHE_MEMORY: "true"
GH_AW_INFO_FRONTMATTER_EMOJI: "🔍"
GH_AW_COMPILED_STRICT: "true"
GH_AW_COMPILED_STRICT: "false"
GH_AW_INFO_AGENT_RUNTIME: ""
GH_AW_INFO_FRONTMATTER_EMOJI: "📊"
GH_AW_COMPILED_STRICT: "true"
GH_AW_COMPILED_STRICT: "false"
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.87.1

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.

bytescomparestring: diagnostic message hardcodes "string(...)" and misrepresents named-type conversions

3 participants