More beautiful HTML reports for llvm-cov/cargo-llvm-cov

Overview

πŸ’„ llvm-cov-pretty

More beautiful HTML reports for llvm-cov (cargo-llvm-cov specifically).

  • Dark theme support (switches automatically based on your browser setting).
  • Syntax highlighting.
  • Reduced clutter from instantiation annotations.\
  • More colors, because why not.
  • Progress bars (like in grcov).

A note on stability

This tool is still in its early stages, and the JSON output of llvm-cov has several quirks and complexities. Therefore, for the time being, always generate the regular HTML report as well and compare the output.

Please file an issue if you find any differences.

Installation

Make sure you have cargo-llvm-cov installed.

From source

To build the project from source, you need a recent installation of Rust. The recommended installation method is through rustup. Then open up a terminal and install the project as follows:

cargo install llvm-cov-pretty

The binary will be installed into your $HOME/.cargo/bin folder by default. Please make sure it is available from your $PATH.

From AUR

Arch linux users can use an AUR helper to install the project from the AUR. For example, using paru:

paru -S llvm-cov-pretty

Pre-build binaries

If you don't want to build the project yourself, you can download pre-build binaries instead. Have a look at the release page and find the appropriate file for your platform.

Requirements

Before you can use this tool, make sure the following steps are done:

  • In addition to installing cargo-llvm-cov, make sure you've run it at least once on your machine in any Rust project. It will jump into interactive mode and install any missing tools that it needs itself.
  • It is expected that you are in the context of a Rust project. Ensure you invoke the program while located in a Rust project in your terminal.
    • However, you can pass the --manifest-path argument, but make sure you pass the same path to both cargo-llvm-cov and llvm-cov-pretty.

Usage

The tool operates on the JSON output from llvm-cov. As cargo-llvm-cov directly prints those to the standard output, you can pipe the programs together like so:

cargo llvm-cov --json | llvm-cov-pretty

Of course you can do this in two steps as well:

cargo llvm-cov --json > coverage.json
llvm-cov-pretty coverage.json

There are a few extra commands (like generating shell completions) and options (like disabling instantiation annotations) as well. Have a look at the output of llvm-cov-pretty --help.

Development

To start developing on the project, you'll need a few extra step in addition to the ones described in the From source section.

  • Install a recent version of Node.js and Yarn (usually comes bundled with Node.js).
  • Ensure all submodules are initialized with git submodule update --init.

Then open up a new terminal and execute yarn run watch. It will watch the project files and rebuild the stylesheet at assets/style.css when needed. With that you're ready to hack along.

Before you create a custom build, it's recommended to stop the watch job again and run yarn run build once, which will create a minified and optimized version of the stylesheet. It is compiled into the binary during builds.

License

