Skip to content

generator: emit standard generated-code markers - #593

Open
zbarsky-openai wants to merge 1 commit into
goccy:masterfrom
zbarsky-openai:codex/standard-generated-markers
Open

generator: emit standard generated-code markers#593
zbarsky-openai wants to merge 1 commit into
goccy:masterfrom
zbarsky-openai:codex/standard-generated-markers

Conversation

@zbarsky-openai

Copy link
Copy Markdown

The encoder generator currently emits DO NOT EDIT!, but Go recognizes generated files only when the marker ends in DO NOT EDIT.. Consequently, go/ast.IsGenerated and Staticcheck treat the large generated encoder state machines as handwritten source.

Update the encoder generator and VM template to emit Go's standard marker and regenerate all five checked-in encoder outputs. The generated code is otherwise unchanged.

Validation:

  • go generate ./internal/... (repeated; output is idempotent)
  • go test -p 4 ./...

Use the standard Go generated-file marker in the encoder generator
and VM template, then regenerate the checked-in encoder outputs.

Go tooling recognizes generated files only when their marker ends
in "DO NOT EDIT.". The exclamation point made Staticcheck analyze
the generated encoder state machines as handwritten source.
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