diff --git a/Cargo.toml b/Cargo.toml index 2b529b18b9..4fe0328ddc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,3 +40,12 @@ ci = ["github"] installers = ["shell"] # Target platforms to build apps for (Rust target-triple syntax) targets = ["x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "aarch64-apple-darwin"] + +[workspace.lints.rust] +unsafe_code = "forbid" +missing_docs = "deny" + +[workspace.lints.clippy] +unwrap_used = "forbid" +result_large_err = "allow" +indexing_slicing = "deny" \ No newline at end of file diff --git a/flowc/Cargo.toml b/flowc/Cargo.toml index a0a564f0ef..6aaaf260e0 100644 --- a/flowc/Cargo.toml +++ b/flowc/Cargo.toml @@ -9,6 +9,7 @@ homepage.workspace = true repository.workspace = true readme = "README.md" edition.workspace = true +lints.workspace = true [badges] maintenance = { status = "actively-developed" } diff --git a/flowc/src/bin/flowc/main.rs b/flowc/src/bin/flowc/main.rs index c4769bfa3d..b9ac06ab7e 100644 --- a/flowc/src/bin/flowc/main.rs +++ b/flowc/src/bin/flowc/main.rs @@ -1,6 +1,3 @@ -#![deny(missing_docs)] -#![warn(clippy::unwrap_used)] -#![allow(clippy::result_large_err)] //! `flowc` is a "flow compiler" that takes a hierarchical description of a flow //! using [flow definitions][flowcore::model::flow_definition::FlowDefinition], //! [function definitions][flowcore::model::function_definition::FunctionDefinition] and @@ -18,7 +15,7 @@ use std::process::exit; use clap::{Arg, ArgMatches, Command}; use env_logger::Builder; -use log::{debug, error, info, LevelFilter, warn}; +use log::{debug, error, info, LevelFilter}; use serde_derive::Deserialize; use simpath::Simpath; use url::Url; diff --git a/flowcore/Cargo.toml b/flowcore/Cargo.toml index 327aa8466a..12d87b5d64 100644 --- a/flowcore/Cargo.toml +++ b/flowcore/Cargo.toml @@ -9,6 +9,7 @@ homepage.workspace = true repository.workspace = true readme = "README.md" edition.workspace = true +lints.workspace = true # Files to exclude from packaging and publishing exclude = [".gitignore", "Cargo.lock"] diff --git a/flowcore/src/lib.rs b/flowcore/src/lib.rs index 30258c1423..2592ece37c 100644 --- a/flowcore/src/lib.rs +++ b/flowcore/src/lib.rs @@ -1,6 +1,3 @@ -#![deny(missing_docs)] -#![warn(clippy::unwrap_used)] - //! `flowcore` defines core structs and traits used by other flow libraries and implementations use serde_json::Value; diff --git a/flowmacro/Cargo.toml b/flowmacro/Cargo.toml index 3c4f4376e6..66eb863a7b 100644 --- a/flowmacro/Cargo.toml +++ b/flowmacro/Cargo.toml @@ -9,6 +9,7 @@ homepage.workspace = true repository = "https://github.com/andrewdavidmackenzie/flow/" readme = "README.md" edition.workspace = true +lints.workspace = true [badges] maintenance = { status = "actively-developed" } diff --git a/flowmacro/src/lib.rs b/flowmacro/src/lib.rs index a2f19d9d1d..584579b788 100644 --- a/flowmacro/src/lib.rs +++ b/flowmacro/src/lib.rs @@ -1,4 +1,3 @@ -#![deny(missing_docs)] #![feature(proc_macro_span)] //! `flow_function` is a `proc_macro_attribute` macro that wraps a `fn` with a struct and a method //! to implement the [Implementation][flowcore::Implementation] trait, so it can be used as the diff --git a/flowr/Cargo.toml b/flowr/Cargo.toml index 17eccfa725..42efac2856 100644 --- a/flowr/Cargo.toml +++ b/flowr/Cargo.toml @@ -9,6 +9,7 @@ homepage.workspace = true repository.workspace = true readme = "README.md" edition.workspace = true +lints.workspace = true [badges] maintenance = { status = "actively-developed" } diff --git a/flowr/src/bin/flowrcli/main.rs b/flowr/src/bin/flowrcli/main.rs index ec4a2628cf..6cd094f1e9 100644 --- a/flowr/src/bin/flowrcli/main.rs +++ b/flowr/src/bin/flowrcli/main.rs @@ -1,5 +1,3 @@ -#![deny(missing_docs)] -#![forbid(clippy::unwrap_used)] //! `flowr` is a command line flow runner for running `flow` programs. //! //! It reads a compiled [FlowManifest][flowcore::model::flow_manifest::FlowManifest] produced by a diff --git a/flowr/src/bin/flowrex/main.rs b/flowr/src/bin/flowrex/main.rs index d3a5e3d902..fa8ad689d6 100644 --- a/flowr/src/bin/flowrex/main.rs +++ b/flowr/src/bin/flowrex/main.rs @@ -1,5 +1,3 @@ -#![deny(missing_docs)] -#![warn(clippy::unwrap_used)] //! `flowrex` is the minimal executor of flow jobs. It loads a native version of 'flowstdlib' //! flow library to allow execution of jobs using functions provided by 'flowstdlib', but it does //! *not* load 'context' and hence will not execute any jobs interacting with the context. @@ -16,7 +14,7 @@ use std::sync::Arc; use clap::{Arg, ArgMatches, Command}; use env_logger::Builder; -use log::{error, info, LevelFilter, trace, warn}; +use log::{error, info, LevelFilter, trace}; use simpath::Simpath; use simpdiscoverylib::BeaconListener; #[cfg(feature = "flowstdlib")] diff --git a/flowr/src/bin/flowrgui/main.rs b/flowr/src/bin/flowrgui/main.rs index db9bb9f727..5138b49905 100644 --- a/flowr/src/bin/flowrgui/main.rs +++ b/flowr/src/bin/flowrgui/main.rs @@ -1,6 +1,3 @@ -#![warn(clippy::unwrap_used)] -#![deny(missing_docs)] -// TODO re-instate #![warn(clippy::unwrap_used)] //! `flowrgui` is a GUI flow runner for running `flow` programs. //! //! It reads a compiled [FlowManifest][flowcore::model::flow_manifest::FlowManifest] produced by a @@ -38,7 +35,7 @@ use iced::widget::{Button, Column, Row, scrollable, Text, text_input}; use iced::widget::scrollable::Id; use iced_aw::{Card, modal}; use image::{ImageBuffer, Rgba, RgbaImage}; -use log::{info, LevelFilter, warn}; +use log::{info, LevelFilter}; use simpath::Simpath; use url::Url; diff --git a/flowr/src/lib/lib.rs b/flowr/src/lib/lib.rs index 4febdc625a..62bb24bc81 100644 --- a/flowr/src/lib/lib.rs +++ b/flowr/src/lib/lib.rs @@ -1,6 +1,3 @@ -#![deny(missing_docs)] -#![deny(clippy::unwrap_used)] -#![deny(clippy::indexing_slicing)] //! `flowrlib` is the runtime library for flow execution. This can be used to produce a flow runner, //! such as the `flowr` command line runner. //! diff --git a/flowstdlib/Cargo.toml b/flowstdlib/Cargo.toml index 5dd283cb45..16aa28e291 100644 --- a/flowstdlib/Cargo.toml +++ b/flowstdlib/Cargo.toml @@ -4,13 +4,14 @@ name = "flowstdlib" description = "The standard library of functions and flows for 'flow' programs" version = "0.142.0" authors = ["Andrew Mackenzie "] -# Inherit the others that is not parsed by flowc +# Inherit the other keys that are not parsed by flowc itself license.workspace = true documentation.workspace = true homepage.workspace = true repository.workspace = true readme = "README.md" edition.workspace = true +lints.workspace = true [badges] maintenance = { status = "actively-developed" } diff --git a/flowstdlib/src/lib.rs b/flowstdlib/src/lib.rs index 614f58cd3b..a99302ed92 100644 --- a/flowstdlib/src/lib.rs +++ b/flowstdlib/src/lib.rs @@ -1,5 +1,3 @@ -#![deny(missing_docs)] -#![warn(clippy::unwrap_used)] //! `flowstdlib` is a library of flows and functions that can be used from flows. //! //! The flow and function definition are used at compile time when compile flows that reference