covisible 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. covisible-0.1.0/.gitignore +85 -0
  2. covisible-0.1.0/LICENSE +21 -0
  3. covisible-0.1.0/PKG-INFO +154 -0
  4. covisible-0.1.0/README.md +123 -0
  5. covisible-0.1.0/pyproject.toml +81 -0
  6. covisible-0.1.0/src/covisible/__init__.py +3 -0
  7. covisible-0.1.0/src/covisible/analysis/__init__.py +17 -0
  8. covisible-0.1.0/src/covisible/analysis/blame.py +232 -0
  9. covisible-0.1.0/src/covisible/analysis/diff.py +229 -0
  10. covisible-0.1.0/src/covisible/analysis/grouping.py +218 -0
  11. covisible-0.1.0/src/covisible/analysis/history.py +130 -0
  12. covisible-0.1.0/src/covisible/analysis/pr_coverage.py +239 -0
  13. covisible-0.1.0/src/covisible/analysis/treemap.py +190 -0
  14. covisible-0.1.0/src/covisible/assets/css/style.css +2890 -0
  15. covisible-0.1.0/src/covisible/assets/favicon.svg +12 -0
  16. covisible-0.1.0/src/covisible/assets/js/app.js +203 -0
  17. covisible-0.1.0/src/covisible/assets/logo.png +0 -0
  18. covisible-0.1.0/src/covisible/cli.py +622 -0
  19. covisible-0.1.0/src/covisible/core/__init__.py +17 -0
  20. covisible-0.1.0/src/covisible/core/ignore.py +240 -0
  21. covisible-0.1.0/src/covisible/core/models.py +226 -0
  22. covisible-0.1.0/src/covisible/parsers/__init__.py +6 -0
  23. covisible-0.1.0/src/covisible/parsers/gcov_json.py +124 -0
  24. covisible-0.1.0/src/covisible/parsers/lcov.py +149 -0
  25. covisible-0.1.0/src/covisible/report/__init__.py +5 -0
  26. covisible-0.1.0/src/covisible/report/generator.py +1002 -0
  27. covisible-0.1.0/src/covisible/report/markdown.py +72 -0
  28. covisible-0.1.0/src/covisible/report/templates/base.html +48 -0
  29. covisible-0.1.0/src/covisible/report/templates/components/authors.html +24 -0
  30. covisible-0.1.0/src/covisible/report/templates/components/sunburst.html +452 -0
  31. covisible-0.1.0/src/covisible/report/templates/components/treemap.html +97 -0
  32. covisible-0.1.0/src/covisible/report/templates/components/trend.html +170 -0
  33. covisible-0.1.0/src/covisible/report/templates/directory.html +137 -0
  34. covisible-0.1.0/src/covisible/report/templates/file.html +370 -0
  35. covisible-0.1.0/src/covisible/report/templates/index.html +846 -0
  36. covisible-0.1.0/src/covisible/utils/__init__.py +5 -0
  37. covisible-0.1.0/src/covisible/utils/demangle.py +112 -0
  38. covisible-0.1.0/tests/__init__.py +1 -0
  39. covisible-0.1.0/tests/test_cli.py +56 -0
  40. covisible-0.1.0/tests/test_diff.py +97 -0
  41. covisible-0.1.0/tests/test_grouping.py +252 -0
  42. covisible-0.1.0/tests/test_ignore.py +130 -0
  43. covisible-0.1.0/tests/test_parsers.py +147 -0
  44. covisible-0.1.0/tests/test_pr_coverage.py +115 -0
  45. covisible-0.1.0/tests/test_report_links.py +253 -0
