From d554be986768638212b831d9bfc1b0c0244a87a3 Mon Sep 17 00:00:00 2001 From: Mark Karpov Date: Fri, 9 Aug 2024 14:38:43 +0200 Subject: [PATCH] Work around missing "stringListValue" in certain cases It seems that not all targets that explicitly specify the `hdrs` attribute also have the `stringListValue` present. --- src/apply_fixes/search_missing_deps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apply_fixes/search_missing_deps.py b/src/apply_fixes/search_missing_deps.py index 365fd501..a43ca9cb 100644 --- a/src/apply_fixes/search_missing_deps.py +++ b/src/apply_fixes/search_missing_deps.py @@ -47,7 +47,7 @@ def get_dependencies(bazel_query: BazelQuery, target: str) -> list[Dependency]: for x in queried_targets: if x["type"] == "RULE" and x["rule"]["ruleClass"].startswith("cc_"): for attr in x["rule"]["attribute"]: - if attr["name"] == "hdrs" and attr["explicitlySpecified"]: + if attr["name"] == "hdrs" and attr["explicitlySpecified"] and "stringListValue" in attr: deps.append( Dependency( target=x["rule"]["name"],