Skip to content

Commit

Permalink
Remove is_buck2() calls from antlir/bzl/flatten.bzl
Browse files Browse the repository at this point in the history
Summary:
buck1 is declared dead, is_buck2() checks will always return true. We can statically eliminate
these calls and associated conditional checks. antlir/bzl/flatten.bzl was codemodded with libcst.

Test Plan: Sandcastle

Reviewed By: dtolnay

Differential Revision: D63295334

fbshipit-source-id: 6b811b52458af552130101afc3fb7045df3e9b94
  • Loading branch information
Andrew Krieger authored and facebook-github-bot committed Sep 24, 2024
1 parent 4c916ea commit fa2c1d8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions antlir/bzl/flatten.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# This does incorrect modifications.
# @lint-ignore-every FBCODEBZLADDLOADS

load("//antlir/bzl:build_defs.bzl", "is_buck2")
load("//antlir/bzl:types.bzl", "types")

def _flatten_any(lst):
Expand All @@ -23,12 +22,11 @@ def _typed_flattener(item_type) -> types.function:
types.lint_noop(item_type)

# @lint-ignore BUCKLINT
t = native.eval_type(list[item_type]) if is_buck2() else ""
t = native.eval_type(list[item_type])

def _flatten(lst):
r = _flatten_any(lst)
if is_buck2():
t.check_matches(r)
t.check_matches(r)
return r

return _flatten
Expand Down

0 comments on commit fa2c1d8

Please sign in to comment.