@@ -0,0 +1,85 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+
27
+ # PyInstaller
28
+ *.manifest
29
+ *.spec
30
+
31
+ # Installer logs
32
+ pip-log.txt
33
+ pip-delete-this-directory.txt
34
+
35
+ # Unit test / coverage reports
36
+ htmlcov/
37
+ .tox/
38
+ .nox/
39
+ .coverage
40
+ .coverage.*
41
+ .cache
42
+ nosetests.xml
43
+ coverage.xml
44
+ *.cover
45
+ *.py,cover
46
+ .hypothesis/
47
+ .pytest_cache/
48
+
49
+ # Translations
50
+ *.mo
51
+ *.pot
52
+
53
+ # Environments
54
+ .env
55
+ .venv
56
+ env/
57
+ venv/
58
+ ENV/
59
+ env.bak/
60
+ venv.bak/
61
+
62
+ # IDE
63
+ .idea/
64
+ .vscode/
65
+ *.swp
66
+ *.swo
67
+ *~
68
+
69
+ # mypy
70
+ .mypy_cache/
71
+ .dmypy.json
72
+ dmypy.json
73
+
74
+ # ruff
75
+ .ruff_cache/
76
+
77
+ # Output
78
+ coverage-report/
79
+ *.json
80
+ !pyproject.toml
81
+
82
+ # Coverage input artifacts (test data, not source)
83
+ *.lcov
84
+ *.info
85
+ baseline/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 LaGrunge
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,154 @@
1
+ Metadata-Version: 2.4
2
+ Name: covisible
3
+ Version: 0.1.0
4
+ Summary: PR-first code coverage report generator with modern UI
5
+ Project-URL: Homepage, https://github.com/LaGrunge/covisible
6
+ Project-URL: Repository, https://github.com/LaGrunge/covisible
7
+ Author-email: LaGrunge <leontodys@gmail.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: code-quality,coverage,diff,gcov,testing
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Software Development :: Quality Assurance
19
+ Classifier: Topic :: Software Development :: Testing
20
+ Requires-Python: >=3.12
21
+ Requires-Dist: click>=8.1
22
+ Requires-Dist: jinja2>=3.1
23
+ Requires-Dist: pydantic>=2.0
24
+ Requires-Dist: rich>=13.0
25
+ Provides-Extra: dev
26
+ Requires-Dist: mypy>=1.10; extra == 'dev'
27
+ Requires-Dist: pytest-cov>=4.0; extra == 'dev'
28
+ Requires-Dist: pytest>=8.0; extra == 'dev'
29
+ Requires-Dist: ruff>=0.4; extra == 'dev'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # Covisible
33
+
34
+ **PR-first code coverage report generator with modern UI**
35
+
36
+ Covisible generates beautiful, interactive coverage reports focused on what matters: **your PR changes**.
37
+
38
+ ## Features
39
+
40
+ - **PR-first view** — Shows coverage for new/modified lines, not the entire repo
41
+ - **Diff-based analysis** — Integrates with git diff to highlight what changed
42
+ - **Modern UI** — Dark/light theme, interactive charts, instant search
43
+ - **Smart summary** — "−1.3% coverage, 3 new uncovered lines" instead of "83.42%"
44
+ - **1-click drill-down** — PR → file → function → line
45
+ - **Baseline comparison** — Compare current coverage with previous runs
46
+
47
+ ## Installation
48
+
49
+ ```bash
50
+ pip install covisible
51
+ ```
52
+
53
+ Or install from source:
54
+
55
+ ```bash
56
+ git clone https://github.com/LaGrunge/covisible
57
+ cd covisible
58
+ pip install -e ".[dev]"
59
+ ```
60
+
61
+ ## Usage
62
+
63
+ Covisible is a command group. The main command is `report`; `diff`, `files`,
64
+ and `summary` are console-only helpers. Coverage input is auto-detected: `.json`
65
+ (and `*.gcov.json`) is parsed as gcov JSON, everything else as LCOV `.info`.
66
+
67
+ ### Generate a report (PR coverage)
68
+
69
+ ```bash
70
+ covisible report \
71
+ --current coverage.info \
72
+ --baseline baseline.info \
73
+ --git-diff HEAD~1..HEAD \
74
+ --output report/ \
75
+ --format both
76
+ ```
77
+
78
+ Without `--git-diff`/`--diff-file` you get a whole-project report; with one of
79
+ them the report focuses on new/modified lines.
80
+
81
+ ### Generate gcov JSON coverage
82
+
83
+ ```bash
84
+ # After running tests with coverage enabled
85
+ find . -name "*.gcno" -exec gcov --json-format {} \;
86
+ # Or use gcov on specific files
87
+ gcov --json-format --stdout myfile.cpp > coverage.json
88
+ ```
89
+
90
+ ### `report` options
91
+
92
+ | Option | Description |
93
+ |--------|-------------|
94
+ | `-c, --current` | Current coverage file (gcov JSON or lcov.info) — **required** |
95
+ | `-b, --baseline` | Baseline coverage for comparison (optional) |
96
+ | `--git-diff` | Git diff range (e.g., `main..HEAD`) |
97
+ | `--diff-file` | Path to unified diff file |
98
+ | `-o, --output` | Output directory for HTML report (default: `coverage-report/`) |
99
+ | `--format` | Output format: `html`, `json`, or `both` (default: `html`) |
100
+ | `--repo` | Path to git repository (for `--git-diff` / title) |
101
+ | `--title` | Report title (default: `Covisible: <project>`) |
102
+ | `--blame / --no-blame` | Include git blame analysis for uncovered code |
103
+ | `--exclude GLOB` | Glob of files to exclude (repeatable, e.g. `--exclude '*_test.cpp'`) |
104
+ | `--ignore-config` | Path to an ignore config (YAML/JSON) with `exclude`/`include`/`line_markers` |
105
+
106
+ ### Other commands
107
+
108
+ ```bash
109
+ # CodeCov-style coverage diff (console), optional markdown brief for CI comments
110
+ covisible diff coverage_new.info -b coverage_old.info --markdown brief.md
111
+
112
+ # List files by coverage
113
+ covisible files coverage.info --sort uncovered --limit 20
114
+
115
+ # One-file summary
116
+ covisible summary coverage.info
117
+ ```
118
+
119
+ ### Excluding files and lines
120
+
121
+ Pass `--exclude` one or more times, or point `--ignore-config` at a YAML/JSON
122
+ file:
123
+
124
+ ```yaml
125
+ # covisible-ignore.yaml
126
+ ignore:
127
+ exclude:
128
+ - "*_test.cpp"
129
+ - "third_party/*"
130
+ line_markers:
131
+ - "// LCOV_EXCL_LINE"
132
+ - "# pragma: no cover"
133
+ ```
134
+
135
+ Excluded files are dropped from the report; lines matched by a marker (or a
136
+ `LCOV_EXCL_START`/`STOP` block) are removed from their file's coverage.
137
+
138
+ ## Development
139
+
140
+ ```bash
141
+ # Install dev dependencies
142
+ pip install -e ".[dev]"
143
+
144
+ # Run tests
145
+ pytest
146
+
147
+ # Lint
148
+ ruff check src tests
149
+ mypy src
150
+ ```
151
+
152
+ ## License
153
+
154
+ MIT
@@ -0,0 +1,123 @@
1
+ # Covisible
2
+
3
+ **PR-first code coverage report generator with modern UI**
4
+
5
+ Covisible generates beautiful, interactive coverage reports focused on what matters: **your PR changes**.
6
+
7
+ ## Features
8
+
9
+ - **PR-first view** — Shows coverage for new/modified lines, not the entire repo
10
+ - **Diff-based analysis** — Integrates with git diff to highlight what changed
11
+ - **Modern UI** — Dark/light theme, interactive charts, instant search
12
+ - **Smart summary** — "−1.3% coverage, 3 new uncovered lines" instead of "83.42%"
13
+ - **1-click drill-down** — PR → file → function → line
14
+ - **Baseline comparison** — Compare current coverage with previous runs
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ pip install covisible
20
+ ```
21
+
22
+ Or install from source:
23
+
24
+ ```bash
25
+ git clone https://github.com/LaGrunge/covisible
26
+ cd covisible
27
+ pip install -e ".[dev]"
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ Covisible is a command group. The main command is `report`; `diff`, `files`,
33
+ and `summary` are console-only helpers. Coverage input is auto-detected: `.json`
34
+ (and `*.gcov.json`) is parsed as gcov JSON, everything else as LCOV `.info`.
35
+
36
+ ### Generate a report (PR coverage)
37
+
38
+ ```bash
39
+ covisible report \
40
+ --current coverage.info \
41
+ --baseline baseline.info \
42
+ --git-diff HEAD~1..HEAD \
43
+ --output report/ \
44
+ --format both
45
+ ```
46
+
47
+ Without `--git-diff`/`--diff-file` you get a whole-project report; with one of
48
+ them the report focuses on new/modified lines.
49
+
50
+ ### Generate gcov JSON coverage
51
+
52
+ ```bash
53
+ # After running tests with coverage enabled
54
+ find . -name "*.gcno" -exec gcov --json-format {} \;
55
+ # Or use gcov on specific files
56
+ gcov --json-format --stdout myfile.cpp > coverage.json
57
+ ```
58
+
59
+ ### `report` options
60
+
61
+ | Option | Description |
62
+ |--------|-------------|
63
+ | `-c, --current` | Current coverage file (gcov JSON or lcov.info) — **required** |
64
+ | `-b, --baseline` | Baseline coverage for comparison (optional) |
65
+ | `--git-diff` | Git diff range (e.g., `main..HEAD`) |
66
+ | `--diff-file` | Path to unified diff file |
67
+ | `-o, --output` | Output directory for HTML report (default: `coverage-report/`) |
68
+ | `--format` | Output format: `html`, `json`, or `both` (default: `html`) |
69
+ | `--repo` | Path to git repository (for `--git-diff` / title) |
70
+ | `--title` | Report title (default: `Covisible: <project>`) |
71
+ | `--blame / --no-blame` | Include git blame analysis for uncovered code |
72
+ | `--exclude GLOB` | Glob of files to exclude (repeatable, e.g. `--exclude '*_test.cpp'`) |
73
+ | `--ignore-config` | Path to an ignore config (YAML/JSON) with `exclude`/`include`/`line_markers` |
74
+
75
+ ### Other commands
76
+
77
+ ```bash
78
+ # CodeCov-style coverage diff (console), optional markdown brief for CI comments
79
+ covisible diff coverage_new.info -b coverage_old.info --markdown brief.md
80
+
81
+ # List files by coverage
82
+ covisible files coverage.info --sort uncovered --limit 20
83
+
84
+ # One-file summary
85
+ covisible summary coverage.info
86
+ ```
87
+
88
+ ### Excluding files and lines
89
+
90
+ Pass `--exclude` one or more times, or point `--ignore-config` at a YAML/JSON
91
+ file:
92
+
93
+ ```yaml
94
+ # covisible-ignore.yaml
95
+ ignore:
96
+ exclude:
97
+ - "*_test.cpp"
98
+ - "third_party/*"
99
+ line_markers:
100
+ - "// LCOV_EXCL_LINE"
101
+ - "# pragma: no cover"
102
+ ```
103
+
104
+ Excluded files are dropped from the report; lines matched by a marker (or a
105
+ `LCOV_EXCL_START`/`STOP` block) are removed from their file's coverage.
106
+
107
+ ## Development
108
+
109
+ ```bash
110
+ # Install dev dependencies
111
+ pip install -e ".[dev]"
112
+
113
+ # Run tests
114
+ pytest
115
+
116
+ # Lint
117
+ ruff check src tests
118
+ mypy src
119
+ ```
120
+
121
+ ## License
122
+
123
+ MIT
@@ -0,0 +1,81 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "covisible"
7
+ dynamic = ["version"]
8
+ description = "PR-first code coverage report generator with modern UI"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ requires-python = ">=3.12"
13
+ authors = [
14
+ { name = "LaGrunge", email = "leontodys@gmail.com" }
15
+ ]
16
+ keywords = ["coverage", "gcov", "testing", "code-quality", "diff"]
17
+ classifiers = [
18
+ "Development Status :: 3 - Alpha",
19
+ "Environment :: Console",
20
+ "Intended Audience :: Developers",
21
+ "License :: OSI Approved :: MIT License",
22
+ "Programming Language :: Python :: 3",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Programming Language :: Python :: 3.13",
25
+ "Topic :: Software Development :: Testing",
26
+ "Topic :: Software Development :: Quality Assurance",
27
+ ]
28
+ dependencies = [
29
+ "click>=8.1",
30
+ "jinja2>=3.1",
31
+ "pydantic>=2.0",
32
+ "rich>=13.0",
33
+ ]
34
+
35
+ [project.optional-dependencies]
36
+ dev = [
37
+ "pytest>=8.0",
38
+ "pytest-cov>=4.0",
39
+ "ruff>=0.4",
40
+ "mypy>=1.10",
41
+ ]
42
+
43
+ [project.scripts]
44
+ covisible = "covisible.cli:main"
45
+
46
+ [project.urls]
47
+ Homepage = "https://github.com/LaGrunge/covisible"
48
+ Repository = "https://github.com/LaGrunge/covisible"
49
+
50
+ [tool.hatch.version]
51
+ path = "src/covisible/__init__.py"
52
+
53
+ [tool.hatch.build.targets.wheel]
54
+ packages = ["src/covisible"]
55
+
56
+ [tool.hatch.build.targets.sdist]
57
+ include = [
58
+ "src/covisible",
59
+ "tests",
60
+ "README.md",
61
+ "LICENSE",
62
+ "pyproject.toml",
63
+ ]
64
+
65
+ [tool.ruff]
66
+ target-version = "py312"
67
+ line-length = 100
68
+ src = ["src", "tests"]
69
+
70
+ [tool.ruff.lint]
71
+ select = ["E", "F", "W", "I", "UP", "B", "C4", "SIM"]
72
+
73
+ [tool.mypy]
74
+ python_version = "3.12"
75
+ strict = true
76
+ warn_return_any = true
77
+ warn_unused_configs = true
78
+
79
+ [tool.pytest.ini_options]
80
+ testpaths = ["tests"]
81
+ addopts = "-v --tb=short"
@@ -0,0 +1,3 @@
1
+ """Covisible — PR-first code coverage report generator."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,17 @@
1
+ """Coverage analysis tools."""
2
+
3
+ from covisible.analysis.blame import GitBlameAnalyzer, get_uncovered_blame_summary
4
+ from covisible.analysis.diff import DiffAnalyzer, DiffHunk, FileDiff
5
+ from covisible.analysis.pr_coverage import PRCoverageAnalyzer
6
+ from covisible.analysis.treemap import TreemapBuilder, build_treemap_data
7
+
8
+ __all__ = [
9
+ "DiffAnalyzer",
10
+ "DiffHunk",
11
+ "FileDiff",
12
+ "GitBlameAnalyzer",
13
+ "PRCoverageAnalyzer",
14
+ "TreemapBuilder",
15
+ "build_treemap_data",
16
+ "get_uncovered_blame_summary",
17
+ ]