codecov-query 0.1.2

CLI tool to query the Codecov API v2 — coverage totals, commits, branches, PRs, comparisons, and more
# Contributing to codecov-query

Contributions of all kinds are welcome — bug reports, new features, documentation improvements, and code changes.

---

## Getting started

```sh
git clone https://github.com/mpecan/codecov-query
cd codecov-query
just setup   # enables git hooks for fmt/clippy checks on commit
cargo build
cargo test
```

> **Note:** [just]https://github.com/casey/just is the recommended task runner. Run `just` to see all available recipes. If you don't have it, the `just setup` step is equivalent to `git config core.hooksPath .githooks`.

The project requires Rust 1.93.0 or later. See `rust-toolchain.toml` for the pinned version.

---

## Project structure

| Path | Description |
|---|---|
| `src/main.rs` | CLI entry point, owner/repo resolution, subcommand dispatch |
| `src/cli.rs` | Clap derive structs, subcommands, and argument definitions |
| `src/client.rs` | `CodecovClient`: URL building, HTTP requests, response handling |
| `src/models.rs` | Serde response types (`Totals`, `Repo`, `Commit`, `Pull`, etc.) |
| `src/output.rs` | JSON and human-readable text formatters |
| `src/git.rs` | Auto-detect owner/repo from git remote origin |

---

## Commits

Use [Conventional Commits](https://www.conventionalcommits.org/):

```
<type>(<scope>): <description>
```

Types: `feat`, `fix`, `refactor`, `test`, `docs`, `chore`, `ci`, `perf`

Keep commits atomic — one logical change per commit.

---

## Code quality

Before opening a PR:

```sh
just check   # runs fmt --check, clippy, and tests
```

Or fix formatting and run checks in one go:

```sh
just fix-and-check
```

All three checks (fmt, clippy, tests) must pass clean. CI runs the same checks. The pre-commit hook also enforces fmt and clippy on every commit.

### Lint rules

The project enforces Clippy's `pedantic` and `nursery` lint groups as warnings (see `Cargo.toml`).

### Limits

- **Functions:** stay under 60 lines (Clippy enforces this)
- **Line width:** 100 characters (rustfmt enforces this)

---

## Pull requests

- Target the `main` branch
- Include tests for any changed behaviour
- Keep PRs focused — one feature or fix per PR
- Reference relevant issues in the PR description (`Closes: #N`)

---

## License

By contributing you agree that your changes will be licensed under the [MIT License](LICENSE).