-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add unit test and metric generator #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,346 @@ | ||||||
| #!/usr/bin/env python3 | ||||||
| """ | ||||||
| Generate repository metrics report. | ||||||
|
|
||||||
| Calculates: | ||||||
| - Total File Count (source files) | ||||||
| - Lines of Code (LOC) | ||||||
| - Number of Unit Tests | ||||||
| - Code Coverage Percentage | ||||||
|
|
||||||
| Usage: | ||||||
| python generate_metrics.py [--run-tests] [--output FORMAT] | ||||||
|
|
||||||
| Options: | ||||||
| --run-tests Run pytest to get actual coverage (requires pytest-cov) | ||||||
| --output Output format: text, json, or markdown (default: text) | ||||||
| """ | ||||||
| import argparse | ||||||
| import json | ||||||
| import os | ||||||
| import re | ||||||
| import subprocess | ||||||
| import sys | ||||||
| from pathlib import Path | ||||||
| from typing import Dict, List, Tuple | ||||||
|
|
||||||
|
|
||||||
| # File extensions to count as source files | ||||||
| SOURCE_EXTENSIONS = {'.py', '.yaml', '.yml', '.sh', '.js', 'Dockerfile'} | ||||||
|
||||||
| SOURCE_EXTENSIONS = {'.py', '.yaml', '.yml', '.sh', '.js', 'Dockerfile'} | |
| SOURCE_EXTENSIONS = {'.py', '.yaml', '.yml', '.sh', '.js'} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| [pytest] | ||
| pythonpath = src | ||
| pythonpath = . fastapi_app cli scraper | ||
| asyncio_mode = auto |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # FixMyCodeDB Test Suite |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # CLI Module Tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'os' is not used.