csv_ledger

Crates.iocsv_ledger
lib.rscsv_ledger
version0.1.2
created_at2022-08-31 17:28:18.73246+00
updated_at2022-09-03 09:17:07.119126+00
descriptionConsume a CSV containing a list of transactions and produce a set of bank account statements.
homepage
repositoryhttps://github.com/OliverBrotchie/csv-ledger
max_upload_size
id655826
size335,613
Oliver Brotchie (OliverBrotchie)

documentation

README

csv_ledger

A project to learn zero-copy parsing and improve my Rust performance profiling and coverage tooling knowledge.


🛠 Installation

cargo install csv_ledger

🔋 Usage

Print output to console:

csv_ledger foo.csv

Save output to file:

csv_ledger --output output.csv foo.csv

To see helpful information:

csv_ledger --help

📚 Documentation

Further documentation can be found here.

🔬 Testing

To run tests for the CLI:

cargo test --features test_args

To run tests for the library:

cd lib && cargo test

📝 Code Coverage

This project aimed to have a near 100% code-coverage. Whilst Rust provides first-class error checking, it cannot easily protect against logic errors. With strong test coverage in combination with Rust's error checking, you can have a high degree of confidence. However, I have found that getting to 100% coverage can be very difficult whilst using llvm-cov. LLVM's coverage tooling is far more precise than other coverage tools that I have worked with in the past (such as Jest), requiring all lines, branches, derived traits and implementations to be covered.

A pre-generated coverage report can be found in: /coverage/html.

Run Coverage Locally

Setup

rustup component add llvm-tools-preview &&
cargo install cargo-llvm-cov

Usage

To create a coverage report:

cargo llvm-cov --features test_args

To debug a coverage report:

cargo llvm-cov --features test_args --html --output-dir coverage
Commit count: 11

cargo fmt