Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 6, 2023
1 parent 4a809af commit e59d186
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
4 changes: 0 additions & 4 deletions aiida_upgrade/entry_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 0 additions & 2 deletions aiida_upgrade/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e59d186

Please sign in to comment.