From 97df91683bcaf87f0111c4938ba6a88afbfda462 Mon Sep 17 00:00:00 2001
From: librelois <elois@ifee.fr>
Date: Mon, 14 May 2018 16:56:52 +0200
Subject: [PATCH] Add feature strict into all crates

---
 .gitlab-ci.yml     | 11 +++++++----
 Cargo.toml         |  4 ++++
 conf/Cargo.toml    |  6 +++++-
 conf/lib.rs        |  1 -
 core/Cargo.toml    |  6 +++++-
 dal/Cargo.toml     |  4 +++-
 message/Cargo.toml |  6 +++++-
 module/Cargo.toml  |  6 +++++-
 network/Cargo.toml |  6 +++++-
 tui/Cargo.toml     |  6 +++++-
 ws2p/Cargo.toml    |  6 +++++-
 11 files changed, 49 insertions(+), 13 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f4d5fb44..27e48119 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -11,8 +11,9 @@ build_and_tests:stable:
   stage: build_and_tests
   tags:
     - redshift-rs-stable
-  script:
-    - cargo test --all-features
+  script: 
+    - cargo build --features strict
+    - cargo test --all
     
 build_and_tests:beta:
   stage: build_and_tests
@@ -20,7 +21,8 @@ build_and_tests:beta:
     - redshift-rs-beta
   script:
     - rustup update
-    - cargo test --all-features
+    - cargo build --features strict
+    - cargo test --all
   when: manual
   allow_failure: true
     
@@ -30,7 +32,8 @@ build_and_tests:nightly:
   tags:
     - redshift-rs-nightly
   script:
-    - cargo test --all-features
+    - cargo build --features strict
+    - cargo test --all
   when: manual
   allow_failure: true
   
diff --git a/Cargo.toml b/Cargo.toml
index dfae0a05..4f26b8dc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,6 +14,10 @@ lazy_static = "1.0.0"
 serde_json = "1.0.9"
 websocket = "0.20.2"
 
+[features]
+# Treat warnings as a build error.
+strict = []
+
 [workspace]
 members = [
     "blockchain",
diff --git a/conf/Cargo.toml b/conf/Cargo.toml
index 681eccd4..433ccf6d 100644
--- a/conf/Cargo.toml
+++ b/conf/Cargo.toml
@@ -14,4 +14,8 @@ serde = "1.0.24"
 serde_derive = "1.0.24"
 serde_json = "1.0.9"
 duniter-crypto = { path = "../crypto" }
-duniter-module = { path = "../module" }
\ No newline at end of file
+duniter-module = { path = "../module" }
+
+[features]
+# Treat warnings as a build error.
+strict = []
\ No newline at end of file
diff --git a/conf/lib.rs b/conf/lib.rs
index 482946a3..bf941893 100644
--- a/conf/lib.rs
+++ b/conf/lib.rs
@@ -354,7 +354,6 @@ pub fn get_wot_path(profile: String, currency: &Currency) -> PathBuf {
 #[cfg(test)]
 mod tests {
     use super::*;
-    use duniter_module::ModuleId;
 
     #[test]
     fn load_conf_file() {
diff --git a/core/Cargo.toml b/core/Cargo.toml
index c25218b5..d2a02d38 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -25,4 +25,8 @@ serde_derive = "1.0.24"
 serde_json = "1.0.9"
 simplelog = "0.5.1"
 sqlite = "0.23.9"
-threadpool = "1.7.1"
\ No newline at end of file
+threadpool = "1.7.1"
+
+[features]
+# Treat warnings as a build error.
+strict = []
\ No newline at end of file
diff --git a/dal/Cargo.toml b/dal/Cargo.toml
index a3ecdaa1..a7a36783 100644
--- a/dal/Cargo.toml
+++ b/dal/Cargo.toml
@@ -26,4 +26,6 @@ serde_json = "1.0.9"
 websocket = "0.20.2"
 
 [features]
-exp = []
\ No newline at end of file
+exp = []
+# Treat warnings as a build error.
+strict = []
\ No newline at end of file
diff --git a/message/Cargo.toml b/message/Cargo.toml
index 651db081..eb558403 100644
--- a/message/Cargo.toml
+++ b/message/Cargo.toml
@@ -16,4 +16,8 @@ duniter-module = { path = "../module" }
 duniter-network = { path = "../network" }
 serde = "1.0.24"
 serde_derive = "1.0.24"
-serde_json = "1.0.9"
\ No newline at end of file
+serde_json = "1.0.9"
+
+[features]
+# Treat warnings as a build error.
+strict = []
\ No newline at end of file
diff --git a/module/Cargo.toml b/module/Cargo.toml
index 8646dbde..bfc08e52 100644
--- a/module/Cargo.toml
+++ b/module/Cargo.toml
@@ -13,4 +13,8 @@ duniter-crypto = { path = "../crypto" }
 duniter-documents = { path = "../documents" }
 serde = "1.0.24"
 serde_derive = "1.0.24"
-serde_json = "1.0.9"
\ No newline at end of file
+serde_json = "1.0.9"
+
+[features]
+# Treat warnings as a build error.
+strict = []
\ No newline at end of file
diff --git a/network/Cargo.toml b/network/Cargo.toml
index 15c8ac50..ab7bd3ac 100644
--- a/network/Cargo.toml
+++ b/network/Cargo.toml
@@ -17,4 +17,8 @@ regex = "0.2.6"
 rust-crypto = "0.2.36"
 serde = "1.0.24"
 serde_derive = "1.0.24"
-serde_json = "1.0.9"
\ No newline at end of file
+serde_json = "1.0.9"
+
+[features]
+# Treat warnings as a build error.
+strict = []
\ No newline at end of file
diff --git a/tui/Cargo.toml b/tui/Cargo.toml
index 28195a29..d415aca5 100644
--- a/tui/Cargo.toml
+++ b/tui/Cargo.toml
@@ -19,4 +19,8 @@ duniter-module = { path = "../module" }
 duniter-network = { path = "../network" }
 log = "0.4.1"
 serde_json = "1.0.9"
-termion = "1.5.1"
\ No newline at end of file
+termion = "1.5.1"
+
+[features]
+# Treat warnings as a build error.
+strict = []
\ No newline at end of file
diff --git a/ws2p/Cargo.toml b/ws2p/Cargo.toml
index e0fb2f4c..955f268c 100644
--- a/ws2p/Cargo.toml
+++ b/ws2p/Cargo.toml
@@ -26,4 +26,8 @@ sqlite = "0.23.9"
 serde = "1.0.24"
 serde_derive = "1.0.24"
 serde_json = "1.0.9"
-websocket = "0.20.2"
\ No newline at end of file
+websocket = "0.20.2"
+
+[features]
+# Treat warnings as a build error.
+strict = []
\ No newline at end of file
-- 
GitLab