Skip to content

Run clippy-check action on CI #491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 28 additions & 17 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ jobs:
matrix:
rust: [stable, 1.39.0]
steps:
- uses: hecrj/setup-rust-action@v1
- uses: actions-rs/toolchain@v1
with:
rust-version: ${{ matrix.rust }}
toolchain: ${{ matrix.rust }}
profile: minimal
- uses: actions/checkout@master
- name: Check
run: cargo check --all --bins --examples --tests --benches
Expand Down Expand Up @@ -100,9 +101,10 @@ jobs:
matrix:
rust: [stable, beta, nightly, 1.39.0]
steps:
- uses: hecrj/setup-rust-action@v1
- uses: actions-rs/toolchain@v1
with:
rust-version: ${{ matrix.rust }}
toolchain: ${{ matrix.rust }}
profile: minimal
- uses: actions/checkout@master
- name: Build
run: cargo build
Expand All @@ -117,9 +119,10 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: hecrj/setup-rust-action@v1
- uses: actions-rs/toolchain@v1
with:
rust-version: stable
toolchain: stable
profile: minimal
- uses: actions/checkout@master
- name: Build
run: cargo build
Expand All @@ -131,9 +134,10 @@ jobs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: hecrj/setup-rust-action@v1
- uses: actions-rs/toolchain@v1
with:
rust-version: stable
toolchain: stable
profile: minimal
- uses: actions/checkout@master
- name: "Test log support"
run: (cd tracing/test-log-support && cargo test)
Expand All @@ -151,9 +155,10 @@ jobs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: hecrj/setup-rust-action@v1
- uses: actions-rs/toolchain@v1
with:
rust-version: nightly
toolchain: nightly
profile: minimal
- uses: actions/checkout@master
- name: "Test tracing-futures std::future support"
run: (cd tracing-futures/test_std_future && cargo test)
Expand All @@ -169,21 +174,27 @@ jobs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: hecrj/setup-rust-action@v1
- uses: actions-rs/toolchain@v1
with:
rust-version: stable
toolchain: stable
components: rustfmt
profile: minimal
- uses: actions/checkout@master
- name: rustfmt
run: cargo fmt --all -- --check

