diff --git a/color-eyre/.github/workflows/ci.yml b/color-eyre/.github/workflows/ci.yml index 23ad9a0..2cf9ce8 100644 --- a/color-eyre/.github/workflows/ci.yml +++ b/color-eyre/.github/workflows/ci.yml @@ -7,23 +7,6 @@ on: 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 @@ -78,58 +61,3 @@ jobs: - 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 diff --git a/color-eyre/Cargo.toml b/color-eyre/Cargo.toml index 9f325ec..95865ad 100644 --- a/color-eyre/Cargo.toml +++ b/color-eyre/Cargo.toml @@ -37,6 +37,10 @@ ansi-parser = "0.8.0" [target.'cfg(target_arch = "wasm32")'.dev-dependencies] wasm-bindgen-test = "0.3.15" +[[example]] +name = "color-eyre-usage" +path = "examples/usage.rs" + [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] @@ -47,37 +51,27 @@ dev-version = false [[package.metadata.release.pre-release-replacements]] file = "CHANGELOG.md" search = "Unreleased" -replace="{{version}}" +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}}\")]" +file = "CHANGELOG.md" +search = "ReleaseDate" +replace = "{{date}}" + +[[package.metadata.release.pre-release-replacements]] +file = "CHANGELOG.md" +search = "" +replace = "\n\n## [Unreleased] - ReleaseDate" exactly = 1 [[package.metadata.release.pre-release-replacements]] file = "CHANGELOG.md" search = "\\.\\.\\.HEAD" -replace="...{{tag_name}}" +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="" -replace="\n\n## [Unreleased] - ReleaseDate" -exactly=1 - -[[package.metadata.release.pre-release-replacements]] -file="CHANGELOG.md" -search="" -replace="\n[Unreleased]: https://github.com/eyre-rs/{{crate_name}}/compare/{{tag_name}}...HEAD" -exactly=1 - -[[example]] -name = "color-eyre-usage" -path = "examples/usage.rs" +search = "" +replace = "\n[Unreleased]: https://github.com/eyre-rs/{{crate_name}}/compare/{{tag_name}}...HEAD" +exactly = 1 diff --git a/color-eyre/src/config.rs b/color-eyre/src/config.rs index 22b4e60..3f14a6e 100644 --- a/color-eyre/src/config.rs +++ b/color-eyre/src/config.rs @@ -578,7 +578,6 @@ impl HookBuilder { /// .unwrap(); /// ``` #[cfg(feature = "issue-url")] - #[cfg_attr(docsrs, doc(cfg(feature = "issue-url")))] pub fn issue_url(mut self, url: S) -> Self { self.issue_url = Some(url.to_string()); self @@ -598,7 +597,6 @@ impl HookBuilder { /// .unwrap(); /// ``` #[cfg(feature = "issue-url")] - #[cfg_attr(docsrs, doc(cfg(feature = "issue-url")))] pub fn add_issue_metadata(mut self, key: K, value: V) -> Self where K: Display, @@ -634,7 +632,6 @@ impl HookBuilder { /// .unwrap(); /// #[cfg(feature = "issue-url")] - #[cfg_attr(docsrs, doc(cfg(feature = "issue-url")))] pub fn issue_filter(mut self, predicate: F) -> Self where F: Fn(crate::ErrorKind<'_>) -> bool + Send + Sync + 'static, @@ -661,7 +658,6 @@ impl HookBuilder { /// /// This will not disable the location section in a panic message. #[cfg(feature = "track-caller")] - #[cfg_attr(docsrs, doc(cfg(feature = "track-caller")))] pub fn display_location_section(mut self, cond: bool) -> Self { self.display_location_section = cond; self @@ -1217,5 +1213,4 @@ pub type FilterCallback = dyn Fn(&mut Vec<&Frame>) + Send + Sync + 'static; /// Callback for filtering issue url generation in error reports #[cfg(feature = "issue-url")] -#[cfg_attr(docsrs, doc(cfg(feature = "issue-url")))] pub type IssueFilterCallback = dyn Fn(crate::ErrorKind<'_>) -> bool + Send + Sync + 'static; diff --git a/color-eyre/src/handler.rs b/color-eyre/src/handler.rs index 80c1417..1f29cb3 100644 --- a/color-eyre/src/handler.rs +++ b/color-eyre/src/handler.rs @@ -24,7 +24,6 @@ impl Handler { /// Return a reference to the captured `SpanTrace` type #[cfg(feature = "capture-spantrace")] - #[cfg_attr(docsrs, doc(cfg(feature = "capture-spantrace")))] pub fn span_trace(&self) -> Option<&SpanTrace> { self.span_trace.as_ref() } diff --git a/color-eyre/src/lib.rs b/color-eyre/src/lib.rs index 2664cad..54d3529 100644 --- a/color-eyre/src/lib.rs +++ b/color-eyre/src/lib.rs @@ -325,20 +325,23 @@ //! [`eyre::EyreHandler`]: https://docs.rs/eyre/*/eyre/trait.EyreHandler.html //! [`backtrace::Backtrace`]: https://docs.rs/backtrace/*/backtrace/struct.Backtrace.html //! [`tracing_error::SpanTrace`]: https://docs.rs/tracing-error/*/tracing_error/struct.SpanTrace.html -//! [`color-spantrace`]: https://github.com/yaahc/color-spantrace +//! [`color-spantrace`]: https://docs.rs/color-spantrace //! [`Section`]: https://docs.rs/color-eyre/*/color_eyre/trait.Section.html //! [`eyre::Report`]: https://docs.rs/eyre/*/eyre/struct.Report.html //! [`eyre::Result`]: https://docs.rs/eyre/*/eyre/type.Result.html //! [`Handler`]: https://docs.rs/color-eyre/*/color_eyre/struct.Handler.html -//! [`examples/usage.rs`]: https://github.com/yaahc/color-eyre/blob/master/examples/usage.rs -//! [`examples/custom_filter.rs`]: https://github.com/yaahc/color-eyre/blob/master/examples/custom_filter.rs -//! [`examples/custom_section.rs`]: https://github.com/yaahc/color-eyre/blob/master/examples/custom_section.rs -//! [`examples/multiple_errors.rs`]: https://github.com/yaahc/color-eyre/blob/master/examples/multiple_errors.rs -#![doc(html_root_url = "https://docs.rs/color-eyre/0.6.2")] -#![cfg_attr(docsrs, feature(doc_cfg))] +//! [`examples/usage.rs`]: https://github.com/eyre-rs/eyre/blob/master/color-eyre/examples/usage.rs +//! [`examples/custom_filter.rs`]: https://github.com/eyre-rs/eyre/blob/master/color-eyre/examples/custom_filter.rs +//! [`examples/custom_section.rs`]: https://github.com/eyre-rs/eyre/blob/master/color-eyre/examples/custom_section.rs +//! [`examples/multiple_errors.rs`]: https://github.com/eyre-rs/eyre/blob/master/color-eyre/examples/multiple_errors.rs +#![cfg_attr( + nightly, + feature(rustdoc_missing_doc_code_examples), + warn(rustdoc::missing_doc_code_examples) +)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![warn( missing_docs, - rustdoc::missing_doc_code_examples, rust_2018_idioms, unreachable_pub, bad_style, @@ -349,13 +352,13 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, + unconditional_recursion, unused, unused_allocation, unused_comparisons, unused_parens, while_true )] -#![allow(clippy::try_err)] use std::sync::Arc; @@ -418,7 +421,6 @@ pub struct Handler { /// The kind of type erased error being reported #[cfg(feature = "issue-url")] -#[cfg_attr(docsrs, doc(cfg(feature = "issue-url")))] pub enum ErrorKind<'a> { /// A non recoverable error aka `panic!` NonRecoverable(&'a dyn std::any::Any), diff --git a/color-spantrace/.gitignore b/color-spantrace/.gitignore deleted file mode 100644 index 96ef6c0..0000000 --- a/color-spantrace/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/target -Cargo.lock diff --git a/color-spantrace/src/lib.rs b/color-spantrace/src/lib.rs index 214799b..f3e8a48 100644 --- a/color-spantrace/src/lib.rs +++ b/color-spantrace/src/lib.rs @@ -59,12 +59,12 @@ //! //! [`tracing_error::SpanTrace`]: https://docs.rs/tracing-error/*/tracing_error/struct.SpanTrace.html //! [`color-backtrace`]: https://github.com/athre0z/color-backtrace -#![doc(html_root_url = "https://docs.rs/color-spantrace/0.2.1")] #![cfg_attr( nightly, feature(rustdoc_missing_doc_code_examples), warn(rustdoc::missing_doc_code_examples) )] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![warn( missing_debug_implementations, missing_docs, @@ -85,6 +85,7 @@ unused_parens, while_true )] + use once_cell::sync::OnceCell; use owo_colors::{style, Style}; use std::env; diff --git a/eyre/Cargo.toml b/eyre/Cargo.toml index 1085cbb..5924409 100644 --- a/eyre/Cargo.toml +++ b/eyre/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "eyre" version = "1.0.0" -authors = ["David Tolnay ", "Jane Lusby "] description = "Flexible concrete Error Reporting type built on std::error::Error with customizable Reports" documentation = "https://docs.rs/eyre" categories = ["rust-patterns"] +authors = { workspace = true } edition = { workspace = true } license = { workspace = true } repository = { workspace = true } @@ -35,7 +35,8 @@ pyo3 = { version = "0.20", default-features = false, features = ["auto-initializ [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] -rustdoc-args = ["--cfg", "doc_cfg"] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] [package.metadata.workspaces] independent = true diff --git a/eyre/src/lib.rs b/eyre/src/lib.rs index 33c60d3..8e9f003 100644 --- a/eyre/src/lib.rs +++ b/eyre/src/lib.rs @@ -328,12 +328,13 @@ //! [`simple-eyre`]: https://github.com/eyre-rs/simple-eyre //! [`color-spantrace`]: https://github.com/eyre-rs/color-spantrace //! [`color-backtrace`]: https://github.com/athre0z/color-backtrace -#![doc(html_root_url = "https://docs.rs/eyre/0.6.11")] #![cfg_attr( nightly, feature(rustdoc_missing_doc_code_examples), warn(rustdoc::missing_doc_code_examples) )] +#![cfg_attr(backtrace, feature(backtrace))] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![warn( missing_debug_implementations, missing_docs, @@ -355,8 +356,6 @@ unused_parens, while_true )] -#![cfg_attr(backtrace, feature(backtrace))] -#![cfg_attr(doc_cfg, feature(doc_cfg))] #![allow( clippy::needless_doctest_main, clippy::new_ret_no_self, diff --git a/simple-eyre/Cargo.toml b/simple-eyre/Cargo.toml index f6e8ddd..1c71c81 100644 --- a/simple-eyre/Cargo.toml +++ b/simple-eyre/Cargo.toml @@ -25,35 +25,28 @@ no-dev-version = true [[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 +replace = "{{version}}" [[package.metadata.release.pre-release-replacements]] file = "CHANGELOG.md" search = "ReleaseDate" -replace="{{date}}" +replace = "{{date}}" [[package.metadata.release.pre-release-replacements]] -file="CHANGELOG.md" -search="" -replace="\n\n## [Unreleased] - ReleaseDate" -exactly=1 +file = "CHANGELOG.md" +search = "" +replace = "\n\n## [Unreleased] - ReleaseDate" +exactly = 1 # Disable this replacement on the very first release [[package.metadata.release.pre-release-replacements]] file = "CHANGELOG.md" search = "\\.\\.\\.HEAD" -replace="...{{tag_name}}" +replace = "...{{tag_name}}" exactly = 1 -# END SECTION, do not comment out the replacement below this, and do not reorder them [[package.metadata.release.pre-release-replacements]] -file="CHANGELOG.md" -search="" -replace="\n[Unreleased]: https://github.com/yaahc/{{crate_name}}/compare/{{tag_name}}...HEAD" -exactly=1 +file = "CHANGELOG.md" +search = "" +replace = "\n[Unreleased]: https://github.com/eyre-rs/{{crate_name}}/compare/{{tag_name}}...HEAD" +exactly = 1 diff --git a/simple-eyre/src/lib.rs b/simple-eyre/src/lib.rs index e9c9e24..c2a5ee5 100644 --- a/simple-eyre/src/lib.rs +++ b/simple-eyre/src/lib.rs @@ -29,15 +29,18 @@ //! //! [`eyre::EyreHandler`]: https://docs.rs/eyre/*/eyre/trait.EyreHandler.html //! [`eyre`]: https://docs.rs/eyre -#![doc(html_root_url = "https://docs.rs/simple-eyre/0.3.1")] +#![cfg_attr( + nightly, + feature(rustdoc_missing_doc_code_examples), + warn(rustdoc::missing_doc_code_examples) +)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![warn( missing_debug_implementations, missing_docs, - missing_doc_code_examples, rust_2018_idioms, unreachable_pub, bad_style, - const_err, dead_code, improper_ctypes, non_shorthand_field_patterns, @@ -45,7 +48,6 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - private_in_public, unconditional_recursion, unused, unused_allocation, @@ -53,6 +55,7 @@ unused_parens, while_true )] + pub use eyre; #[doc(hidden)] pub use eyre::{Report, Result};