acta-build 0.2.0

Build-time helper for acta: compute path-column width from a project's source tree
Documentation

Build-time helper for acta.

Call from your build.rs to compute a sensible default path_width for [acta::Formatter] based on the longest source-file path in your project.

Example

Add to your Cargo.toml:

[build-dependencies]
acta-build = "0.1"

In build.rs:

# fn example() {
let width = acta_build::walk_src_max_width("src", "src/");
println!("cargo:rustc-env=ACTA_PATH_WIDTH={width}");
println!("cargo:rerun-if-changed=src");
# }

Then in your code:

let width: usize = env!("ACTA_PATH_WIDTH").parse().unwrap_or(40);
let formatter = acta::Formatter::new().with_path_width(width);