diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-12-04 11:49:33 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-12-07 13:21:54 +0100 |
commit | a0235c900b052f31b221d7c0994598c014b1b791 (patch) | |
tree | cfecfa88cd12bfdec2a4125caa37c55699882221 /src | |
parent | b653c3377c37458e23e837f54f5e597bf07641ba (diff) |
Deny macro_use from external crate
Diesel is an exception here, because the generated src/schema.rs file
does not automatically contain the necessary imports.
All imports were added where necessary.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/commands/build.rs | 4 | ||||
-rw-r--r-- | src/commands/db.rs | 1 | ||||
-rw-r--r-- | src/commands/dependencies_of.rs | 1 | ||||
-rw-r--r-- | src/commands/env_of.rs | 1 | ||||
-rw-r--r-- | src/commands/find_pkg.rs | 1 | ||||
-rw-r--r-- | src/commands/release.rs | 3 | ||||
-rw-r--r-- | src/commands/source.rs | 1 | ||||
-rw-r--r-- | src/commands/versions_of.rs | 1 | ||||
-rw-r--r-- | src/commands/what_depends.rs | 1 | ||||
-rw-r--r-- | src/db/connection.rs | 1 | ||||
-rw-r--r-- | src/db/models/job.rs | 1 | ||||
-rw-r--r-- | src/endpoint/configured.rs | 1 | ||||
-rw-r--r-- | src/endpoint/scheduler.rs | 1 | ||||
-rw-r--r-- | src/filestore/merged.rs | 2 | ||||
-rw-r--r-- | src/filestore/staging.rs | 1 | ||||
-rw-r--r-- | src/job/runnable.rs | 1 | ||||
-rw-r--r-- | src/job/set.rs | 1 | ||||
-rw-r--r-- | src/main.rs | 6 | ||||
-rw-r--r-- | src/orchestrator/orchestrator.rs | 1 | ||||
-rw-r--r-- | src/package/tree.rs | 1 | ||||
-rw-r--r-- | src/ui.rs | 1 | ||||
-rw-r--r-- | src/util/docker.rs | 3 | ||||
-rw-r--r-- | src/util/filters.rs | 1 | ||||
-rw-r--r-- | src/util/git.rs | 1 |
24 files changed, 31 insertions, 6 deletions
diff --git a/src/commands/build.rs b/src/commands/build.rs index 0568790..757a9d3 100644 --- a/src/commands/build.rs +++ b/src/commands/build.rs @@ -9,9 +9,9 @@ use anyhow::Result; use anyhow::anyhow; use clap::ArgMatches; use diesel::PgConnection; -use logcrate::debug; -use tokio::sync::RwLock; +use log::{debug, info, warn, trace}; use tokio::stream::StreamExt; +use tokio::sync::RwLock; use crate::config::*; use crate::filestore::ReleaseStore; diff --git a/src/commands/db.rs b/src/commands/db.rs index fc6c821..3c0a040 100644 --- a/src/commands/db.rs +++ b/src/commands/db.rs @@ -14,6 +14,7 @@ use diesel::ExpressionMethods; use diesel::QueryDsl; use diesel::RunQueryDsl; use itertools::Itertools; +use log::info; use syntect::easy::HighlightLines; use syntect::highlighting::{ThemeSet, Style}; use syntect::parsing::SyntaxSet; diff --git a/src/commands/dependencies_of.rs b/src/commands/dependencies_of.rs index db0e3f9..2ac330c 100644 --- a/src/commands/dependencies_of.rs +++ b/src/commands/dependencies_of.rs @@ -1,5 +1,6 @@ use anyhow::Result; use clap::ArgMatches; +use log::trace; use crate::commands::util::getbool; use crate::config::*; diff --git a/src/commands/env_of.rs b/src/commands/env_of.rs index 4a56db1..72fc02d 100644 --- a/src/commands/env_of.rs +++ b/src/commands/env_of.rs @@ -1,5 +1,6 @@ use anyhow::Result; use clap::ArgMatches; +use log::trace; use crate::package::PackageName; use crate::package::PackageVersionConstraint; diff --git a/src/commands/find_pkg.rs b/src/commands/find_pkg.rs index c1f4a91..bca8086 100644 --- a/src/commands/find_pkg.rs +++ b/src/commands/find_pkg.rs @@ -1,6 +1,7 @@ use anyhow::Error; use anyhow::Result; use clap::ArgMatches; +use log::trace; use crate::config::Configuration; use crate::package::Package; diff --git a/src/commands/release.rs b/src/commands/release.rs index 52693d3..023a555 100644 --- a/src/commands/release.rs +++ b/src/commands/release.rs @@ -4,8 +4,9 @@ use anyhow::Error; use anyhow::Result; use anyhow::anyhow; use clap::ArgMatches; -use tokio::stream::StreamExt; use diesel::prelude::*; +use log::{debug, trace}; +use tokio::stream::StreamExt; use crate::db::models as dbmodels; use crate::config::Configuration; diff --git a/src/commands/source.rs b/src/commands/source.rs index 02cbccc..343581e 100644 --- a/src/commands/source.rs +++ b/src/commands/source.rs @@ -5,6 +5,7 @@ use anyhow::Error; use anyhow::Result; use anyhow::anyhow; use clap::ArgMatches; +use log::trace; use tokio::stream::StreamExt; use tokio::io::AsyncWriteExt; diff --git a/src/commands/versions_of.rs b/src/commands/versions_of.rs index 940ded3..1393468 100644 --- a/src/commands/versions_of.rs +++ b/src/commands/versions_of.rs @@ -1,6 +1,7 @@ use anyhow::Error; use anyhow::Result; use clap::ArgMatches; +use log::trace; use crate::package::PackageName; use crate::repository::Repository; diff --git a/src/commands/what_depends.rs b/src/commands/what_depends.rs index 0204251..6820c0d 100644 --- a/src/commands/what_depends.rs +++ b/src/commands/what_depends.rs @@ -1,5 +1,6 @@ use anyhow::Result; use clap::ArgMatches; +use log::trace; use resiter::Filter; use resiter::Map; diff --git a/src/db/connection.rs b/src/db/connection.rs index 33f5496..98c24ce 100644 --- a/src/db/connection.rs +++ b/src/db/connection.rs @@ -4,6 +4,7 @@ use clap::ArgMatches; use diesel::pg::PgConnection; use diesel::prelude::*; use getset::Getters; +use log::debug; use crate::config::Configuration; diff --git a/src/db/models/job.rs b/src/db/models/job.rs index 90d9732..4d80637 100644 --- a/src/db/models/job.rs +++ b/src/db/models/job.rs @@ -2,6 +2,7 @@ use anyhow::Error; use anyhow::Result; use diesel::PgConnection; use diesel::prelude::*; +use log::trace; use crate::db::models::{Submit, Endpoint, Package, Image}; use crate::package::Script; diff --git a/src/endpoint/configured.rs b/src/endpoint/configured.rs index 2d6ee44..32a18fd 100644 --- a/src/endpoint/configured.rs +++ b/src/endpoint/configured.rs @@ -10,6 +10,7 @@ use anyhow::Result; use anyhow::anyhow; use futures::FutureExt; use getset::{Getters, CopyGetters}; +use log::{warn, trace}; use shiplift::Docker; use shiplift::ExecContainerOptions; use tokio::stream::StreamExt; diff --git a/src/endpoint/scheduler.rs b/src/endpoint/scheduler.rs index 58c06c6..a57dd22 100644 --- a/src/endpoint/scheduler.rs +++ b/src/endpoint/scheduler.rs @@ -10,6 +10,7 @@ use diesel::PgConnection; use futures::FutureExt; use indicatif::ProgressBar; use itertools::Itertools; +use log::trace; use tokio::stream::StreamExt; use tokio::io::AsyncWriteExt; use tokio::sync::RwLock; diff --git a/src/filestore/merged.rs b/src/filestore/merged.rs index 9cd5c1b..396a85c 100644 --- a/src/filestore/merged.rs +++ b/src/filestore/merged.rs @@ -1,4 +1,6 @@ use std::sync::Arc; + +use log::trace; use tokio::sync::RwLock; use anyhow::Result; diff --git a/src/filestore/staging.rs b/src/filestore/staging.rs index 26f91a8..cbc8732 100644 --- a/src/filestore/staging.rs +++ b/src/filestore/staging.rs @@ -8,6 +8,7 @@ use anyhow::Result; use anyhow::anyhow; use futures::stream::Stream; use indicatif::ProgressBar; +use log::trace; use result_inspect::ResultInspect; use tar; diff --git a/src/job/runnable.rs b/src/job/runnable.rs index 5e6387a..de5b32d 100644 --- a/src/job/runnable.rs +++ b/src/job/runnable.rs @@ -3,6 +3,7 @@ use anyhow::Error; use anyhow::Result; use anyhow::anyhow; use getset::Getters; +use log::{warn, trace}; use tokio::stream::StreamExt; use uuid::Uuid; diff --git a/src/job/set.rs b/src/job/set.rs index 233110a..56485b4 100644 --- a/src/job/set.rs +++ b/src/job/set.rs @@ -1,4 +1,5 @@ use anyhow::Result; +use log::{debug, trace}; use tokio::stream::StreamExt; use crate::config::Configuration; diff --git a/src/main.rs b/src/main.rs index 23d0c9f..4a3c2e0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,7 @@ deprecated_in_future, explicit_outlives_requirements, keyword_idents, - // macro_use_extern_crate, + macro_use_extern_crate, // missing_copy_implementations, // missing_debug_implementations, non_ascii_idents, @@ -25,7 +25,9 @@ while_true, )] -#[macro_use] extern crate log as logcrate; +extern crate log as logcrate; + +#[allow(macro_use_extern_crate)] #[macro_use] extern crate diesel; use std::path::Path; diff --git a/src/orchestrator/orchestrator.rs b/src/orchestrator/orchestrator.rs index c6bcc77..b5bac4c 100644 --- a/src/orchestrator/orchestrator.rs +++ b/src/orchestrator/orchestrator.rs @@ -8,6 +8,7 @@ use anyhow::Error; use anyhow::Result; use anyhow::anyhow; use diesel::PgConnection; +use log::trace; use tokio::sync::RwLock; use typed_builder::TypedBuilder; diff --git a/src/package/tree.rs b/src/package/tree.rs index b86c24c..5adfcf2 100644 --- a/src/package/tree.rs +++ b/src/package/tree.rs @@ -1,6 +1,7 @@ use anyhow::Result; use anyhow::anyhow; use indicatif::ProgressBar; +use log::trace; use resiter::AndThen; use serde::Deserialize; use serde::Serialize; @@ -7,6 +7,7 @@ use std::path::Path; use anyhow::Error; use anyhow::Result; use anyhow::anyhow; +use log::error; use handlebars::Handlebars; use crate::package::Package; diff --git a/src/util/docker.rs b/src/util/docker.rs index 3c0514c..08f069b 100644 --- a/src/util/docker.rs +++ b/src/util/docker.rs @@ -78,7 +78,8 @@ pub fn is_valid_tag_name(s: &str) -> Result<()> { #[cfg(test)] mod docker_test { - extern crate env_logger; + use log::debug; + fn setup_logging() { let _ = env_logger::try_init(); } diff --git a/src/util/filters.rs b/src/util/filters.rs index 32bb4f7..59c4d67 100644 --- a/src/util/filters.rs +++ b/src/util/filters.rs @@ -1,6 +1,7 @@ use anyhow::Error; use anyhow::Result; use filters::failable::filter::FailableFilter; +use log::trace; use resiter::Map; use crate::package::Package; diff --git a/src/util/git.rs b/src/util/git.rs index 4defb26..7a13a05 100644 --- a/src/util/git.rs +++ b/src/util/git.rs @@ -5,6 +5,7 @@ use anyhow::Error; use anyhow::Result; use anyhow::anyhow; use git2::Repository; +use log::trace; pub fn repo_is_clean(p: &Path) -> Result<bool> { Repository::open(p) |