Skip to content

Add generated file comment at top of files.#169

Draft
bstoll wants to merge 3 commits intoopenconfig:mainfrom
bstoll:generated-notice
Draft

Add generated file comment at top of files.#169
bstoll wants to merge 3 commits intoopenconfig:mainfrom
bstoll:generated-notice

Conversation

@bstoll
Copy link
Copy Markdown
Contributor

@bstoll bstoll commented Oct 13, 2025

ygnmi generated code has a package comment identifying the files are generated, but this does not match the common Go style used - the terms "generated package" or "package was generated by" do not appear very often in other Go code generators that I can find. The comment // Code generated by [package]. DO NOT EDIT. seems to be quite common - it is used in the Go source and tooling like protoc.

The inspiration for this change is GitHub will hide generated code diff changes in PRs if it matches this pattern. Users can define a .gitattributes file in their repo to manually identify generated files, but if we make the change in ygot/ygnmi users will not need to do this. This makes it much easier to review pull requests where a minor change can result in a large number of generated file changes.

This PR is a child to openconfig/ygot#1057 - this PR will only make sense to merge after a tagged release of the ygot changes is made and ygnmi can be updated here to depend on the new release to cover all the header updates.

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