Metadata-Version: 2.4
Name: sundgren
Version: 0.3.0
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Testing
License-File: LICENSE
Summary: CLI tool for measuring how code patches affect line coverage.
Keywords: coverage,lcov,patch,diff,testing,pytest,rust
Author: Axel E. Andersson
License-Expression: Apache-2.0
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://axean.github.io/sundgren/
Project-URL: Homepage, https://github.com/axean/sundgren
Project-URL: Issues, https://github.com/axean/sundgren/issues
Project-URL: Source, https://github.com/axean/sundgren

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/axean/sundgren/main/docs/_static/brand/sundgren-logo-dark.svg">
  <img alt="sundgren" src="https://raw.githubusercontent.com/axean/sundgren/main/docs/_static/brand/sundgren-logo.svg" width="420">
</picture>

[![CI](https://github.com/axean/sundgren/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/axean/sundgren/actions/workflows/ci.yml)
[![Coverage](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/axean/sundgren/badges/coverage.json)](https://github.com/axean/sundgren/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/sundgren)](https://pypi.org/project/sundgren/)
[![License](https://img.shields.io/pypi/l/sundgren)](https://github.com/axean/sundgren/blob/main/LICENSE)
[![Docs](https://img.shields.io/badge/docs-axean.github.io%2Fsundgren-blue)](https://axean.github.io/sundgren/)
[![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
[![ESLint](https://img.shields.io/badge/ESLint-checked-4B32C3.svg?logo=eslint&logoColor=white)](https://eslint.org)
[![Types: checked](https://img.shields.io/badge/types-checked-3178C6.svg?logo=typescript&logoColor=white)](https://www.typescriptlang.org)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)

sundgren is a coverage diff tool, written in Rust, for understanding large and complex codebases.
It runs your tests with coverage before and after a patch and reports the lines, branches,
functions and test outcomes that changed. It works with any coverage tool that writes lcov, has
presets for Python (pytest) and Rust (cargo-llvm-cov, cargo-tarpaulin), and comes as a
[VS Code extension](https://axean.github.io/sundgren/vscode.html) too.

*Sundgren* is Swedish for "sound branch", and my mother's family name.

## Install

```sh
uv tool install sundgren      # or: pipx install sundgren
```

Linux and macOS (x86_64 and arm64). The wheels hold a self-contained binary, so running it needs
no Python. Windows is not supported yet.

## Docs

- [Examples](https://axean.github.io/sundgren/): a Python and a Rust project, the command and
  the report.
- [How it works](https://axean.github.io/sundgren/how-it-works.html)
- [Reference](https://axean.github.io/sundgren/reference.html): every option, preset key, exit
  code and warning.
- [VS Code](https://axean.github.io/sundgren/vscode.html): the extension that plucks a test from
  the editor.
- [Changelog](https://github.com/axean/sundgren/blob/main/CHANGELOG.md)

## Development

One Rust crate (Rust 1.88+); Python is only the test harness and the docs build.

```sh
uv sync                       # dev env in .venv, with the binary built (pyright resolves imports here)
uv tool install pre-commit    # once per machine
pre-commit install            # once per clone: the lint hooks run on every commit, as in CI
cargo test
uv run pytest                 # e2e and docs tests, run the built binary
```

Install pre-commit as a tool, not with `uvx`: the git hook remembers the Python it was installed
with, and `uvx` runs from uv's cache, which can be cleaned.

To release, set the version in `pyproject.toml` and `Cargo.toml`, date its `CHANGELOG.md`
section, check with `uv run tools/release.py check vX.Y.Z`, and push the `vX.Y.Z` tag. The tag
publishes to PyPI and updates the docs site. Each pull request gets a docs preview at
`https://axean.github.io/sundgren/pr-preview/pr-<N>/` until it closes, and `main`, with changes
not released yet, is at `https://axean.github.io/sundgren/main/`.

## License

Apache-2.0. See [LICENSE](https://github.com/axean/sundgren/blob/main/LICENSE).