This project is licensed under the AGPL-3.0 License (or https://www.gnu.org/licenses/agpl-3.0.html).

You might also like...
Make beautiful colored code listings in LaTeX with the power of TreeSitter.
Make beautiful colored code listings in LaTeX with the power of TreeSitter.

What is this? This is a CLI tool that consumes TreeSitter's output and transforms it into LaTeX code that will produce syntax-colored code listing. If

A beautiful, tiny traceback and logging library supporting #![no_std] rust.

breadcrumbs Breadcrumbs is a beautiful, tiny traceback and logging library for Rust that offers seamless integration with #![no_std], multi-threading

πŸ› οΈ An experimental functional systems programming language, written in Rust and powered by LLVM as a backend.
πŸ› οΈ An experimental functional systems programming language, written in Rust and powered by LLVM as a backend.

An experimental functional systems programming language, written in Rust, and powered by LLVM as a backend. 🎯 Goal: The intent is to create a program

A AMD64 code generator (like LLVM)

A libary to generate x86-64Bit machine code Error: Jit dosn't work Warning: this libary is currently undergoing big changes so don't use in production

Minimal Pandoc compiler - HTML

Minimal Pandoc compiler - HTML

An html macro for dioxus applications.

dioxus html macro This crate offers an html! like macro for dioxus applications. It expands to the equivalent rsx! macro call you would have made othe

Fetch and extract HTML's title and description by given link.

extd Fetch and extract HTML's title and description by given link. Usage in Cargo.toml: [dependencies] extd = "0.1.4" Example use extd::extract_td; f

Generate HTML source files from rust functions!

Htmlificator This crate provides an element struct which can be displayed as HTML. License This crate is licensed under the MIT license Credit This cr

A minimal browser with a super simple rendering engine for HTML and CSS, using Rust.

minimal-browser A minimal browser with a super simple rendering engine for HTML and CSS, using Rust. Credit: https://github.com/mbrubeck and https://l

Comments
  • No files listed in the report

    No files listed in the report

    Describe the bug

    I ran cargo install llvm-cov-pretty, and then tried with a project without a workspace as well as a project with a workspace. In both, the report generated contains the correct overview information, but there are no files listed to poke into. The target folder only contains index.html, style.css, and syntax.css.

    Expected behavior

    I expected beautiful results like you shared in discord! :)

    To reproduce

    1. Clone https://github.com/khonsulabs/alot
    2. Execute cargo llvm-cov --json | llvm-cov-pretty
    3. Open the report

    What operating system are you using?

    None

    Terminal output

    No response

    Additional context

    Because my output for llvm-cov may be different (why? I don't know!) I've uploaded the json output in this gist.

    bug 
    opened by ecton 4
  • Coverage info doesn't match 100% with `llvm-cov`'s report

    Coverage info doesn't match 100% with `llvm-cov`'s report

    Describe the bug

    I noticed that the displayed coverage isn't always the same as seen in the regular llvm-cov output. Already fixed partially locally, but especially the regions for missing instantiations are not correct.

    Expected behavior

    The report should always match 100% with what is visible in llvm-cov. Some parts may of course be different in how they're displayed, but the information about what lines are not covered should always be correct.

    To reproduce

    No response

    What operating system are you using?

    None

    Terminal output

    No response

    Additional context

    This will need some more tinkering, as I didn't find the pattern in the JSON data yet, that would allow me to match the instantiation messages 100% with llvm-cov.

    But at least the basic coverage data is already fixed, and a new version will be released soon.

    bug 
    opened by dnaka91 1
Releases(v0.1.3)
Owner
Dominik Nakamura
Rust, Go and Kotlin enthusiast
Dominik Nakamura
Tools - The Rome Toolchain. A linter, compiler, bundler, and more for JavaScript, TypeScript, HTML, Markdown, and CSS.

Rome is currently being rewritten in Rust. Read more about it in our latest blog post. The documentation below is out of date and available for poster

Rome 22k Jan 3, 2023
A Faster(⚑) formatter, linter, bundler, and more for JavaScript, TypeScript, JSON, HTML, Markdown, and CSS Lapce Plugin

Lapce Plugin for Rome Lapce-rome is a Lapce plugin for rome, The Rome is faster ⚑ , A formatter, linter, compiler, bundler, and more for JavaScript, T

xiaoxin 7 Dec 16, 2022
A cargo plugin to shrink cargo's output

cargo single-line A simple cargo plugin that shrinks the visible cargo output to a single line (okay, in the best case scenario). In principle, the pl

Denis 5 Oct 30, 2022
Cargo-eval - A cargo plugin to quickly evaluate some Rust source code.

cargo eval A cargo plugin to quickly evaluate some Rust source code. Installation $ cargo install --git https://github.com/timClicks/cargo-eval.git Us

Tim McNamara 9 Dec 21, 2022
Cargo-about - πŸ“œ Cargo plugin to generate list of all licenses for a crate πŸ¦€

?? cargo-about Cargo plugin for generating a license listing for all dependencies of a crate See the book ?? for in-depth documentation. Please Note:

Embark 281 Jan 1, 2023
Cargo subcommand for running cargo without dev-dependencies.

cargo-no-dev-deps Cargo subcommand for running cargo without dev-dependencies. This is an extraction of the --no-dev-deps flag of cargo-hack to be use

Taiki Endo 5 Jan 12, 2023
Dead simple, memoized cargo subcommand to hoist cargo-built binaries into the current working directory, written in Rust.

cargo-hoist Dead simple cargo subcommand to hoist cargo-built binaries into scope. stable Install | User Docs | Crate Docs | Reference | Contributing

refcell.eth 6 Nov 9, 2023
:large_orange_diamond: Build beautiful terminal tables with automatic content wrapping

Comfy-table Comfy-table tries to provide utility for building beautiful tables, while being easy to use. Features: Dynamic arrangement of content to a

Arne Beer 525 Jan 8, 2023
Beautiful, minimal, opinionated CLI prompts inspired by the Clack NPM package

Effortlessly build beautiful command-line apps with Rust ?? ✨ Beautiful, minimal, opinionated CLI prompts inspired by the @clack/prompts npm package.

Alexander Fadeev 7 Jul 23, 2023
A beautiful and feature-packed Apple Music CLI

am A beautiful and feature-packed Apple Music CLI! Written in Rust. Installation Nix (recommended) This GitHub repository contains a flake. Add github

Ryan Cao 5 Sep 21, 2023