error-stack 0.4.1

A context-aware error-handling library that supports arbitrary attached user data
Documentation
#!/usr/bin/env just --justfile

set fallback

[private]
default:
  @just usage

# TODO: add `--ignore-unknown-features` to `cargo hack` and pass `--workspace`
cargo-hack-groups := '--group-features eyre,hooks --group-features anyhow,serde'
profile := env_var_or_default('PROFILE', "dev")

[private]
clippy *arguments:
  @just install-cargo-hack

  @just in-pr cargo clippy --profile {{profile}} --workspace --all-features --all-targets --no-deps {{arguments}}
  @just not-in-pr cargo hack --optional-deps --feature-powerset {{cargo-hack-groups}} --ignore-unknown-features clippy --profile {{profile}} --all-targets --no-deps {{arguments}}

[private]
test *arguments:
  @just install-cargo-nextest
  @just install-cargo-hack

  @just in-pr cargo nextest run --cargo-profile {{profile}} --workspace --all-features {{arguments}}
  @just not-in-pr cargo hack --optional-deps --feature-powerset {{cargo-hack-groups}} nextest run --cargo-profile {{profile}} {{arguments}}

  @just in-dev cargo test --profile {{profile}} --workspace --all-features --doc {{arguments}}

# Snapshot Tests
# ==============
#
# Several features make use of snapshots for acceptance/integration tests, these are files
# with expected output for a specific input.
# We use insta for tests https://github.com/mitsuhiko/insta and expect-test https://docs.rs/expect-test/latest/expect_test/ for doc tests.
# expect-test enables us to directly include the snapshot in documentation, while insta provides a more complete feature-set.
#
# You should invoke this task whenever you change `test_debug`, a file which includes a doctest with `expect_test`, or change the formatting of a `Report`.
#
# Reviewing Tests
# ---------------
#
# To review snapshots generated by insta install `cargo-insta` (https://github.com/mitsuhiko/insta) and invoke `cargo insta review`,
# you will be led through all changes one-by-one and need to compare them to see if they are what you expected the outcome to be.
#
# To review snapshots generated by expect-test use gits diffing capabilities.

# Runs the test suite and asks to update the snapshots if they don't match.
update-snapshots:
  @just install-cargo-insta
  @RUST_BACKTRACE=1 INSTA_FORCE_PASS=1 INSTA_UPDATE=new UPDATE_EXPECT=1 just test
  @cargo insta review