From ba8404c199dad309ed1b0680d50151005f15c387 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 7 Feb 2023 05:58:36 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- aiida_upgrade/entry_points.py | 4 ---- aiida_upgrade/methods.py | 2 -- 2 files changed, 6 deletions(-) diff --git a/aiida_upgrade/entry_points.py b/aiida_upgrade/entry_points.py index 3967207..8410979 100644 --- a/aiida_upgrade/entry_points.py +++ b/aiida_upgrade/entry_points.py @@ -77,12 +77,10 @@ class FactoryCoreTransformer(cst.CSTTransformer): """Transformer that adds the ``core.`` prefix to deprecated aiida-core v1 entry points.""" def leave_Call(self, original_node: cst.Call, updated_node: cst.Call) -> cst.Call: - try: function = original_node.func.value if function in FACTORY_MAPPING.keys(): - entry_point = original_node.args[0].value.value string_quote = entry_point[0] entry_point = entry_point.strip(string_quote) @@ -112,12 +110,10 @@ class FullEntryPointTransformer(cst.CSTTransformer): def leave_SimpleString( self, original_node: cst.SimpleString, updated_node: cst.SimpleString ) -> cst.SimpleString: - if "aiida." not in original_node.value: return original_node for entry_group, entry_points in DEPRECATED_ENTRY_POINTS_MAPPING.items(): - option_string = "|".join(entry_points) match = re.match( diff --git a/aiida_upgrade/methods.py b/aiida_upgrade/methods.py index 5f4b1c1..773810d 100644 --- a/aiida_upgrade/methods.py +++ b/aiida_upgrade/methods.py @@ -22,11 +22,9 @@ class DictListNoKeywordTransformer(cst.CSTTransformer): list_keyword = matchers.Name("list") def leave_Call(self, original_node: cst.Call, updated_node: cst.Call) -> cst.Call: - if matchers.matches( original_node.func, self.dict_constructor | self.list_constructor ): - # Empty `Dict` or `List` constructor if len(original_node.args) == 0: return original_node