Skip to content

Commit

Permalink
fix: Exclude Delete{Resource}Revision methods from AIP-135 checks. (#889
Browse files Browse the repository at this point in the history
)

These are governed by AIP-162 and have different (conflicting)
requirements for their return values.
  • Loading branch information
timburks authored Oct 14, 2021
1 parent 164df84 commit ab973eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rules/aip0135/aip0135.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ func AddRules(r lint.RuleRegistry) error {

var deleteMethodRegexp = regexp.MustCompile("^Delete(?:[A-Z]|$)")
var deleteReqMessageRegexp = regexp.MustCompile("^Delete[A-Za-z0-9]*Request$")
var deleteRevisionMethodRegexp = regexp.MustCompile("^Delete[A-Za-z0-9]*Revision$")

// Returns true if this is a AIP-135 Delete method, false otherwise.
func isDeleteMethod(m *desc.MethodDescriptor) bool {
return deleteMethodRegexp.MatchString(m.GetName())
return deleteMethodRegexp.MatchString(m.GetName()) && !deleteRevisionMethodRegexp.MatchString(m.GetName())
}

// Returns true if this is an AIP-135 Delete request message, false otherwise.
Expand Down

0 comments on commit ab973eb

Please sign in to comment.