Skip to content
Permalink
Browse files

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

Fixes: #767
  • Loading branch information
codyoss committed Dec 8, 2020
1 parent 7034dd7 commit d2bc921f997425bc267d8e4845286b0d67bbe1ef
Showing with 23 additions and 17 deletions.
  1. +17 −16 compute/v1/compute-gen.go
  2. +6 −1 google-api-go-generator/gen.go
// 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
// 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"`

// 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.
// 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
// 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
// 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
// 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.
// 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.
@@ -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 != "")

0 comments on commit d2bc921

Please sign in to comment.