warnings:
# Check for any warnings. This is informational and thus is allowed to fail.
needs: check
runs-on: ubuntu-latest
steps:
- uses: hecrj/setup-rust-action@v1
- uses: actions-rs/toolchain@v1
with:
rust-version: stable
toolchain: stable
components: clippy
profile: minimal
- uses: actions/checkout@master
- name: warnings
run: RUSTFLAGS="-Dwarnings" cargo check --all
- name: Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all --bins --examples --tests --benches -- -D warnings
5 changes: 0 additions & 5 deletions tracing-attributes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ use syn::{
/// tracing::info!("inside my_function!");
/// // ...
/// }
/// # fn main() {}
/// ```
/// Setting the level for the generated span:
/// ```
Expand All @@ -104,7 +103,6 @@ use syn::{
/// pub fn my_function() {
/// // ...
/// }
/// # fn main() {}
/// ```
/// Overriding the generated span's target:
/// ```
Expand All @@ -113,7 +111,6 @@ use syn::{
/// pub fn my_function() {
/// // ...
/// }
/// # fn main() {}
/// ```
///
/// To skip recording an argument, pass the argument's name to the `skip`:
Expand All @@ -126,7 +123,6 @@ use syn::{
/// fn my_function(arg: usize, non_debug: NonDebug) {
/// // ...
/// }
/// # fn main() {}
/// ```
///
/// If `tracing_futures` is specified as a dependency in `Cargo.toml`,
Expand All @@ -139,7 +135,6 @@ use syn::{
/// // ...
/// # Ok(())
/// }
/// # fn main() {}
/// ```
///
/// [span]: https://docs.rs/tracing/0.1.6/tracing/span/index.html
Expand Down
2 changes: 0 additions & 2 deletions tracing-attributes/test_async_await/tests/async_fn.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(async_await)]

use test_std_future::{
PollN,
block_on_future,
Expand Down
8 changes: 1 addition & 7 deletions tracing-core/src/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@
//! # fn exit(&self, _: &Id) {}
//! # }
//! # impl FooSubscriber { fn new() -> Self { FooSubscriber } }
//! # fn main() {
//! use dispatcher::Dispatch;
//!
//! let my_subscriber = FooSubscriber::new();
//! let my_dispatch = Dispatch::new(my_subscriber);
//! # }
//! ```
//! Then, we can use [`with_default`] to set our `Dispatch` as the default for
//! the duration of a block:
Expand All @@ -63,7 +61,6 @@
//! # fn exit(&self, _: &Id) {}
//! # }
//! # impl FooSubscriber { fn new() -> Self { FooSubscriber } }
//! # fn main() {
//! # let my_subscriber = FooSubscriber::new();
//! # let my_dispatch = dispatcher::Dispatch::new(my_subscriber);
//! // no default subscriber
Expand All @@ -74,7 +71,6 @@
//! });
//!
//! // no default subscriber again
//! # }
//! ```
//! It's important to note that `with_default` will not propagate the current
//! thread's default subscriber to any threads spawned within the `with_default`
Expand All @@ -100,7 +96,6 @@
//! # fn exit(&self, _: &Id) {}
//! # }
//! # impl FooSubscriber { fn new() -> Self { FooSubscriber } }
//! # fn main() {
//! # let my_subscriber = FooSubscriber::new();
//! # let my_dispatch = dispatcher::Dispatch::new(my_subscriber);
//! // no default subscriber
Expand All @@ -111,7 +106,6 @@
//! .expect("global default was already set!");
//!
//! // `my_subscriber` is now the default
//! # }
//! ```
//!
//! **Note**: the thread-local scoped dispatcher (`with_default`) requires the
Expand Down Expand Up @@ -258,7 +252,7 @@ pub fn set_global_default(dispatcher: Dispatch) -> Result<(), SetGlobalDefaultEr
if GLOBAL_INIT.compare_and_swap(UNINITIALIZED, INITIALIZING, Ordering::SeqCst) == UNINITIALIZED
{
unsafe {
GLOBAL_DISPATCH = Some(dispatcher.clone());
GLOBAL_DISPATCH = Some(dispatcher);
}
GLOBAL_INIT.store(INITIALIZED, Ordering::SeqCst);
EXISTS.store(true, Ordering::Release);
Expand Down
4 changes: 0 additions & 4 deletions tracing-core/src/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ pub struct Iter {
/// # extern crate tracing_core as tracing;
/// use std::fmt::{self, Write};
/// use tracing::field::{Value, Visit, Field};
/// # fn main() {
/// pub struct StringVisitor<'a> {
/// string: &'a mut String,
/// }
Expand All @@ -112,7 +111,6 @@ pub struct Iter {
/// write!(self.string, "{} = {:?}; ", field.name(), value).unwrap();
/// }
/// }
/// # }
/// ```
/// This visitor will format each recorded value using `fmt::Debug`, and
/// append the field name and formatted value to the provided string,
Expand All @@ -135,7 +133,6 @@ pub struct Iter {
/// # extern crate tracing_core as tracing;
/// # use std::fmt::{self, Write};
/// # use tracing::field::{Value, Visit, Field};
/// # fn main() {
/// pub struct SumVisitor {
/// sum: i64,
/// }
Expand All @@ -153,7 +150,6 @@ pub struct Iter {
/// // Do nothing
/// }
/// }
/// # }
/// ```
///
/// This visitor (which is probably not particularly useful) keeps a running
Expand Down
1 change: 0 additions & 1 deletion tracing-subscriber/src/field/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ pub trait VisitOutput<Out>: Visit {
/// let mut visitor = MyVisitor::new();
/// r.record(&mut visitor);
/// }
/// # fn main() {}
/// ```
/// [visitor]: https://docs.rs/tracing-core/latest/tracing_core/field/trait.Visit.html
/// [attr]: https://docs.rs/tracing-core/latest/tracing_core/span/struct.Attributes.html
Expand Down
3 changes: 0 additions & 3 deletions tracing-subscriber/src/filter/env/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,8 @@ impl EnvFilter {
/// # Examples
/// ```rust
/// use tracing_subscriber::filter::{EnvFilter, LevelFilter};
/// # fn main() {
/// let mut filter = EnvFilter::from_default_env()
/// .add_directive(LevelFilter::INFO.into());
/// # }
/// ```
/// ```rust
/// use tracing_subscriber::filter::{EnvFilter, Directive};
Expand All @@ -153,7 +151,6 @@ impl EnvFilter {
/// .add_directive("my_crate::my_other_module::something=info".parse()?);
/// # Ok(())
/// # }
/// # fn main() {}
/// ```
pub fn add_directive(mut self, directive: Directive) -> Self {
if let Some(stat) = directive.to_static() {
Expand Down
6 changes: 0 additions & 6 deletions tracing-subscriber/src/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ where
/// ```rust
/// # use tracing_subscriber::layer::Layer;
/// # use tracing_core::Subscriber;
/// # fn main() {
/// pub struct FooLayer {
/// // ...
/// }
Expand Down Expand Up @@ -243,15 +242,13 @@ where
/// let subscriber = FooLayer::new()
/// .and_then(BarLayer::new())
/// .with_subscriber(MySubscriber::new());
/// # }
/// ```
///
/// Multiple layers may be composed in this manner:
///
/// ```rust
/// # use tracing_subscriber::layer::Layer;
/// # use tracing_core::Subscriber;
/// # fn main() {
/// # pub struct FooLayer {}
/// # pub struct BarLayer {}
/// # pub struct MySubscriber {}
Expand Down Expand Up @@ -289,7 +286,6 @@ where
/// .and_then(BarLayer::new())
/// .and_then(BazLayer::new())
/// .with_subscriber(MySubscriber::new());
/// # }
/// ```
fn and_then<L>(self, layer: L) -> Layered<L, Self, S>
where
Expand All @@ -313,7 +309,6 @@ where
/// ```rust
/// # use tracing_subscriber::layer::Layer;
/// # use tracing_core::Subscriber;
/// # fn main() {
/// pub struct FooLayer {
/// // ...
/// }
Expand Down Expand Up @@ -344,7 +339,6 @@ where
/// # }
/// let subscriber = FooLayer::new()
/// .with_subscriber(MySubscriber::new());
/// # }
///```
///
/// [`Subscriber`]: https://docs.rs/tracing-core/latest/tracing_core/trait.Subscriber.html
Expand Down
4 changes: 0 additions & 4 deletions tracing-subscriber/src/registry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
//! ```rust
//! use tracing_subscriber::{registry::Registry, Layer};
//! # use tracing_core::Subscriber;
//! # fn main() {
//! # pub struct FooLayer {}
//! # pub struct BarLayer {}
//! # impl<S: Subscriber> Layer<S> for FooLayer {}
Expand All @@ -31,7 +30,6 @@
//! let subscriber = FooLayer::new()
//! .and_then(BarLayer::new())
//! .with_subscriber(Registry::default());
//! # }
//! ```
//!
//! If a type implementing `Layer` depends on the functionality of a `Registry`
Expand All @@ -42,7 +40,6 @@
//! use tracing_subscriber::{registry, Layer};
//! use tracing_core::Subscriber;
//!
//! # fn main() {
//! pub struct MyLayer {
//! // ...
//! }
Expand All @@ -53,7 +50,6 @@
//! {
//! // ...
//! }
//! # }
//! ```
//! When this bound is added, the `Layer` implementation will be guaranteed
//! access to the [`Context`][ctx] methods, such as [`Context::span`][lookup], that
Expand Down
Loading