8000 Metrics do not accept `ast` in test_config.py · Issue #829 · cqfn/aibolit · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Metrics do not accept ast in test_config.py #829
Open
@0pdd

Description

@0pdd

The puzzle 813-c4089b79 from #813 has to be resolved:

TODO #813:30min/DEV Ensure All Metrics Accept `ast: AST` Parameter with Type Hints
Verify that all metrics in the config accept an AST parameter with proper type hints.
Probable solutions:
1. Every metric factory in patterns_config["metrics"] produces a metric with:
- A parameter named "ast" in its call signature
- The "ast" parameter properly annotated as `aibolit.ast_framework.ast.AST` or a subclass
2. Remove any metrics that cannot comply with this interface.
Once all metrics meet requirements, remove the decorator.
'''
patterns_config = Config.get_patterns_config()
for metric_config in patterns_config['metrics']:
metric = metric_config['make']()
metric_signature = inspect.signature(metric.value)
assert 'ast' in metric_signature.parameters
assert metric_signature.parameters['ast'].annotation is AST

The puzzle was created by @AntonProkopyev on 14-Jun-25.

Estimate: 30 minutes, role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood-titleThe title was checked by ChatGPTpdd

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0