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

fix(compute): don't tigger linter for field named Deprecated #774

Merged
merged 3 commits into from Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 17 additions & 16 deletions compute/v1/compute-gen.go
Expand Up @@ -1107,8 +1107,8 @@ type AcceleratorType struct {
// format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`

// Deprecated: [Output Only] The deprecation status associated with this
// accelerator type.
// Deprecated -- [Output Only] The deprecation status associated with
// this accelerator type.
Deprecated *DeprecationStatus `json:"deprecated,omitempty"`

// Description: [Output Only] An optional textual description of the
Expand Down Expand Up @@ -6672,9 +6672,9 @@ type DeprecationStatus struct {
// explicitly changes it.
Deleted string `json:"deleted,omitempty"`

// Deprecated: An optional RFC3339 timestamp on or after which the state
// of this resource is intended to change to DEPRECATED. This is only
// informational and the status will not change unless the client
// Deprecated -- An optional RFC3339 timestamp on or after which the
// state of this resource is intended to change to DEPRECATED. This is
// only informational and the status will not change unless the client
// explicitly changes it.
Deprecated string `json:"deprecated,omitempty"`

Expand Down Expand Up @@ -7454,8 +7454,8 @@ type DiskType struct {
// GB.
DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"`

// Deprecated: [Output Only] The deprecation status associated with this
// disk type.
// Deprecated -- [Output Only] The deprecation status associated with
// this disk type.
Deprecated *DeprecationStatus `json:"deprecated,omitempty"`

// Description: [Output Only] An optional description of this resource.
Expand Down Expand Up @@ -13229,7 +13229,7 @@ type Image struct {
// format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`

// Deprecated: The deprecation status associated with this image.
// Deprecated -- The deprecation status associated with this image.
Deprecated *DeprecationStatus `json:"deprecated,omitempty"`

// Description: An optional description of this resource. Provide this
Expand Down Expand Up @@ -20261,8 +20261,9 @@ type MachineType struct {
// format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`

// Deprecated: [Output Only] The deprecation status associated with this
// machine type. Only applicable if the machine type is unavailable.
// Deprecated -- [Output Only] The deprecation status associated with
// this machine type. Only applicable if the machine type is
// unavailable.
Deprecated *DeprecationStatus `json:"deprecated,omitempty"`

// Description: [Output Only] An optional textual description of the
Expand Down Expand Up @@ -24503,8 +24504,8 @@ type NodeType struct {
// format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`

// Deprecated: [Output Only] The deprecation status associated with this
// node type.
// Deprecated -- [Output Only] The deprecation status associated with
// this node type.
Deprecated *DeprecationStatus `json:"deprecated,omitempty"`

// Description: [Output Only] An optional textual description of the
Expand Down Expand Up @@ -27897,8 +27898,8 @@ type Region struct {
// format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`

// Deprecated: [Output Only] The deprecation status associated with this
// region.
// Deprecated -- [Output Only] The deprecation status associated with
// this region.
Deprecated *DeprecationStatus `json:"deprecated,omitempty"`

// Description: [Output Only] Textual description of the resource.
Expand Down Expand Up @@ -43558,8 +43559,8 @@ type Zone struct {
// format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`

// Deprecated: [Output Only] The deprecation status associated with this
// zone.
// Deprecated -- [Output Only] The deprecation status associated with
// this zone.
Deprecated *DeprecationStatus `json:"deprecated,omitempty"`

// Description: [Output Only] Textual description of the resource.
Expand Down
7 changes: 6 additions & 1 deletion google-api-go-generator/gen.go
Expand Up @@ -1381,7 +1381,12 @@ func (s *Schema) writeSchemaStruct(api *API) {
p.assignedGoName = pname
des := p.Description()
if des != "" {
s.api.p("%s", asComment("\t", fmt.Sprintf("%s: %s", pname, des)))
if pname == "Deprecated" {
// Workaround to not trip up linters on fields named Deprecated.
s.api.p("%s", asComment("\t", fmt.Sprintf("%s -- %s", pname, des)))
} else {
s.api.p("%s", asComment("\t", fmt.Sprintf("%s: %s", pname, des)))
}
}
addFieldValueComments(s.api.p, p, "\t", des != "")

Expand Down