-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.coveragerc
More file actions
89 lines (79 loc) · 3.25 KB
/
.coveragerc
File metadata and controls
89 lines (79 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# .coveragerc — StoryForge coverage configuration
# Mirrors pyproject.toml [tool.coverage.*] for tools that only read .coveragerc
# Q1: Code Coverage Reporting
#
# Coverage tiers
# ──────────────
# Critical modules (auth, credits, export, middleware): minimum 80 %
# All other modules: minimum 60 %
# Global hard floor (fail_under): 60 %
#
# To enforce per-module thresholds use pytest-cov with --cov-fail-under
# or add per-path assertions in your CI script, e.g.:
#
# coverage report --include="api/auth*" --fail-under=80
# coverage report --include="services/credit*" --fail-under=80
# coverage report --include="pipeline/export*" --fail-under=80
# coverage report --include="middleware/*" --fail-under=80
[run]
# Source directories to instrument
source =
pipeline
services
api
middleware
errors
models
# Enable branch coverage (catches partial if/else)
branch = True
# Omit test helpers, cache artefacts, and build scripts
omit =
tests/*
scripts/*
*/__pycache__/*
*.pyc
setup.py
conftest.py
[report]
# Coverage floor — enforced in CI at 60%
fail_under = 60
# Print lines that have no coverage next to each file
show_missing = True
# Do not skip fully-covered files — keep them visible
skip_covered = False
# Lines/decorators that are intentionally excluded from coverage counts
exclude_lines =
pragma: no cover
def __repr__
if TYPE_CHECKING:
raise NotImplementedError
if __name__ == .__main__.:
pass
@(abc\.)?abstractmethod
# ── Per-module minimum coverage targets ──────────────────────────────────────
# Per-module gates enforced in CI — see .github/workflows/ci.yml
# "Enforce per-module coverage" step in the unit-tests job.
# Ratchet approach: currently warn-only (|| echo WARNING) until overall
# coverage reaches targets, then gates will be converted to hard failures.
#
# Module Min Rationale
# ────────────────────────────── ──── ────────────────────────────────────────
# services/llm/* 80% Core LLM provider logic: reliability critical
# pipeline/* 75% Story generation pipeline: correctness critical
# api/* 70% API endpoints: integration coverage floor
#
# Legacy informational targets (not yet enforced in CI):
# api/auth* 80% Security-critical: token validation, login
# api/credits* 80% Business-critical: credit deduction logic
# services/credit* 80% Business-critical: credit management service
# pipeline/export* 80% User-facing: EPUB/PDF export correctness
# middleware/* 80% Request lifecycle: auth checks, rate limits
#
# All other modules 60% General quality floor
[html]
# Output directory for the HTML report
directory = htmlcov
title = StoryForge Coverage Report
[xml]
# Path for the Cobertura-format XML report (used by CI/codecov)
output = coverage.xml