Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add comment 'Generated: DO NOT EDIT' disclaimer to generated (Go,...?) typed files #206

Open
meowsbits opened this issue Jan 28, 2020 · 0 comments
Labels

Comments

@meowsbits
Copy link
Contributor

The following command produces a type Go file with head as below

> open-rpc-typings --output-go goout -d https://raw.githubusercontent.com/open-rpc/examples/master/service-descriptions/petstore-expanded-openrpc.json
> head goout/index.go 
type StringDoaGddGA string
type UnorderedSetOfStringDoaGddGADvj0XlFa []StringDoaGddGA
type Integer2AHOqbcQ int64
type ObjectOfStringDoaGddGAStringDoaGddGAUbqj18UU struct {
        Name *StringDoaGddGA `json:"name"`
        Tag  *StringDoaGddGA `json:"tag,omitempty"`
}
type AnyBrndsk4F interface{}
type AllOfAnyBrndsk4FObjectOfStringDoaGddGAStringDoaGddGAUbqj18UUKZp9HQVl map[string]interface{}
type UnorderedSetOfAllOfAnyBrndsk4FObjectOfStringDoaGddGAStringDoaGddGAUbqj18UUKZp9HQVlL0I1EEvd []AllOfAnyBrndsk4FObjectOfStringDoaGddGAStringDoaGddGAUbqj18UUKZp9HQVl

In Go, it is conventional to prepend a "Generated - DO NOT EDIT" disclaimer comment at or near the top of generated files. This is useful for both robots and humans futher down the line. I don't know of any "canonical" phrase or sentence; usually includes the bespoke four words, though caps and ordering and punctuation may vary.

I don't know if this applies to other languages like Rust and Typescript too... ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant