Skip to content

Commit 449c36e

Browse files
authored
Cleanup code to support new UV version (#158)
And new ruff version, also, with some minor formatting changes relative to the previously-used version.
1 parent 42745b3 commit 449c36e

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

src/celpy/evaluation.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3440,16 +3440,18 @@ def member_dot_arg(self, tree: TranspilerTree) -> None:
34403440
dict(
34413441
n=lambda tree: str(tree.expr_number),
34423442
macro=lambda tree: property_name_token.value,
3443-
member=lambda tree: cast(
3444-
TranspilerTree, tree.children[0]
3445-
).transpiled,
3443+
member=lambda tree: (
3444+
cast(TranspilerTree, tree.children[0]).transpiled
3445+
),
34463446
bind_variable=lambda tree: bind_variable,
3447-
expr=lambda tree: cast(
3448-
TranspilerTree,
3449-
cast(TranspilerTree, tree.children[2]).children[1],
3450-
).transpiled
3451-
if len(tree.children) == 3
3452-
else "",
3447+
expr=lambda tree: (
3448+
cast(
3449+
TranspilerTree,
3450+
cast(TranspilerTree, tree.children[2]).children[1],
3451+
).transpiled
3452+
if len(tree.children) == 3
3453+
else ""
3454+
),
34533455
),
34543456
)
34553457
tree.transpiled = f"ex_{tree.expr_number}(activation)"
@@ -3555,9 +3557,9 @@ def ident_arg(self, tree: TranspilerTree) -> None:
35553557
template,
35563558
dict(
35573559
n=lambda tree: str(tree.expr_number),
3558-
exprlist=lambda tree: cast(
3559-
TranspilerTree, tree.children[1]
3560-
).transpiled,
3560+
exprlist=lambda tree: (
3561+
cast(TranspilerTree, tree.children[1]).transpiled
3562+
),
35613563
),
35623564
)
35633565
tree.transpiled = f"ex_{tree.expr_number}(activation)"

src/xlate/c7n_to_cel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def value_to_cel(
227227
if (
228228
isinstance(value, str)
229229
and value in ("true", "false")
230-
or isinstance(value, bool) # noqa: W503
230+
or isinstance(value, bool)
231231
):
232232
# Boolean cases
233233
# Rewrite == true, != true, == false, and != false

type_check/lineprecision.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ celpy.adapter 163 34 3 9 111 6
66
celpy.c7nlib 1663 344 16 152 1151 0
77
celpy.celparser 411 137 68 23 183 0
88
celpy.celtypes 1497 394 15 238 812 38
9-
celpy.evaluation 3874 1136 251 243 2226 18
9+
celpy.evaluation 3876 1134 251 243 2230 18
1010
gherkinize 1142 531 14 96 481 20
1111
test_gherkinize 5581 5014 135 4 428 0
1212
xlate 0 0 0 0 0 0

0 commit comments

Comments
 (0)