Skip to content

[Fix] Consolidate error format strings#29

Merged
mrz1836 merged 1 commit into
masterfrom
feat/fix-issues-and-run-linter-tests
Oct 9, 2025
Merged

[Fix] Consolidate error format strings#29
mrz1836 merged 1 commit into
masterfrom
feat/fix-issues-and-run-linter-tests

Conversation

@mrz1836
Copy link
Copy Markdown
Collaborator

@mrz1836 mrz1836 commented Oct 9, 2025

What Changed

  • Introduced shared constants for the repeated %w (int32): %d, %w (uint32): %d, and %w to uint32: %d error format strings.
  • Updated all conversion helpers that emitted those messages to reference the new constants.

Why It Was Necessary

  • Resolves the maintainability warnings about duplicated string literals reported by the static analysis tooling.

Testing Performed

  • go test ./...
  • golangci-lint run (fails locally: unknown linters arangolint, embeddedstructfieldcheck, wsl_v5)

Impact / Risk

  • Low risk: only consolidates shared error format strings without altering conversion logic.

https://chatgpt.com/codex/tasks/task_e_68e81bb387808321bf3ee689aa363c89

Copilot AI review requested due to automatic review settings October 9, 2025 20:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR consolidates duplicate error format strings used throughout safe conversion functions to improve code maintainability and address static analysis warnings about string literal duplication.

  • Introduced three shared constants for error message formatting patterns
  • Updated all conversion functions to use the new constants instead of hardcoded strings
  • Maintained identical error message formatting while eliminating duplication

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions github-actions Bot added bug-P3 Lowest rated bug, affects nearly none or low-impact feature Any new significant addition labels Oct 9, 2025
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Oct 9, 2025

@github-actions github-actions Bot added the size/S Small change (11–50 lines) label Oct 9, 2025
@mrz1836 mrz1836 changed the title [Safe Conversion] Consolidate error format strings [Fix] Consolidate error format strings Oct 9, 2025
@mrz1836 mrz1836 removed the feature Any new significant addition label Oct 9, 2025
@mrz1836 mrz1836 merged commit 97d8877 into master Oct 9, 2025
38 checks passed
@github-actions github-actions Bot deleted the feat/fix-issues-and-run-linter-tests branch October 9, 2025 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-P3 Lowest rated bug, affects nearly none or low-impact codex size/S Small change (11–50 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants