Skip to content

Commit

Permalink
Merge pull request #4 from AF-Warsame/copilot/fix-654cf5d4-11bd-4cbc-…
Browse files Browse the repository at this point in the history
…ae04-4c3ea0cd88c2

[WIP] I am having issues with the test, no cases and no coverage is happening
  • Loading branch information
AF-Warsame authored and GitHub committed Sep 27, 2025
2 parents 291c00f + 727ada6 commit e3ab7d0
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 6 deletions.
7 changes: 7 additions & 0 deletions src/acmecli.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,19 @@ src/acmecli/metrics/performance_claims_metric.py
src/acmecli/metrics/ramp_up_metric.py
src/acmecli/metrics/size_metric.py
tests/test_bus_factor_metric.py
tests/test_cache.py
tests/test_cli_integration.py
tests/test_cli_metric.py
tests/test_code_quality_metric.py
tests/test_dataset_and_code_metric.py
tests/test_dataset_quality_metric.py
tests/test_github_handler.py
tests/test_hf_downloads_metric.py
tests/test_hf_handler.py
tests/test_license_metric.py
tests/test_logging_env.py
tests/test_performance_claims_metric.py
tests/test_ramp_up_metric.py
tests/test_reporter.py
tests/test_scoring.py
tests/test_size_metric.py
Binary file modified src/acmecli/__pycache__/__init__.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__/reporter.cpython-312.pyc
Binary file not shown.
Binary file modified src/acmecli/__pycache__/types.cpython-312.pyc
Binary file not shown.
8 changes: 7 additions & 1 deletion src/acmecli/github_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,10 @@ def fetch_meta(self, url: str) -> Dict[str, Any]:
return {}
except Exception as e:
logging.error(f"Failed to fetch metadata for {url}: {e}")
return {}
return {}


def fetch_github_metadata(url: str) -> Dict[str, Any]:
"""Module-level function to fetch GitHub metadata."""
handler = GitHubHandler()
return handler.fetch_meta(url)
8 changes: 7 additions & 1 deletion src/acmecli/hf_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ def fetch_meta(self, url: str) -> dict:
return meta
except Exception as e:
logging.error(f"Failed to fetch metadata for {url}: {e}")
return {}
return {}


def fetch_hf_metadata(url: str) -> dict:
"""Module-level function to fetch HuggingFace metadata."""
handler = HFHandler()
return handler.fetch_meta(url)
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.
8 changes: 8 additions & 0 deletions src/acmecli/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@

def write_ndjson(row: ReportRow) -> None:
print(json.dumps(asdict(row), ensure_ascii=False))


class Reporter:
"""Simple reporter class for formatting data."""

def format(self, data: dict) -> str:
"""Format data as JSON string."""
return json.dumps(data, ensure_ascii=False)
9 changes: 8 additions & 1 deletion src/acmecli/scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,11 @@ def compute_net_score(results: dict):
net_score += metric_value * weight

latency_ms = int((time.perf_counter() - t0) * 1000)
return net_score, latency_ms
return net_score, latency_ms


def compute_netscore(scores, weights):
"""Simple wrapper function for testing - computes weighted sum of scores."""
if len(scores) != len(weights):
return 0.0
return sum(score * weight for score, weight in zip(scores, weights))
6 changes: 3 additions & 3 deletions tests/test_cache.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from acmecli.cache import SimpleCache
from acmecli.cache import InMemoryCache

def test_cache_set_get():
cache = SimpleCache()
cache = InMemoryCache()
cache.set("foo", "bar")
assert cache.get("foo") == "bar"

def test_cache_miss():
cache = SimpleCache()
cache = InMemoryCache()
assert cache.get("missing") is None

0 comments on commit e3ab7d0

Please sign in to comment.