Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rule: add accessor for attribute comments (bazelbuild#1700)
This allows user to attach comments like "# do not sort" to the assignment expressions maintained by rule.go. rule.Format() calls into buildtools/build.Format() which in turn calls Rewrite(). Rewrite() by default sorts certain label arguments like "deps" and "hdrs". To preventing this sorting it is possible to provide the comment "# do not sort". However this comment needs to be attached to the assignment expression. In rule.go the assignment expressions are not exposed to the user, making it impossible to attach the comment to it. See bazelbuild#237 (comment)
- Loading branch information