Skip to content

Commit

Permalink
Fix BXL breakage introduced by D65886198
Browse files Browse the repository at this point in the history
Summary:
User report: https://fb.workplace.com/groups/pyreqa/permalink/8875331349223285/

 firefire

Reviewed By: bajanduncan

Differential Revision: D65945058

fbshipit-source-id: 01064bd604e0aaa62eecc90324ffa7ec68b6b167
  • Loading branch information
grievejia authored and facebook-github-bot committed Nov 14, 2024
1 parent 171ffcf commit a67e462
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions python/typecheck/batch.bxl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def _check_targets_batched(ctx: bxl.Context, checked_targets: list[Label]) -> ty
for label, artifacts in output.items()
}

def filter_and_get_typecheck_subtargets(ctx: bxl.Context, targets: list[TargetLabel]) -> list[Label]:
def filter_and_get_typecheck_subtargets(ctx: bxl.Context, targets: list[TargetLabel] | bxl.UnconfiguredTargetSet) -> list[Label]:
configured_targets = ctx.analysis(
ctx.configured_targets(
do_filter(ctx.uquery(), targets, exclude_targets_with_special_labels = False),
Expand All @@ -30,7 +30,7 @@ def filter_and_get_typecheck_subtargets(ctx: bxl.Context, targets: list[TargetLa
if "typecheck" in target.providers()[DefaultInfo].sub_targets
]

def check_targets(ctx: bxl.Context, targets: list[TargetLabel]) -> None:
def check_targets(ctx: bxl.Context, targets: list[TargetLabel] | bxl.UnconfiguredTargetSet) -> None:
checked_targets = filter_and_get_typecheck_subtargets(ctx, targets)
artifacts = _check_targets_batched(ctx, checked_targets)

Expand Down
6 changes: 1 addition & 5 deletions python/typecheck/batch_files.bxl
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@ load(":batch.bxl", "check_targets")

def _run_entry_point(ctx: bxl.Context) -> None:
targets = ctx.uquery().owner(ctx.cli_args.source)
check_targets(ctx, targets, ctx.cli_args.enable_sharding)
check_targets(ctx, targets)

run = bxl_main(
doc = "Run [typecheck] on the owning targets of given files.",
impl = _run_entry_point,
cli_args = {
"enable-sharding": cli_args.bool(
default = False,
doc = "Shard type checking within each target",
),
"source": cli_args.list(
cli_args.string(
doc = "Files whose owning targets need to be checked",
Expand Down

0 comments on commit a67e462

Please sign in to comment.