Skip to content

Commit

Permalink
workspace lints (#2115)
Browse files Browse the repository at this point in the history
* Small reduction in compile time

* Try workspace lints
  • Loading branch information
andrewdavidmackenzie authored Jan 3, 2024
1 parent 6928ea4 commit 8ea9f86
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 23 deletions.
9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
1 change: 1 addition & 0 deletions flowc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ homepage.workspace = true
repository.workspace = true
readme = "README.md"
edition.workspace = true
lints.workspace = true

[badges]
maintenance = { status = "actively-developed" }
Expand Down
5 changes: 1 addition & 4 deletions flowc/src/bin/flowc/main.rs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions flowcore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
3 changes: 0 additions & 3 deletions flowcore/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 1 addition & 0 deletions flowmacro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
1 change: 0 additions & 1 deletion flowmacro/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions flowr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ homepage.workspace = true
repository.workspace = true
readme = "README.md"
edition.workspace = true
lints.workspace = true

[badges]
maintenance = { status = "actively-developed" }
Expand Down
2 changes: 0 additions & 2 deletions flowr/src/bin/flowrcli/main.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 1 addition & 3 deletions flowr/src/bin/flowrex/main.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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")]
Expand Down
5 changes: 1 addition & 4 deletions flowr/src/bin/flowrgui/main.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;

Expand Down
3 changes: 0 additions & 3 deletions flowr/src/lib/lib.rs
Original file line number Diff line number Diff line change
@@ -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.
//!
Expand Down
3 changes: 2 additions & 1 deletion flowstdlib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ name = "flowstdlib"
description = "The standard library of functions and flows for 'flow' programs"
version = "0.142.0"
authors = ["Andrew Mackenzie <andrew@mackenzie-serres.net>"]
# 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" }
Expand Down
2 changes: 0 additions & 2 deletions flowstdlib/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 8ea9f86

Please sign in to comment.