Skip to content

fix(eds): keep the GenerateGo header on one line for any source name - #31

Merged
boeboe merged 1 commit into
mainfrom
fix/eds-header
Nov 15, 2026
Merged

boeboe merged 1 commit into
mainfrom
fix/eds-header

Conversation

@boeboe

@boeboe boeboe commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

What changes

  • eds.GenerateGo passes GenerateOptions.Source through goComment, as it already does for the product name and the help texts it writes into comments: control characters, invalid UTF-8 and the byte order mark become spaces. A source name with a line break ended the header comment early, so the output either did not format (GenerateGo returned an error) or held the rest of the name as code. The Source doc comment says so.
  • RELEASE.md: v0.8.1.

Why: found by the policy 1.6 review of ethernetipctl, whose eds codegen passes the EDS file name as Source.

Tests

  • TestGenerateSourceKeepsHeaderOneLine: source names with LF, CR LF, an escape sequence, U+2028, a backtick, invalid UTF-8 and */. The first line is the header with no control character, and the rest of the file equals the one generated for a plain name. On v0.8.0 it fails at the first name: eds: generated code does not format: 2:11: expected ';', found NOT.

No exported identifier is added, removed or changed.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@boeboe
boeboe merged commit 279e86a into main Nov 15, 2026
26 checks passed
@boeboe
boeboe deleted the fix/eds-header branch November 15, 2026 14:57
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.

1 participant