testing-conventions 0.0.25

Enforce testing conventions in libraries (Python, TypeScript, and Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::process::ExitCode;

fn main() -> ExitCode {
    match testing_conventions::run(std::env::args_os()) {
        Ok(code) => ExitCode::from(code as u8),
        Err(err) => {
            if let Some(clap_err) = err.downcast_ref::<clap::Error>() {
                clap_err.exit();
            }
            // `{err:#}` prints the whole anyhow chain on one line ("context:
            // cause"), so a wrapped failure (e.g. a stale exempt entry, with the
            // offending config as context) shows both the where and the why.
            eprintln!("error: {err:#}");
            ExitCode::from(1)
        }
    }
}