Skip to content

fix(gen): use standard comment format in generated code - #25

Open
ardnew wants to merge 1 commit into
goccmack:masterfrom
ardnew:fix/gen-comment
Open

fix(gen): use standard comment format in generated code#25
ardnew wants to merge 1 commit into
goccmack:masterfrom
ardnew:fix/gen-comment

Conversation

@ardnew

@ardnew ardnew commented Dec 30, 2025

Copy link
Copy Markdown

Generated Go code is not recognized correctly by various linters, formatters, and IDEs because they are using a non-standard format in the header comment.

Per documentation from go help generate:

To convey to humans and machine tools that code is generated,
generated source should have a line that matches the following
regular expression (in Go syntax):

	^// Code generated .* DO NOT EDIT\.$

This line must appear before the first non-comment, non-blank
text in the file.

Copilot AI review requested due to automatic review settings December 30, 2025 19:22

Copilot AI left a comment

Copy link
Copy Markdown

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 updates the header comments in generated Go code templates to comply with the official Go standard format for generated code markers. The change ensures that linters, formatters, and IDEs properly recognize the generated files.

  • Standardizes all generated code headers to follow the pattern ^// Code generated .* DO NOT EDIT\.$
  • Removes package-specific references and trailing spaces from the old format
  • Ensures consistency across all code generation templates in the project

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
gen/golang/token/token.go Updates token package generation template header to use standard format
gen/golang/lexer/lexer.go Updates lexer package generation template header to use standard format
gen/golang/gll/symbols/symbols.go Updates symbols package generation template header to use standard format
gen/golang/gll/sppf/sppf.go Updates SPPF package generation template header to use standard format
gen/golang/gll/slots/slots.go Updates slots package generation template header and removes trailing space
gen/golang/gll/parser.go Updates parser package generation template header to use standard format
gen/golang/gll/bsr/bsr.go Updates BSR package generation template header to use standard format

All changes correctly implement the Go standard format for generated code markers. The new format // Code generated by gogll. DO NOT EDIT. matches the required regular expression pattern and will be properly recognized by tooling. No issues found.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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