in fluent/migrate/validator.py [0:0]
def call_transform(self, node, dotted):
module, called = dotted.rsplit(".", 1)
if module not in ("fluent.migrate", "fluent.migrate.transforms"):
return
transform = getattr(transforms, called)
if not issubclass(transform, transforms.Source):
return
bad_args = f"{called} takes path and key as first two params"
if not self.check_arguments(
node,
(
(ast.Constant, ast.Name),
(ast.Constant, ast.Name),
),
allow_more=True,
check_kwargs=False,
):
self.issues.append({"msg": bad_args, "line": node.lineno})
return
path = node.args[0]
if isinstance(path, ast.Constant):
path = path.value
if isinstance(path, ast.Name):
path = self.global_assigns.get(path.id)
if not isinstance(path, PATH_TYPES):
self.issues.append({"msg": bad_args, "line": node.lineno})