Skip to content

Commit 9976f41

Browse files
grievejiameta-codesync[bot]
authored andcommitted
Only call _handle_python_library on python library targets
Summary: Previously we were calling them on every kinds of targets other than those in a curated list. This can lead to hard-to-understand error message when adding new kinds to that curated list. Reviewed By: connernilsen Differential Revision: D88773197 fbshipit-source-id: b76af26e927812c92d4ac762e909f3f7f92cedab
1 parent 0849971 commit 9976f41

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

prelude/python/sourcedb/pyrefly.bxl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,10 @@ def _main(ctx: bxl.Context) -> None:
307307
_handle_alias(entry, attrs, x)
308308
elif x.rule_type == "prelude//rules.bzl:genrule":
309309
_handle_genrule(entry, attrs, fs, x, known_targets, to_remove, to_build, to_insert, genrule_to_insert)
310-
else:
310+
elif x.rule_type == "prelude//rules.bzl:python_library":
311311
_handle_python_library(entry, attrs, fs, x, known_targets, to_remove, to_build, to_insert)
312+
else:
313+
fail("Unknown rule type: {}".format(x.rule_type))
312314

313315
_build_generated_files(ctx, to_build, to_insert, genrule_to_insert)
314316

0 commit comments

Comments
 (0)