| commit | e24971d9d1a7b2ab9abcb5a1c37a36cd6f351680 | [log] [tgz] |
|---|---|---|
| author | Matt Brown <matt@mattnworb.com> | Mon Feb 02 05:57:09 2026 -0500 |
| committer | GitHub <noreply@github.com> | Mon Feb 02 10:57:09 2026 +0000 |
| tree | fa8d434a3d7151c88477e61aa060712b6be0d773 | |
| parent | 54a7200a18c1a32fceb9fe9615787188ba3b2157 [diff] |
support AssignExpr statements in edit.FindRuleByName() (#1369) * support AssignExpr statements in edit.FindRuleByName() We have what is probably an unconventional style in some of our BUILD files where a macro is used to define several targets and returns a struct of some information so that things like labels of generated targets can be passed as attributes to other targets in the same BUILD file, without the BUILD file needing to hardcode or be aware of the naming convention of the macro's internals. buildozer and unused_deps are unable to operate on targets in `AssignExpr` statements since `edit.FindRuleByName()` and `edit.IndexOfRuleByName()` skip over any nodes that are not call expressions. This commit adapts these functions to be able to find call expressions that are on the right-hand side of an assignment expression. fixes #1306 * refactor test based on feedback * refactor check for CallExpr or AssignExpr based on feedback
This repository contains developer tools for working with Google's bazel buildtool.
See instructions in each tool's directory.