Introduce workspace-level lints (#2166)

Reduce the cost of adding a lint from O(#workspace_crates) to 1.
This commit is contained in:
Thibaut Schaeffer
2024-11-29 15:02:53 +01:00
committed by GitHub
parent 23e92a0882
commit c0fefae3e7
37 changed files with 40 additions and 69 deletions

View File

@@ -81,3 +81,7 @@ codegen-units = 256
[profile.release-with-debug]
inherits = "release"
debug = true
[workspace.lints.clippy]
print_stdout = "deny"
uninlined_format_args = "deny"

View File

@@ -16,5 +16,5 @@ log = "0.4.17"
itertools = "0.13"
[lints.clippy]
uninlined_format_args = "deny"
[lints]
workspace = true

View File

@@ -1,7 +1,5 @@
//! Compilation from powdr machines to AIRs
#![deny(clippy::print_stdout)]
use std::collections::BTreeMap;
use powdr_ast::{

View File

@@ -26,5 +26,5 @@ env_logger = "0.10.0"
[package.metadata.cargo-udeps.ignore]
development = ["env_logger"]
[lints.clippy]
uninlined_format_args = "deny"
[lints]
workspace = true

View File

@@ -1,5 +1,3 @@
#![deny(clippy::print_stdout)]
pub mod machine_check;
mod vm;

View File

@@ -1,5 +1,3 @@
#![deny(clippy::print_stdout)]
use std::collections::BTreeMap;
use powdr_ast::{

View File

@@ -21,5 +21,5 @@ pretty_assertions = "1.4.0"
powdr-analysis = { path = "../analysis" }
powdr-importer = { path = "../importer" }
[lints.clippy]
uninlined_format_args = "deny"
[lints]
workspace = true

View File

@@ -1,5 +1,3 @@
#![deny(clippy::print_stdout)]
use std::collections::BTreeMap;
use powdr_ast::asm_analysis::{AnalysisASMFile, Module, StatementReference, SubmachineDeclaration};

View File

@@ -26,5 +26,5 @@ powdr-pil-analyzer.workspace = true
powdr-parser.workspace = true
[lints.clippy]
uninlined_format_args = "deny"
[lints]
workspace = true

View File

@@ -1,5 +1,3 @@
#![deny(clippy::print_stdout)]
use itertools::Itertools;
use std::fmt::{Display, Result, Write};

View File

@@ -87,5 +87,5 @@ powdr-pipeline.workspace = true
[package.metadata.cargo-udeps.ignore]
development = ["env_logger"]
[lints.clippy]
uninlined_format_args = "deny"
[lints]
workspace = true

View File

@@ -1,5 +1,3 @@
#![deny(clippy::print_stdout)]
use std::io;
use std::path::PathBuf;
use std::sync::Arc;

View File

@@ -1,5 +1,3 @@
#![deny(clippy::print_stdout)]
#[cfg(any(feature = "estark-polygon", feature = "estark-starky"))]
mod estark;
#[cfg(feature = "halo2")]

View File

@@ -33,5 +33,5 @@ pretty_assertions = "1.4.0"
[package.metadata.cargo-udeps.ignore]
development = ["env_logger"]
[lints.clippy]
uninlined_format_args = "deny"
[lints]
workspace = true

View File

@@ -1,7 +1,5 @@
//! Tooling used for execution of compiled programs
#![deny(clippy::print_stdout)]
use powdr_ast::analyzed::Identity;
pub mod constant_evaluator;

View File

@@ -15,5 +15,5 @@ powdr-parser-util.workspace = true
pretty_assertions = "1.4.0"
[lints.clippy]
uninlined_format_args = "deny"
[lints]
workspace = true

View File

@@ -1,5 +1,3 @@
#![deny(clippy::print_stdout)]
mod module_loader;
mod path_canonicalizer;
mod powdr_std;

View File

@@ -23,5 +23,5 @@ powdr-pil-analyzer.workspace = true
pretty_assertions = "1.4.0"
test-log = "0.2.12"
[lints.clippy]
uninlined_format_args = "deny"
[lints]
workspace = true

View File

@@ -140,7 +140,6 @@ fn degree_builtin() {
let a: int -> int = |i| std::prover::degree();
"#;
let compiled_pil = compile(input, &["main::a"]);
println!("Calling set degree outside");
compiled_pil.set_degree(128);
let a = compiled_pil.get_fixed_column("main::a").unwrap();

View File

@@ -24,5 +24,5 @@ powdr-airgen.workspace = true
powdr-importer.workspace = true
powdr-parser.workspace = true
[lints.clippy]
uninlined_format_args = "deny"
[lints]
workspace = true

View File

@@ -1,5 +1,3 @@
#![deny(clippy::print_stdout)]
use powdr_analysis::utils::parse_pil_statement;
use powdr_ast::{
asm_analysis::{combine_flags, MachineDegree},

View File

@@ -38,5 +38,5 @@ env_logger = "0.10.0"
[package.metadata.cargo-udeps.ignore]
development = ["env_logger"]
[lints.clippy]
uninlined_format_args = "deny"
[lints]
workspace = true

View File

@@ -1,7 +1,5 @@
//! Numerical types used across powdr
#![deny(clippy::print_stdout)]
#[macro_use]
mod macros;
mod baby_bear;

View File

@@ -23,5 +23,5 @@ env_logger = "0.10.0"
[package.metadata.cargo-udeps.ignore]
development = ["env_logger"]
[lints.clippy]
uninlined_format_args = "deny"
[lints]
workspace = true

View File

@@ -1,7 +1,5 @@
//! Utils used with different lalrpop parsers
#![deny(clippy::print_stdout)]
use std::{
fmt::{self, Debug, Formatter},
hash::Hash,

View File

@@ -31,5 +31,5 @@ lalrpop = "^0.19"
[package.metadata.cargo-udeps.ignore]
development = ["env_logger"]
[lints.clippy]
uninlined_format_args = "deny"
[lints]
workspace = true

View File

@@ -1,7 +1,5 @@
//! Parser for powdr assembly and PIL
#![deny(clippy::print_stdout)]
use lalrpop_util::*;
use powdr_ast::parsed::{
asm::ASMProgram,

View File

@@ -25,5 +25,5 @@ pretty_assertions = "1.4.0"
[package.metadata.cargo-udeps.ignore]
development = ["env_logger"]
[lints.clippy]
uninlined_format_args = "deny"
[lints]
workspace = true

View File

@@ -1,5 +1,3 @@
#![deny(clippy::print_stdout)]
mod call_graph;
mod condenser;
pub mod evaluator;

View File

@@ -18,5 +18,5 @@ itertools = "0.13.0"
[dev-dependencies]
powdr-pil-analyzer.workspace = true
[lints.clippy]
uninlined_format_args = "deny"
[lints]
workspace = true

View File

@@ -1,5 +1,4 @@
//! PIL-based optimizer
#![deny(clippy::print_stdout)]
use std::cmp::Ordering;
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};

View File

@@ -61,5 +61,5 @@ walkdir = "2.4.0"
name = "evaluator_benchmark"
harness = false
[lints.clippy]
uninlined_format_args = "deny"
[lints]
workspace = true

View File

@@ -1,7 +1,5 @@
//! The main powdr lib, used to compile from assembly to PIL
#![deny(clippy::print_stdout)]
pub mod pipeline;
pub mod test_runner;
pub mod test_util;

View File

@@ -13,5 +13,5 @@ powdr.workspace = true
[dev-dependencies]
env_logger = "0.10.2"
[lints.clippy]
uninlined_format_args = "deny"
[lints]
workspace = true

View File

@@ -9,5 +9,5 @@ repository = { workspace = true }
[dependencies]
[lints.clippy]
uninlined_format_args = "deny"
[lints]
workspace = true

View File

@@ -65,5 +65,5 @@ development = ["env_logger"]
name = "executor_benchmark"
harness = false
[lints.clippy]
uninlined_format_args = "deny"
[lints]
workspace = true

View File

@@ -1,5 +1,4 @@
//! A RISC-V frontend for powdr
#![deny(clippy::print_stdout)]
use std::{
borrow::Cow,