Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move to cargo workspace + small readme edits #27

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 4 additions & 26 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,8 @@
[package]
name = "codecov-rs"
version = "0.1.0"
edition = "2021"
[workspace]

[features]
default = ["pyreport"]
pyreport = []
resolver = "2"
members = ["core"]

[profile.release]
debug = 1

[dependencies]
include_dir = "0.7.3"
memmap2 = "0.9.4"
rand = "0.8.5"
rusqlite = { version = "0.31.0", features = ["bundled", "limits"] }
rusqlite_migration = { version = "1.2.0", features = ["from-directory"] }
seahash = "4.1.0"
serde_json = "1.0.117"
thiserror = "1.0.59"
winnow = "0.5.34"

[dev-dependencies]
divan = "0.1.14"
tempfile = "3.9.0"

[[bench]]
name = "pyreport"
harness = false
debug = 1
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,26 @@ All details (e.g. SQLite schema, code interfaces) subject to breaking changes un

## Developing

At time of writing, `codecov-rs` requires the nightly compiler for niceties such as `#[feature(trait_alias)]` in the library itself and some convenient `mockall` behavior in tests.
At time of writing, `codecov-rs` requires the nightly compiler for niceties such as `#[feature(trait_alias)]` in the library itself.

`codecov-rs` aims to serve as effective documentation for every flavor of every format it supports. To that end, the following are greatly appreciated in submissions:
- Thorough doc comments (`///` / `/**`). For parsers, include snippets that show what inputs look like
- Granular, in-module unit tests (`mockall` may help)
- Granular, in-module unit tests
- Integration tests with real-world samples (that are safe to distribute; don't send us data from your private repo)

Large sample test reports are checked in using [Git LFS](https://git-lfs.com/) in `core/fixtures/**/large` directories (e.g. `core/fixtures/pyreport/large`). Tests and benchmarks may reference them so installing it yourself is recommended.

The `examples/` directory contains runnable commands for developers including:
- `parse_pyreport`: converts a given pyreport into a SQLite report
- `sql_to_pyreport`: converts a given SQLite report into a pyreport (report JSON + chunks file)

Considering following suit for your own new feature.
You can run an example with `cargo run --example <example> <arguments>`. Consider following suit for your own new feature.

Install lint hooks with `pip install pre-commit && pre-commit install`.

Large sample test reports are checked in using [Git LFS](https://git-lfs.com/). Tests and benchmarks may reference them so installing it yourself is recommended.
### Repository structure

- `core/`: Rust crate with all of the core coverage-processing functionality

### Writing new parsers

Expand Down
27 changes: 27 additions & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "codecov-rs"
version = "0.1.0"
edition = "2021"

[features]
default = ["pyreport"]
pyreport = []

[dependencies]
include_dir = "0.7.3"
memmap2 = "0.9.4"
rand = "0.8.5"
rusqlite = { version = "0.31.0", features = ["bundled", "limits"] }
rusqlite_migration = { version = "1.2.0", features = ["from-directory"] }
seahash = "4.1.0"
serde_json = "1.0.117"
thiserror = "1.0.59"
winnow = "0.5.34"

[dev-dependencies]
divan = "0.1.14"
tempfile = "3.9.0"

[[bench]]
name = "pyreport"
harness = false
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading