-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
4,915 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: {} | ||
|
||
name: Continuous integration | ||
|
||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
rust: | ||
- stable | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
|
||
test-features: | ||
name: Test Features | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
features: | ||
- | ||
- --all-features | ||
- --no-default-features | ||
- --no-default-features --features issue-url | ||
- --no-default-features --features capture-spantrace | ||
- --no-default-features --features track-caller | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: ${{ matrix.features }} | ||
|
||
test-versions: | ||
name: Test Versions | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
target: | ||
- x86_64-unknown-linux-gnu | ||
- wasm32-unknown-unknown | ||
rust: | ||
- stable | ||
- beta | ||
- nightly | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
target: ${{ matrix.target }} | ||
toolchain: ${{ matrix.rust }} | ||
override: true | ||
- name: install test runner for wasm | ||
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | ||
if: ${{ matrix.target == 'wasm32-unknown-unknown' }} | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
target: ${{ matrix.target }} | ||
toolchain: ${{ matrix.rust }} | ||
if: ${{ matrix.target != 'wasm32-unknown-unknown' }} | ||
- name: run wasm tests | ||
run: wasm-pack test --node | ||
if: ${{ matrix.target == 'wasm32-unknown-unknown' }} | ||
|
||
test-os: | ||
name: Test Operating Systems | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
|
||
fmt: | ||
name: Rustfmt | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
rust: | ||
- stable | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
override: true | ||
- run: rustup component add rustfmt | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
clippy: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
rust: | ||
- stable | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
override: true | ||
- run: rustup component add clippy | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: -- -D warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
<!-- next-header --> | ||
|
||
## [Unreleased] - ReleaseDate | ||
|
||
## [0.6.2] - 2022-07-11 | ||
### Added | ||
- Option to disable display of location section in error reports | ||
|
||
## [0.6.1] - 2022-02-24 | ||
### Changed | ||
- Collapsed backtrace help text into fewer lines | ||
|
||
## [0.6.0] - 2022-01-12 | ||
### Changed | ||
- Updated dependencies to match newest tracing versions | ||
|
||
## [0.5.11] - 2021-04-13 | ||
|
||
## [0.5.10] - 2020-12-02 | ||
### Added | ||
- Support custom themes | ||
|
||
## [0.5.9] - 2020-12-02 | ||
### Fixed | ||
- Bumped color-spantrace dependency version to fix a panic | ||
|
||
## [0.5.8] - 2020-11-23 | ||
### Added | ||
- Exposed internal interfaces for the panic handler so that it can be wrapped | ||
by consumers to customize the behaviour of the panic hook. | ||
|
||
## [0.5.7] - 2020-11-05 | ||
### Fixed | ||
- Added missing `cfg`s that caused compiler errors when only enabling the | ||
`issue-url` feature | ||
|
||
## [0.5.6] - 2020-10-02 | ||
### Added | ||
- Add support for track caller added in eyre 0.6.1 and print original | ||
callsites of errors in all `eyre::Reports` by default | ||
|
||
## [0.5.5] - 2020-09-21 | ||
### Added | ||
- add `issue_filter` method to `HookBuilder` for disabling issue generation | ||
based on the error encountered. | ||
|
||
## [0.5.4] - 2020-09-17 | ||
### Added | ||
- Add new "issue-url" feature for generating issue creation links in error | ||
reports pre-populated with information about the error | ||
|
||
## [0.5.3] - 2020-09-14 | ||
### Added | ||
- add `panic_section` method to `HookBuilder` for overriding the printer for | ||
the panic message at the start of panic reports | ||
|
||
## [0.5.2] - 2020-08-31 | ||
### Added | ||
- make it so all `Section` trait methods can be called on `Report` in | ||
addition to the already supported usage on `Result<T, E: Into<Report>>` | ||
- panic_section to `HookBuilder` to add custom sections to panic reports | ||
- display_env_section to `HookBuilder` to disable the output indicating what | ||
environment variables can be set to manipulate the error reports | ||
### Changed | ||
- switched from ansi_term to owo-colors for colorizing output, allowing for | ||
better compatibility with the Display trait | ||
|
||
<!-- next-url --> | ||
[Unreleased]: https://github.com/eyre-rs/color-eyre/compare/v0.6.2...HEAD | ||
[0.6.2]: https://github.com/eyre-rs/color-eyre/compare/v0.6.1...v0.6.2 | ||
[0.6.1]: https://github.com/eyre-rs/color-eyre/compare/v0.6.0...v0.6.1 | ||
[0.6.0]: https://github.com/eyre-rs/color-eyre/compare/v0.5.11...v0.6.0 | ||
[0.5.11]: https://github.com/eyre-rs/color-eyre/compare/v0.5.10...v0.5.11 | ||
[0.5.10]: https://github.com/eyre-rs/color-eyre/compare/v0.5.9...v0.5.10 | ||
[0.5.9]: https://github.com/eyre-rs/color-eyre/compare/v0.5.8...v0.5.9 | ||
[0.5.8]: https://github.com/eyre-rs/color-eyre/compare/v0.5.7...v0.5.8 | ||
[0.5.7]: https://github.com/eyre-rs/color-eyre/compare/v0.5.6...v0.5.7 | ||
[0.5.6]: https://github.com/eyre-rs/color-eyre/compare/v0.5.5...v0.5.6 | ||
[0.5.5]: https://github.com/eyre-rs/color-eyre/compare/v0.5.4...v0.5.5 | ||
[0.5.4]: https://github.com/eyre-rs/color-eyre/compare/v0.5.3...v0.5.4 | ||
[0.5.3]: https://github.com/eyre-rs/color-eyre/compare/v0.5.2...v0.5.3 | ||
[0.5.2]: https://github.com/eyre-rs/color-eyre/releases/tag/v0.5.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
[package] | ||
name = "color-eyre" | ||
version = "0.6.2" | ||
description = "An error report handler for panics and eyre::Reports for colorful, consistent, and well formatted error reports for all kinds of errors." | ||
documentation = "https://docs.rs/color-eyre" | ||
|
||
authors = { workspace = true } | ||
edition = { workspace = true } | ||
license = { workspace = true } | ||
repository = { workspace = true } | ||
readme = { workspace = true } | ||
rust-version = { workspace = true } | ||
|
||
[features] | ||
default = ["track-caller", "capture-spantrace"] | ||
capture-spantrace = ["tracing-error", "color-spantrace"] | ||
issue-url = ["url"] | ||
track-caller = [] | ||
|
||
[dependencies] | ||
eyre = "0.6.1" | ||
tracing-error = { version = "0.2.0", optional = true } | ||
backtrace = { version = "0.3.48", features = ["gimli-symbolize"] } | ||
indenter = { workspace = true } | ||
owo-colors = { workspace = true } | ||
color-spantrace = { version = "0.2", optional = true } | ||
once_cell = { workspace = true } | ||
url = { version = "2.1.1", optional = true } | ||
|
||
[dev-dependencies] | ||
tracing-subscriber = { version = "0.3.0", features = ["env-filter"] } | ||
tracing = "0.1.13" | ||
pretty_assertions = "1.0.0" | ||
thiserror = "1.0.19" | ||
ansi-parser = "0.8.0" | ||
|
||
[target.'cfg(target_arch = "wasm32")'.dev-dependencies] | ||
wasm-bindgen-test = "0.3.15" | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
rustdoc-args = ["--cfg", "docsrs"] | ||
|
||
[package.metadata.release] | ||
dev-version = false | ||
|
||
[[package.metadata.release.pre-release-replacements]] | ||
file = "CHANGELOG.md" | ||
search = "Unreleased" | ||
replace="{{version}}" | ||
|
||
[[package.metadata.release.pre-release-replacements]] | ||
file = "src/lib.rs" | ||
search = "#!\\[doc\\(html_root_url.*" | ||
replace = "#![doc(html_root_url = \"https://docs.rs/{{crate_name}}/{{version}}\")]" | ||
exactly = 1 | ||
|
||
[[package.metadata.release.pre-release-replacements]] | ||
file = "CHANGELOG.md" | ||
search = "\\.\\.\\.HEAD" | ||
replace="...{{tag_name}}" | ||
exactly = 1 | ||
|
||
[[package.metadata.release.pre-release-replacements]] | ||
file = "CHANGELOG.md" | ||
search = "ReleaseDate" | ||
replace="{{date}}" | ||
|
||
[[package.metadata.release.pre-release-replacements]] | ||
file="CHANGELOG.md" | ||
search="<!-- next-header -->" | ||
replace="<!-- next-header -->\n\n## [Unreleased] - ReleaseDate" | ||
exactly=1 | ||
|
||
[[package.metadata.release.pre-release-replacements]] | ||
file="CHANGELOG.md" | ||
search="<!-- next-url -->" | ||
replace="<!-- next-url -->\n[Unreleased]: https://github.com/eyre-rs/{{crate_name}}/compare/{{tag_name}}...HEAD" | ||
exactly=1 | ||
|
||
[[example]] | ||
name = "color-eyre-usage" | ||
path = "examples/usage.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../LICENSE-APACHE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../LICENSE-MIT |
Oops, something went wrong.