{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/code-generator/issues/30","repository_url":"https://api.github.com/repos/kubernetes/code-generator","labels_url":"https://api.github.com/repos/kubernetes/code-generator/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/code-generator/issues/30/comments","events_url":"https://api.github.com/repos/kubernetes/code-generator/issues/30/events","html_url":"https://github.com/kubernetes/code-generator/issues/30","id":285179901,"number":30,"title":"Generated files should follow golang standard for machine-generated files to avoid golint issues","user":{"login":"mattkelly","id":248713,"avatar_url":"https://avatars0.githubusercontent.com/u/248713?v=4","gravatar_id":"","url":"https://api.github.com/users/mattkelly","html_url":"https://github.com/mattkelly","followers_url":"https://api.github.com/users/mattkelly/followers","following_url":"https://api.github.com/users/mattkelly/following{/other_user}","gists_url":"https://api.github.com/users/mattkelly/gists{/gist_id}","starred_url":"https://api.github.com/users/mattkelly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattkelly/subscriptions","organizations_url":"https://api.github.com/users/mattkelly/orgs","repos_url":"https://api.github.com/users/mattkelly/repos","events_url":"https://api.github.com/users/mattkelly/events{/privacy}","received_events_url":"https://api.github.com/users/mattkelly/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-12-30T02:57:01Z","updated_at":"2018-02-27T22:12:31Z","closed_at":null,"author_association":"NONE","body":"# Overview\r\n\r\nFiles generated by `code-generator` currently have a lot of issues picked up by `golint`. There are a few options to fix this:\r\n\r\n- Fix the actual lint issues in the generated code\r\n    - This would require fixing the existing generated code and putting a process in place for the future to prevent lint issues in generated code from being merged\r\n- Ignore the generated files in some other way\r\n    - This requires all users to implement their own solution to this problem\r\n- Follow the [golang convention for machine-generated files](https://github.com/golang/go/issues/13560#issuecomment-288457920) so `golint` automatically skips them\r\n    - I think this is the most appropriate solution because the golang community has standardized on it, it's trivial to implement, and it avoids adding more process\r\n\r\n# Proposed Solution\r\n\r\nI propose that we add the following comment line just below the [boilerplate header](https://github.com/kubernetes/kubernetes/pull/57656):\r\n\r\n```\r\n// Code generated by <generator-name>. DO NOT EDIT.\r\n```\r\n\r\nThere are already lines similar to this generated but they do not match the desired regex, so we can just modify them. For example: https://github.com/kubernetes/kubernetes/search?utf8=✓&q=%22Do+not+edit+it+manually%22&type=Code. \r\n\r\nAfter some quick poking around, this will require modifying not only `code-generator` but also [kubernetes/gengo](https://github.com/kubernetes/gengo) for example.\r\n\r\nI've tested manually editing an auto-generated file to add this line and it does result in `golint` ignoring the file as expected.\r\n\r\nI'm not very familiar with the process for auto-generated code in Kubernetes itself - would we want to re-generate all of the generated code as part of the PR for this issue?\r\n\r\nI'm happy to take this on this weekend if we feel that it's a good solution."},"comment":{"url":"https://api.github.com/repos/kubernetes/code-generator/issues/comments/369045350","html_url":"https://github.com/kubernetes/code-generator/issues/30#issuecomment-369045350","issue_url":"https://api.github.com/repos/kubernetes/code-generator/issues/30","id":369045350,"user":{"login":"jennybuckley","id":31416425,"avatar_url":"https://avatars2.githubusercontent.com/u/31416425?v=4","gravatar_id":"","url":"https://api.github.com/users/jennybuckley","html_url":"https://github.com/jennybuckley","followers_url":"https://api.github.com/users/jennybuckley/followers","following_url":"https://api.github.com/users/jennybuckley/following{/other_user}","gists_url":"https://api.github.com/users/jennybuckley/gists{/gist_id}","starred_url":"https://api.github.com/users/jennybuckley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jennybuckley/subscriptions","organizations_url":"https://api.github.com/users/jennybuckley/orgs","repos_url":"https://api.github.com/users/jennybuckley/repos","events_url":"https://api.github.com/users/jennybuckley/events{/privacy}","received_events_url":"https://api.github.com/users/jennybuckley/received_events","type":"User","site_admin":false},"created_at":"2018-02-27T22:12:31Z","updated_at":"2018-02-27T22:12:31Z","author_association":"CONTRIBUTOR","body":"/close\r\nhttps://github.com/kubernetes/kubernetes/pull/59674"}}
{"actor":{"display_login":"jennybuckley"}}