Skip to content

Commit 3a745ca

Browse files
authored
Make all the packages consistent (#260)
- **Fix broken links** - **Delete unnecessary gitignore** - **Remove doc(html_root_url)** - **Use workspace authors info** - **Unify lint config** - **Use doc_auto_cfg for docs.rs**
2 parents 2ab897d + 69ff527 commit 3a745ca

File tree

10 files changed

+24
-98
lines changed

10 files changed

+24
-98
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
- uses: actions-rs/cargo@v1
117117
with:
118118
command: fmt
119-
args: --check
119+
args: --all --check
120120

121121
clippy:
122122
name: Clippy

color-eyre/.github/workflows/ci.yml

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,6 @@ on:
77
name: Continuous integration
88

99
jobs:
10-
check:
11-
name: Check
12-
runs-on: ubuntu-latest
13-
strategy:
14-
matrix:
15-
rust:
16-
- stable
17-
steps:
18-
- uses: actions/checkout@v1
19-
- uses: actions-rs/toolchain@v1
20-
with:
21-
toolchain: ${{ matrix.rust }}
22-
override: true
23-
- uses: actions-rs/cargo@v1
24-
with:
25-
command: check
26-
2710
test-features:
2811
name: Test Features
2912
runs-on: ubuntu-latest
@@ -78,58 +61,3 @@ jobs:
7861
- name: run wasm tests
7962
run: wasm-pack test --node
8063
if: ${{ matrix.target == 'wasm32-unknown-unknown' }}
81-
82-
test-os:
83-
name: Test Operating Systems
84-
runs-on: ${{ matrix.os }}
85-
strategy:
86-
matrix:
87-
os: [ubuntu-latest, windows-latest, macOS-latest]
88-
steps:
89-
- uses: actions/checkout@v1
90-
- uses: actions-rs/toolchain@v1
91-
with:
92-
toolchain: stable
93-
profile: minimal
94-
override: true
95-
- uses: actions-rs/cargo@v1
96-
with:
97-
command: test
98-
99-
fmt:
100-
name: Rustfmt
101-
runs-on: ubuntu-latest
102-
strategy:
103-
matrix:
104-
rust:
105-
- stable
106-
steps:
107-
- uses: actions/checkout@v1
108-
- uses: actions-rs/toolchain@v1
109-
with:
110-
toolchain: ${{ matrix.rust }}
111-
override: true
112-
- run: rustup component add rustfmt
113-
- uses: actions-rs/cargo@v1
114-
with:
115-
command: fmt
116-
args: --all -- --check
117-
118-
clippy:
119-
name: Clippy
120-
runs-on: ubuntu-latest
121-
strategy:
122-
matrix:
123-
rust:
124-
- stable
125-
steps:
126-
- uses: actions/checkout@v1
127-
- uses: actions-rs/toolchain@v1
128-
with:
129-
toolchain: ${{ matrix.rust }}
130-
override: true
131-
- run: rustup component add clippy
132-
- uses: actions-rs/cargo@v1
133-
with:
134-
command: clippy
135-
args: -- -D warnings

color-eyre/src/config.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,6 @@ impl HookBuilder {
546546
/// .unwrap();
547547
/// ```
548548
#[cfg(feature = "issue-url")]
549-
#[cfg_attr(docsrs, doc(cfg(feature = "issue-url")))]
550549
pub fn issue_url<S: ToString>(mut self, url: S) -> Self {
551550
self.issue_url = Some(url.to_string());
552551
self
@@ -566,7 +565,6 @@ impl HookBuilder {
566565
/// .unwrap();
567566
/// ```
568567
#[cfg(feature = "issue-url")]
569-
#[cfg_attr(docsrs, doc(cfg(feature = "issue-url")))]
570568
pub fn add_issue_metadata<K, V>(mut self, key: K, value: V) -> Self
571569
where
572570
K: Display,
@@ -602,7 +600,6 @@ impl HookBuilder {
602600
/// .unwrap();
603601
///
604602
#[cfg(feature = "issue-url")]
605-
#[cfg_attr(docsrs, doc(cfg(feature = "issue-url")))]
606603
pub fn issue_filter<F>(mut self, predicate: F) -> Self
607604
where
608605
F: Fn(crate::ErrorKind<'_>) -> bool + Send + Sync + 'static,
@@ -629,7 +626,6 @@ impl HookBuilder {
629626
///
630627
/// This will not disable the location section in a panic message.
631628
#[cfg(feature = "track-caller")]
632-
#[cfg_attr(docsrs, doc(cfg(feature = "track-caller")))]
633629
pub fn display_location_section(mut self, cond: bool) -> Self {
634630
self.display_location_section = cond;
635631
self
@@ -1183,5 +1179,4 @@ pub type FilterCallback = dyn Fn(&mut Vec<&Frame>) + Send + Sync + 'static;
11831179

11841180
/// Callback for filtering issue url generation in error reports
11851181
#[cfg(feature = "issue-url")]
1186-
#[cfg_attr(docsrs, doc(cfg(feature = "issue-url")))]
11871182
pub type IssueFilterCallback = dyn Fn(crate::ErrorKind<'_>) -> bool + Send + Sync + 'static;

color-eyre/src/handler.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ impl Handler {
2424

2525
/// Return a reference to the captured `SpanTrace` type
2626
#[cfg(feature = "capture-spantrace")]
27-
#[cfg_attr(docsrs, doc(cfg(feature = "capture-spantrace")))]
2827
pub fn span_trace(&self) -> Option<&SpanTrace> {
2928
self.span_trace.as_ref()
3029
}

color-eyre/src/lib.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -325,20 +325,25 @@
325325
//! [`eyre::EyreHandler`]: https://docs.rs/eyre/*/eyre/trait.EyreHandler.html
326326
//! [`backtrace::Backtrace`]: https://docs.rs/backtrace/*/backtrace/struct.Backtrace.html
327327
//! [`tracing_error::SpanTrace`]: https://docs.rs/tracing-error/*/tracing_error/struct.SpanTrace.html
328-
//! [`color-spantrace`]: https://github.com/yaahc/color-spantrace
328+
//! [`color-spantrace`]: https://docs.rs/color-spantrace
329329
//! [`Section`]: https://docs.rs/color-eyre/*/color_eyre/trait.Section.html
330330
//! [`eyre::Report`]: https://docs.rs/eyre/*/eyre/struct.Report.html
331331
//! [`eyre::Result`]: https://docs.rs/eyre/*/eyre/type.Result.html
332332
//! [`Handler`]: https://docs.rs/color-eyre/*/color_eyre/struct.Handler.html
333-
//! [`examples/usage.rs`]: https://github.com/yaahc/color-eyre/blob/master/examples/usage.rs
334-
//! [`examples/custom_filter.rs`]: https://github.com/yaahc/color-eyre/blob/master/examples/custom_filter.rs
335-
//! [`examples/custom_section.rs`]: https://github.com/yaahc/color-eyre/blob/master/examples/custom_section.rs
336-
//! [`examples/multiple_errors.rs`]: https://github.com/yaahc/color-eyre/blob/master/examples/multiple_errors.rs
337-
#![doc(html_root_url = "https://docs.rs/color-eyre/0.6.2")]
338-
#![cfg_attr(docsrs, feature(doc_cfg))]
333+
//! [`examples/usage.rs`]: https://github.com/eyre-rs/eyre/blob/master/color-eyre/examples/usage.rs
334+
//! [`examples/custom_filter.rs`]: https://github.com/eyre-rs/eyre/blob/master/color-eyre/examples/custom_filter.rs
335+
//! [`examples/custom_section.rs`]: https://github.com/eyre-rs/eyre/blob/master/color-eyre/examples/custom_section.rs
336+
//! [`examples/multiple_errors.rs`]: https://github.com/eyre-rs/eyre/blob/master/color-eyre/examples/multiple_errors.rs
337+
#![cfg_attr(
338+
nightly,
339+
feature(rustdoc_missing_doc_code_examples),
340+
warn(rustdoc::missing_doc_code_examples)
341+
)]
342+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
339343
#![warn(
344+
missing_debug_implementations,
340345
missing_docs,
341-
rustdoc::missing_doc_code_examples,
346+
unsafe_op_in_unsafe_fn,
342347
rust_2018_idioms,
343348
unreachable_pub,
344349
bad_style,
@@ -349,13 +354,13 @@
349354
overflowing_literals,
350355
path_statements,
351356
patterns_in_fns_without_body,
357+
unconditional_recursion,
352358
unused,
353359
unused_allocation,
354360
unused_comparisons,
355361
unused_parens,
356362
while_true
357363
)]
358-
#![allow(clippy::try_err)]
359364

360365
use std::sync::Arc;
361366

@@ -418,7 +423,6 @@ pub struct Handler {
418423

419424
/// The kind of type erased error being reported
420425
#[cfg(feature = "issue-url")]
421-
#[cfg_attr(docsrs, doc(cfg(feature = "issue-url")))]
422426
pub enum ErrorKind<'a> {
423427
/// A non recoverable error aka `panic!`
424428
NonRecoverable(&'a dyn std::any::Any),

color-spantrace/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

color-spantrace/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,16 @@
5959
//!
6060
//! [`tracing_error::SpanTrace`]: https://docs.rs/tracing-error/*/tracing_error/struct.SpanTrace.html
6161
//! [`color-backtrace`]: https://github.com/athre0z/color-backtrace
62-
#![doc(html_root_url = "https://docs.rs/color-spantrace/0.2.1")]
6362
#![cfg_attr(
6463
nightly,
6564
feature(rustdoc_missing_doc_code_examples),
6665
warn(rustdoc::missing_doc_code_examples)
6766
)]
67+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
6868
#![warn(
6969
missing_debug_implementations,
7070
missing_docs,
71+
unsafe_op_in_unsafe_fn,
7172
rust_2018_idioms,
7273
unreachable_pub,
7374
bad_style,
@@ -85,6 +86,7 @@
8586
unused_parens,
8687
while_true
8788
)]
89+
8890
use once_cell::sync::OnceCell;
8991
use owo_colors::{style, Style};
9092
use std::env;

eyre/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
22
name = "eyre"
33
version = "1.0.0"
4-
authors = ["David Tolnay <dtolnay@gmail.com>", "Jane Lusby <jlusby42@gmail.com>"]
54
description = "Flexible concrete Error Reporting type built on std::error::Error with customizable Reports"
65
documentation = "https://docs.rs/eyre"
76
categories = ["rust-patterns"]
87

8+
authors = { workspace = true }
99
edition = { workspace = true }
1010
license = { workspace = true }
1111
repository = { workspace = true }
@@ -39,7 +39,8 @@ pyo3 = { version = "0.25", default-features = false, features = ["auto-initializ
3939

4040
[package.metadata.docs.rs]
4141
targets = ["x86_64-unknown-linux-gnu"]
42-
rustdoc-args = ["--cfg", "doc_cfg"]
42+
all-features = true
43+
rustdoc-args = ["--cfg", "docsrs"]
4344

4445
[package.metadata.workspaces]
4546
independent = true

eyre/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fn main() {
1111
println!("cargo:rustc-check-cfg=cfg(eyre_no_fmt_args_capture)");
1212
println!("cargo:rustc-check-cfg=cfg(backtrace)");
1313
println!("cargo:rustc-check-cfg=cfg(eyre_no_fmt_arguments_as_str)");
14-
println!("cargo:rustc-check-cfg=cfg(doc_cfg)");
14+
println!("cargo:rustc-check-cfg=cfg(docsrs)");
1515
let ac = autocfg::new();
1616

1717
// https://github.com/rust-lang/rust/issues/99301 [nightly]
@@ -49,7 +49,7 @@ const GENERIC_MEMBER_ACCESS_PROBE: &str = r#"
4949
use std::fmt::{self, Display};
5050
5151
#[derive(Debug)]
52-
struct E {
52+
struct E {
5353
backtrace: MyBacktrace,
5454
}
5555

eyre/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,12 @@
328328
//! [`simple-eyre`]: https://github.com/eyre-rs/simple-eyre
329329
//! [`color-spantrace`]: https://github.com/eyre-rs/color-spantrace
330330
//! [`color-backtrace`]: https://github.com/athre0z/color-backtrace
331-
#![doc(html_root_url = "https://docs.rs/eyre/0.6.11")]
332331
#![cfg_attr(
333332
nightly,
334333
feature(rustdoc_missing_doc_code_examples),
335334
warn(rustdoc::missing_doc_code_examples)
336335
)]
336+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
337337
#![warn(
338338
missing_debug_implementations,
339339
missing_docs,
@@ -356,7 +356,6 @@
356356
while_true
357357
)]
358358
#![cfg_attr(generic_member_access, feature(error_generic_member_access))]
359-
#![cfg_attr(doc_cfg, feature(doc_cfg))]
360359
#![allow(
361360
clippy::needless_doctest_main,
362361
clippy::new_ret_no_self,

0 commit comments

Comments
 (0)