From 0153765afe719b1142d4b1747d665cf9b1430d3d Mon Sep 17 00:00:00 2001 From: "S.Lott" Date: Mon, 16 Feb 2026 18:07:48 -0500 Subject: [PATCH] Cleanup code to support new UV version And new ruff version, also. --- src/celpy/evaluation.py | 26 ++++++++++++++------------ src/xlate/c7n_to_cel.py | 2 +- type_check/lineprecision.txt | 2 +- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/celpy/evaluation.py b/src/celpy/evaluation.py index 528b67f..e311801 100644 --- a/src/celpy/evaluation.py +++ b/src/celpy/evaluation.py @@ -3440,16 +3440,18 @@ def member_dot_arg(self, tree: TranspilerTree) -> None: dict( n=lambda tree: str(tree.expr_number), macro=lambda tree: property_name_token.value, - member=lambda tree: cast( - TranspilerTree, tree.children[0] - ).transpiled, + member=lambda tree: ( + cast(TranspilerTree, tree.children[0]).transpiled + ), bind_variable=lambda tree: bind_variable, - expr=lambda tree: cast( - TranspilerTree, - cast(TranspilerTree, tree.children[2]).children[1], - ).transpiled - if len(tree.children) == 3 - else "", + expr=lambda tree: ( + cast( + TranspilerTree, + cast(TranspilerTree, tree.children[2]).children[1], + ).transpiled + if len(tree.children) == 3 + else "" + ), ), ) tree.transpiled = f"ex_{tree.expr_number}(activation)" @@ -3555,9 +3557,9 @@ def ident_arg(self, tree: TranspilerTree) -> None: template, dict( n=lambda tree: str(tree.expr_number), - exprlist=lambda tree: cast( - TranspilerTree, tree.children[1] - ).transpiled, + exprlist=lambda tree: ( + cast(TranspilerTree, tree.children[1]).transpiled + ), ), ) tree.transpiled = f"ex_{tree.expr_number}(activation)" diff --git a/src/xlate/c7n_to_cel.py b/src/xlate/c7n_to_cel.py index 6d2967b..8b4ddb9 100644 --- a/src/xlate/c7n_to_cel.py +++ b/src/xlate/c7n_to_cel.py @@ -227,7 +227,7 @@ def value_to_cel( if ( isinstance(value, str) and value in ("true", "false") - or isinstance(value, bool) # noqa: W503 + or isinstance(value, bool) ): # Boolean cases # Rewrite == true, != true, == false, and != false diff --git a/type_check/lineprecision.txt b/type_check/lineprecision.txt index ba685a2..c290602 100644 --- a/type_check/lineprecision.txt +++ b/type_check/lineprecision.txt @@ -6,7 +6,7 @@ celpy.adapter 163 34 3 9 111 6 celpy.c7nlib 1663 344 16 152 1151 0 celpy.celparser 411 137 68 23 183 0 celpy.celtypes 1497 394 15 238 812 38 -celpy.evaluation 3874 1136 251 243 2226 18 +celpy.evaluation 3876 1134 251 243 2230 18 gherkinize 1142 531 14 96 481 20 test_gherkinize 5581 5014 135 4 428 0 xlate 0 0 0 0 0 0