auto flake and corrections

This commit is contained in:
2025-11-08 23:46:15 +01:00
parent 1ea870eef5
commit 781a9b6c08
81 changed files with 4646 additions and 3718 deletions
+11 -9
View File
@@ -12,19 +12,19 @@ import sys
def update_readme_badges():
"""Update README.md with coverage badges."""
readme_path = "README.md"
if not os.path.exists(readme_path):
print("README.md not found!")
return False
# Read current README
with open(readme_path, 'r') as f:
content = f.read()
# Coverage badges to add/update
test_coverage_badge = "![Test Coverage](./coverage.svg)"
docs_coverage_badge = "![Documentation Coverage](./coverage-docs.svg)"
# Check if badges already exist and update them, otherwise add them at the top
if "![Test Coverage]" in content:
content = re.sub(r'!\[Test Coverage\]\([^)]+\)', test_coverage_badge, content)
@@ -34,7 +34,7 @@ def update_readme_badges():
if len(lines) > 0:
lines.insert(1, f"\n{test_coverage_badge}")
content = '\n'.join(lines)
if "![Documentation Coverage]" in content:
content = re.sub(r'!\[Documentation Coverage\]\([^)]+\)', docs_coverage_badge, content)
else:
@@ -45,11 +45,11 @@ def update_readme_badges():
lines.insert(i + 1, docs_coverage_badge)
break
content = '\n'.join(lines)
# Write updated README
with open(readme_path, 'w') as f:
f.write(content)
print("README.md updated with coverage badges!")
return True
@@ -60,7 +60,7 @@ def show_coverage_summary():
with open("coverage-summary.txt", 'r') as f:
test_coverage = f.read().strip()
print(f"Current Test Coverage: {test_coverage}")
# Try to get documentation coverage from interrogate output
if os.path.exists("coverage.json"):
import json
@@ -68,7 +68,9 @@ def show_coverage_summary():
with open("coverage.json", 'r') as f:
coverage_data = json.load(f)
print(f"Detailed Coverage: {coverage_data['totals']['percent_covered']:.1f}%")
print(f"Lines Covered: {coverage_data['totals']['covered_lines']}/{coverage_data['totals']['num_statements']}")
covered = coverage_data['totals']['covered_lines']
total = coverage_data['totals']['num_statements']
print(f"Lines Covered: {covered}/{total}")
except (KeyError, json.JSONDecodeError):
print("Could not parse coverage data")