Skip to content

Commit

Permalink
rule: rename GetAttrComments -> AttrComments (#1703)
Browse files Browse the repository at this point in the history
Change the name to be more consistent with the rest of the codebase as
request in
#1700 (comment)
  • Loading branch information
t-8ch committed Dec 28, 2023
1 parent c1b24e5 commit 26aa0cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rule/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -957,9 +957,9 @@ func (r *Rule) SetAttr(key string, value interface{}) {
r.updated = true
}

// GetAttrComments returns the comments for an attribute.
// AttrComments returns the comments for an attribute.
// It can be used to attach comments like "do not sort".
func (r *Rule) GetAttrComments(key string) *bzl.Comments {
func (r *Rule) AttrComments(key string) *bzl.Comments {
attr, ok := r.attrs[key]
if !ok {
return nil
Expand Down
2 changes: 1 addition & 1 deletion rule/rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ func TestAttributeComment(t *testing.T) {
r := NewRule("a_rule", "name1")
r.SetAttr("deps", []string{"foo", "bar", "baz"})
r.SetAttr("hdrs", []string{"foo", "bar", "baz"})
hdrComments := r.GetAttrComments("hdrs")
hdrComments := r.AttrComments("hdrs")
hdrComments.Before = append(hdrComments.Before, bzl.Comment{
Token: "# do not sort",
})
Expand Down

0 comments on commit 26aa0cf

Please sign in to comment.