From c5fa90176cdbaef19244fe13721a86f081848af3 Mon Sep 17 00:00:00 2001 From: Ana Gelez Date: Fri, 31 Jan 2020 08:25:25 +0100 Subject: [PATCH] Add a "ci" feature to make clippy ignore docs warnings --- .circleci/config.yml | 2 +- Cargo.toml | 1 + plume-api/Cargo.toml | 3 +++ plume-api/src/lib.rs | 2 +- plume-cli/Cargo.toml | 1 + plume-cli/src/main.rs | 3 ++- plume-common/Cargo.toml | 3 +++ plume-common/src/lib.rs | 2 +- plume-front/Cargo.toml | 3 +++ plume-front/src/main.rs | 2 +- plume-macro/Cargo.toml | 1 + plume-macro/src/lib.rs | 2 +- plume-models/Cargo.toml | 1 + plume-models/src/lib.rs | 2 +- src/main.rs | 1 + 15 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 63f56678..55c63f21 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,7 +19,7 @@ executors: working_directory: ~/projects/Plume environment: RUST_TEST_THREADS: 1 - FEATURES: <<#parameters.postgres>>postgres<><<^parameters.postgres>>sqlite<> + FEATURES: <<#parameters.postgres>>postgres<><<^parameters.postgres>>sqlite<> ci DATABASE_URL: <<#parameters.postgres>>postgres://postgres@localhost/plume<><<^parameters.postgres>>plume.sqlite<> diff --git a/Cargo.toml b/Cargo.toml index 27994771..d128fc14 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,6 +79,7 @@ postgres = ["plume-models/postgres", "diesel/postgres"] sqlite = ["plume-models/sqlite", "diesel/sqlite"] debug-mailer = [] test = [] +ci = ["plume-models/ci", "plume-api/ci", "plume-common/ci"] [workspace] members = ["plume-api", "plume-cli", "plume-models", "plume-common", "plume-front", "plume-macro"] diff --git a/plume-api/Cargo.toml b/plume-api/Cargo.toml index ce51cc54..d1bbfc24 100644 --- a/plume-api/Cargo.toml +++ b/plume-api/Cargo.toml @@ -7,3 +7,6 @@ edition = "2018" [dependencies] serde = "1.0" serde_derive = "1.0" + +[features] +ci = [] diff --git a/plume-api/src/lib.rs b/plume-api/src/lib.rs index e421b65e..eca93180 100644 --- a/plume-api/src/lib.rs +++ b/plume-api/src/lib.rs @@ -1,4 +1,4 @@ -#![warn(missing_docs)] +#![cfg_attr(not(feature = "ci"), warn(missing_docs))] #[macro_use] extern crate serde_derive; diff --git a/plume-cli/Cargo.toml b/plume-cli/Cargo.toml index 4c6bc76f..c03f4d93 100644 --- a/plume-cli/Cargo.toml +++ b/plume-cli/Cargo.toml @@ -23,3 +23,4 @@ path = "../plume-models" [features] postgres = ["plume-models/postgres", "diesel/postgres"] sqlite = ["plume-models/sqlite", "diesel/sqlite"] +ci = ["plume-models/ci"] diff --git a/plume-cli/src/main.rs b/plume-cli/src/main.rs index 8dc11692..7b883eec 100644 --- a/plume-cli/src/main.rs +++ b/plume-cli/src/main.rs @@ -1,7 +1,8 @@ -use dotenv; +#![cfg_attr(not(feature = "ci"), warn(missing_docs))] use clap::App; use diesel::Connection; +use dotenv; use plume_models::{instance::Instance, Connection as Conn, CONFIG}; use std::io::{self, prelude::*}; diff --git a/plume-common/Cargo.toml b/plume-common/Cargo.toml index 6c7e02ff..b1456e54 100644 --- a/plume-common/Cargo.toml +++ b/plume-common/Cargo.toml @@ -30,3 +30,6 @@ version = "0.4" [dependencies.pulldown-cmark] default-features = false version = "0.2.0" + +[features] +ci = [] diff --git a/plume-common/src/lib.rs b/plume-common/src/lib.rs index db4afe02..7227afd4 100644 --- a/plume-common/src/lib.rs +++ b/plume-common/src/lib.rs @@ -1,4 +1,4 @@ -#![warn(missing_docs)] +#![cfg_attr(not(feature = "ci"), warn(missing_docs))] #![feature(associated_type_defaults)] #[macro_use] diff --git a/plume-front/Cargo.toml b/plume-front/Cargo.toml index 90a89a5b..a132c3a6 100644 --- a/plume-front/Cargo.toml +++ b/plume-front/Cargo.toml @@ -13,3 +13,6 @@ gettext-utils = { git = "https://github.com/Plume-org/gettext-macros/", rev = "a lazy_static = "1.3" serde = "1.0" serde_json = "1.0" + +[features] +ci = [] diff --git a/plume-front/src/main.rs b/plume-front/src/main.rs index c6214e4b..bde4edaa 100644 --- a/plume-front/src/main.rs +++ b/plume-front/src/main.rs @@ -1,6 +1,6 @@ #![recursion_limit = "128"] #![feature(decl_macro, proc_macro_hygiene, try_trait)] -#![warn(missing_docs)] +#![cfg_attr(not(feature = "ci"), warn(missing_docs))] #[macro_use] extern crate gettext_macros; diff --git a/plume-macro/Cargo.toml b/plume-macro/Cargo.toml index c5657377..7c6c9f51 100644 --- a/plume-macro/Cargo.toml +++ b/plume-macro/Cargo.toml @@ -19,3 +19,4 @@ syn = "0.15.27" default = [] postgres = [] sqlite = [] +ci = [] diff --git a/plume-macro/src/lib.rs b/plume-macro/src/lib.rs index 0e104be4..d894ee98 100644 --- a/plume-macro/src/lib.rs +++ b/plume-macro/src/lib.rs @@ -1,5 +1,5 @@ #![recursion_limit = "128"] -#![warn(missing_docs)] +#![cfg_attr(not(feature = "ci"), warn(missing_docs))] #[macro_use] extern crate quote; diff --git a/plume-models/Cargo.toml b/plume-models/Cargo.toml index d122187c..5ac808e0 100644 --- a/plume-models/Cargo.toml +++ b/plume-models/Cargo.toml @@ -54,3 +54,4 @@ diesel_migrations = "1.3.0" [features] postgres = ["diesel/postgres", "plume-macro/postgres" ] sqlite = ["diesel/sqlite", "plume-macro/sqlite" ] +ci = ["plume-macro/ci"] diff --git a/plume-models/src/lib.rs b/plume-models/src/lib.rs index 3eebfff2..6cd35ac0 100644 --- a/plume-models/src/lib.rs +++ b/plume-models/src/lib.rs @@ -1,7 +1,7 @@ #![feature(try_trait)] #![feature(never_type)] #![feature(proc_macro_hygiene)] -#![warn(missing_docs)] +#![cfg_attr(not(feature = "ci"), warn(missing_docs))] #[macro_use] extern crate diesel; diff --git a/src/main.rs b/src/main.rs index 5016e982..fb967f10 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ #![allow(clippy::too_many_arguments)] +#![cfg_attr(not(feature = "ci"), warn(missing_docs))] #![feature(decl_macro, proc_macro_hygiene, try_trait)] #[macro_use]