Skip to content

Commit

Permalink
v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Warsame committed Sep 27, 2025
1 parent 18b1746 commit 1144250
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 7 deletions.
Binary file modified __pycache__/run.cpython-312.pyc
Binary file not shown.
Binary file modified src/acmecli/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file modified src/acmecli/__pycache__/cli.cpython-312.pyc
Binary file not shown.
Binary file modified src/acmecli/__pycache__/hf_handler.cpython-312.pyc
Binary file not shown.
Binary file modified src/acmecli/__pycache__/types.cpython-312.pyc
Binary file not shown.
Binary file modified src/acmecli/metrics/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file modified src/acmecli/metrics/__pycache__/base.cpython-312.pyc
Binary file not shown.
Binary file modified src/acmecli/metrics/__pycache__/license_metric.cpython-312.pyc
Binary file not shown.
16 changes: 12 additions & 4 deletions src/acmecli/metrics/code_quality_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from ..types import MetricValue
from .base import register


class CodeQualityMetric:
"""Metric to assess code style, maintainability, and engineering practices."""
name = "code_quality"
Expand All @@ -13,7 +12,12 @@ def score(self, meta: dict) -> MetricValue:
# Heuristics for code quality assessment
score = 0.0

readme_text = meta.get('readme_text', '').lower()
readme_text = meta.get('readme_text')
if readme_text is not None:
readme_text = str(readme_text).lower()
else:
readme_text = ""

if readme_text:
# Look for testing mentions
testing_keywords = ['test', 'testing', 'pytest', 'unittest', 'coverage', 'ci', 'continuous integration']
Expand Down Expand Up @@ -41,7 +45,12 @@ def score(self, meta: dict) -> MetricValue:
score += 0.1

# Check for popular programming language (better tooling/community)
language = meta.get('language', '').lower()
language = meta.get('language')
if language is not None:
language = str(language).lower()
else:
language = ""

popular_languages = ['python', 'javascript', 'java', 'c++', 'typescript', 'go', 'rust']
if language in popular_languages:
score += 0.1
Expand Down Expand Up @@ -74,5 +83,4 @@ def score(self, meta: dict) -> MetricValue:
latency_ms = int((time.perf_counter() - t0) * 1000)
return MetricValue(self.name, value, latency_ms)


register(CodeQualityMetric())
1 change: 0 additions & 1 deletion test_url.txt

This file was deleted.

12 changes: 10 additions & 2 deletions urls.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
https://github.com/octocat/Hello-World
https://huggingface.co/google/gemma-3-270m
https://github.com/pallets/flask
https://github.com/tiangolo/fastapi
https://github.com/huggingface/transformers
https://github.com/psf/requests
https://huggingface.co/gpt2
https://huggingface.co/facebook/bart-large
https://huggingface.co/google/vit-base-patch16-224
https://github.com/numpy/numpy
https://github.com/scikit-learn/scikit-learn
https://github.com/pytorch/pytorch

0 comments on commit 1144250

Please sign in to comment.