Skip to content

Commit 139e340

Browse files
t-8chjeromep-stripe
authored andcommitted
rule: rename GetAttrComments -> AttrComments (bazel-contrib#1703)
Change the name to be more consistent with the rest of the codebase as request in bazel-contrib#1700 (comment)
1 parent 844add8 commit 139e340

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

rule/rule.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -957,9 +957,9 @@ func (r *Rule) SetAttr(key string, value interface{}) {
957957
r.updated = true
958958
}
959959

960-
// GetAttrComments returns the comments for an attribute.
960+
// AttrComments returns the comments for an attribute.
961961
// It can be used to attach comments like "do not sort".
962-
func (r *Rule) GetAttrComments(key string) *bzl.Comments {
962+
func (r *Rule) AttrComments(key string) *bzl.Comments {
963963
attr, ok := r.attrs[key]
964964
if !ok {
965965
return nil

rule/rule_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ func TestAttributeComment(t *testing.T) {
609609
r := NewRule("a_rule", "name1")
610610
r.SetAttr("deps", []string{"foo", "bar", "baz"})
611611
r.SetAttr("hdrs", []string{"foo", "bar", "baz"})
612-
hdrComments := r.GetAttrComments("hdrs")
612+
hdrComments := r.AttrComments("hdrs")
613613
hdrComments.Before = append(hdrComments.Before, bzl.Comment{
614614
Token: "# do not sort",
615615
})

0 commit comments

Comments
 (0)