Skip to content

Commit 0865f61

Browse files
authored
Update to the 2024 style edition (#1014)
Part of #288. I ran with error_on_unformatted too just to make sure nothing new showed up. Also made sure to format xsync and mdbook-shim(no changes) since they're separate workspaces.
1 parent a9feff5 commit 0865f61

File tree

702 files changed

+3277
-2942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

702 files changed

+3277
-2942
lines changed

flowey/flowey_cli/src/cli/debug/dump_stage0_dag.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ impl DumpStage0Dag {
5353
let Some(patchfn) =
5454
flowey_core::patch::patchfn_by_modpath().get(patchfn_name.as_str())
5555
else {
56-
anyhow::bail!("could not find patch with name '{patchfn_name}'. Was it registered with `flowey_core::node::register_patch!`?")
56+
anyhow::bail!(
57+
"could not find patch with name '{patchfn_name}'. Was it registered with `flowey_core::node::register_patch!`?"
58+
)
5759
};
5860
patch_aggregator.apply_patchfn(*patchfn);
5961
}

flowey/flowey_cli/src/cli/debug/interrogate.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
// Licensed under the MIT License.
33

44
use crate::cli::FlowBackendCli;
5-
use flowey_core::node::steps::rust::RustRuntimeServices;
6-
use flowey_core::node::user_facing::ClaimedGhParam;
7-
use flowey_core::node::user_facing::GhPermission;
8-
use flowey_core::node::user_facing::GhPermissionValue;
95
use flowey_core::node::FlowArch;
106
use flowey_core::node::FlowBackend;
117
use flowey_core::node::FlowPlatform;
128
use flowey_core::node::GhVarState;
139
use flowey_core::node::NodeHandle;
10+
use flowey_core::node::steps::rust::RustRuntimeServices;
11+
use flowey_core::node::user_facing::ClaimedGhParam;
12+
use flowey_core::node::user_facing::GhPermission;
13+
use flowey_core::node::user_facing::GhPermissionValue;
1414
use flowey_core::pipeline::HostExt;
1515
use flowey_core::pipeline::PipelineBackendHint;
1616
use std::collections::BTreeMap;

flowey/flowey_cli/src/cli/exec_snippet.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
use crate::cli::FlowBackendCli;
55
use anyhow::Context;
6-
use flowey_core::node::steps::rust::RustRuntimeServices;
7-
use flowey_core::node::user_facing::ClaimedGhParam;
8-
use flowey_core::node::user_facing::GhPermission;
9-
use flowey_core::node::user_facing::GhPermissionValue;
106
use flowey_core::node::FlowArch;
117
use flowey_core::node::FlowBackend;
128
use flowey_core::node::FlowPlatform;
139
use flowey_core::node::GhVarState;
1410
use flowey_core::node::NodeHandle;
11+
use flowey_core::node::steps::rust::RustRuntimeServices;
12+
use flowey_core::node::user_facing::ClaimedGhParam;
13+
use flowey_core::node::user_facing::GhPermission;
14+
use flowey_core::node::user_facing::GhPermissionValue;
1515
use flowey_core::pipeline::HostExt;
1616
use flowey_core::pipeline::PipelineBackendHint;
1717
use serde::Deserialize;

flowey/flowey_cli/src/flow_resolver/stage1_dag.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
// Licensed under the MIT License.
33

44
use anyhow::Context;
5-
use flowey_core::node::read_var_internals;
6-
use flowey_core::node::steps::rust::RustRuntimeServices;
7-
use flowey_core::node::user_facing::ClaimedGhParam;
8-
use flowey_core::node::user_facing::GhPermission;
9-
use flowey_core::node::user_facing::GhPermissionValue;
105
use flowey_core::node::FlowArch;
116
use flowey_core::node::FlowBackend;
127
use flowey_core::node::FlowPlatform;
138
use flowey_core::node::GhVarState;
149
use flowey_core::node::NodeHandle;
10+
use flowey_core::node::read_var_internals;
11+
use flowey_core::node::steps::rust::RustRuntimeServices;
12+
use flowey_core::node::user_facing::ClaimedGhParam;
13+
use flowey_core::node::user_facing::GhPermission;
14+
use flowey_core::node::user_facing::GhPermissionValue;
1515
use parking_lot::Mutex;
1616
use std::collections::BTreeMap;
1717
use std::collections::BTreeSet;
@@ -534,7 +534,9 @@ pub(crate) fn stage1_dag(
534534
output_graph[idx].1.as_ref().unwrap().step.label()
535535
);
536536
}
537-
log::error!("found buggy node that emitted unreachable steps! use `--viz-mode flow-dot` to debug");
537+
log::error!(
538+
"found buggy node that emitted unreachable steps! use `--viz-mode flow-dot` to debug"
539+
);
538540
Some(FoundUnreachableNodes)
539541
} else {
540542
None

flowey/flowey_cli/src/pipeline_resolver/ado_yaml.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4+
use super::common_yaml::FloweySource;
45
use super::common_yaml::check_generated_yaml_and_json;
56
use super::common_yaml::job_flowey_bootstrap_source;
67
use super::common_yaml::write_generated_yaml_and_json;
7-
use super::common_yaml::FloweySource;
88
use super::generic::ResolvedJobArtifact;
99
use super::generic::ResolvedJobUseParameter;
1010
use crate::cli::exec_snippet::FloweyPipelineStaticDb;
@@ -127,7 +127,9 @@ pub fn ado_yaml(
127127
let _ = (artifact, publish);
128128

129129
if ado_bootstrap_template.is_empty() {
130-
anyhow::bail!("Did not specify flowey bootstrap template. Please provide one using `Pipeline::ado_set_flowey_bootstrap_template`")
130+
anyhow::bail!(
131+
"Did not specify flowey bootstrap template. Please provide one using `Pipeline::ado_set_flowey_bootstrap_template`"
132+
)
131133
}
132134

133135
let ado_bootstrap_template = ado_bootstrap_template

flowey/flowey_cli/src/pipeline_resolver/direct_run.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ use crate::pipeline_resolver::generic::ResolvedJobArtifact;
88
use crate::pipeline_resolver::generic::ResolvedJobUseParameter;
99
use crate::pipeline_resolver::generic::ResolvedPipeline;
1010
use crate::pipeline_resolver::generic::ResolvedPipelineJob;
11-
use flowey_core::node::steps::rust::RustRuntimeServices;
1211
use flowey_core::node::FlowArch;
1312
use flowey_core::node::FlowBackend;
1413
use flowey_core::node::FlowPlatform;
1514
use flowey_core::node::NodeHandle;
1615
use flowey_core::node::RuntimeVarDb;
16+
use flowey_core::node::steps::rust::RustRuntimeServices;
1717
use flowey_core::pipeline::internal::Parameter;
1818
use petgraph::prelude::NodeIndex;
1919
use petgraph::visit::EdgeRef;
@@ -198,10 +198,16 @@ fn direct_run_do_work(
198198
Step::Anchor { .. } => continue,
199199
Step::Rust { label, code, idx } => (label, code, idx),
200200
Step::AdoYaml { .. } => {
201-
anyhow::bail!("{} emitted ADO YAML. Fix the node by checking `ctx.backend()` appropriately", node_handle.modpath())
201+
anyhow::bail!(
202+
"{} emitted ADO YAML. Fix the node by checking `ctx.backend()` appropriately",
203+
node_handle.modpath()
204+
)
202205
}
203206
Step::GitHubYaml { .. } => {
204-
anyhow::bail!("{} emitted GitHub YAML. Fix the node by checking `ctx.backend()` appropriately", node_handle.modpath())
207+
anyhow::bail!(
208+
"{} emitted GitHub YAML. Fix the node by checking `ctx.backend()` appropriately",
209+
node_handle.modpath()
210+
)
205211
}
206212
};
207213
steps.push((idx, label, code.lock().take().unwrap()));

flowey/flowey_cli/src/pipeline_resolver/generic.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,12 @@
22
// Licensed under the MIT License.
33

44
use anyhow::Context;
5-
use flowey_core::node::user_facing::GhPermission;
6-
use flowey_core::node::user_facing::GhPermissionValue;
75
use flowey_core::node::FlowArch;
86
use flowey_core::node::FlowPlatform;
97
use flowey_core::node::NodeHandle;
8+
use flowey_core::node::user_facing::GhPermission;
9+
use flowey_core::node::user_facing::GhPermissionValue;
1010
use flowey_core::patch::ResolvedPatches;
11-
use flowey_core::pipeline::internal::AdoPool;
12-
use flowey_core::pipeline::internal::ArtifactMeta;
13-
use flowey_core::pipeline::internal::InternalAdoResourcesRepository;
14-
use flowey_core::pipeline::internal::Parameter;
15-
use flowey_core::pipeline::internal::ParameterMeta;
16-
use flowey_core::pipeline::internal::PipelineFinalized;
17-
use flowey_core::pipeline::internal::PipelineJobMetadata;
1811
use flowey_core::pipeline::AdoCiTriggers;
1912
use flowey_core::pipeline::AdoPrTriggers;
2013
use flowey_core::pipeline::AdoScheduleTriggers;
@@ -23,6 +16,13 @@ use flowey_core::pipeline::GhPrTriggers;
2316
use flowey_core::pipeline::GhRunner;
2417
use flowey_core::pipeline::GhScheduleTriggers;
2518
use flowey_core::pipeline::Pipeline;
19+
use flowey_core::pipeline::internal::AdoPool;
20+
use flowey_core::pipeline::internal::ArtifactMeta;
21+
use flowey_core::pipeline::internal::InternalAdoResourcesRepository;
22+
use flowey_core::pipeline::internal::Parameter;
23+
use flowey_core::pipeline::internal::ParameterMeta;
24+
use flowey_core::pipeline::internal::PipelineFinalized;
25+
use flowey_core::pipeline::internal::PipelineJobMetadata;
2626
use std::collections::BTreeMap;
2727
use std::collections::BTreeSet;
2828

flowey/flowey_cli/src/pipeline_resolver/github_yaml/github_yaml_defs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
#![allow(unused)]
77

88
use flowey_core::pipeline::GhRunner;
9-
use serde::ser::SerializeMap;
10-
use serde::ser::SerializeSeq;
119
use serde::Deserialize;
1210
use serde::Serialize;
1311
use serde::Serializer;
12+
use serde::ser::SerializeMap;
13+
use serde::ser::SerializeSeq;
1414
use std::collections::BTreeMap;
1515

1616
/// Valid names may only contain alphanumeric characters and '_' and may not

flowey/flowey_cli/src/pipeline_resolver/github_yaml/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ use crate::cli::exec_snippet::VAR_DB_SEEDVAR_FLOWEY_WORKING_DIR;
1212
use crate::cli::pipeline::CheckMode;
1313
use crate::flow_resolver::stage1_dag::OutputGraphEntry;
1414
use crate::flow_resolver::stage1_dag::Step;
15-
use crate::pipeline_resolver::common_yaml::job_flowey_bootstrap_source;
1615
use crate::pipeline_resolver::common_yaml::FloweySource;
16+
use crate::pipeline_resolver::common_yaml::job_flowey_bootstrap_source;
1717
use crate::pipeline_resolver::generic::ResolvedPipeline;
1818
use crate::pipeline_resolver::generic::ResolvedPipelineJob;
1919
use anyhow::Context;
20-
use flowey_core::node::user_facing::GhPermission;
21-
use flowey_core::node::user_facing::GhPermissionValue;
2220
use flowey_core::node::FlowArch;
2321
use flowey_core::node::FlowBackend;
2422
use flowey_core::node::FlowPlatform;
2523
use flowey_core::node::FlowPlatformKind;
2624
use flowey_core::node::NodeHandle;
25+
use flowey_core::node::user_facing::GhPermission;
26+
use flowey_core::node::user_facing::GhPermissionValue;
2727
use flowey_core::pipeline::GhRunner;
2828
use flowey_core::pipeline::GhRunnerOsLabel;
2929
use std::collections::BTreeMap;
@@ -127,7 +127,9 @@ pub fn github_yaml(
127127
// actual artifact publish happens at the end of the job
128128
if let FloweySource::Bootstrap(_artifact, _publish) = &flowey_source {
129129
if gh_bootstrap_template.is_empty() {
130-
anyhow::bail!("Did not specify flowey bootstrap template. Please provide one using `Pipeline::gh_set_flowey_bootstrap_template`")
130+
anyhow::bail!(
131+
"Did not specify flowey bootstrap template. Please provide one using `Pipeline::gh_set_flowey_bootstrap_template`"
132+
)
131133
}
132134

133135
let gh_bootstrap_template = gh_bootstrap_template

flowey/flowey_cli/src/pipeline_resolver/viz.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,17 +347,17 @@ pub fn viz_flow_dot(
347347

348348
impl std::fmt::Debug for VizNode {
349349
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
350-
if self.0 .1.is_none() {
351-
return write!(f, "{:?} - ???", self.0 .0);
350+
if self.0.1.is_none() {
351+
return write!(f, "{:?} - ???", self.0.0);
352352
}
353353

354-
let entry = &self.0 .1.as_ref().unwrap();
354+
let entry = &self.0.1.as_ref().unwrap();
355355

356356
write!(
357357
f,
358358
"{}:{}\n\n{}",
359-
self.0 .0.step_idx,
360-
self.0 .0.node.modpath(),
359+
self.0.0.step_idx,
360+
self.0.0.node.modpath(),
361361
match &entry.step {
362362
crate::flow_resolver::stage1_dag::Step::Anchor { label } => {
363363
format!("<anchor:{label}>")

flowey/flowey_core/src/node.rs

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ use self::user_facing::GhPermission;
1717
use self::user_facing::GhPermissionValue;
1818
use crate::node::github_context::GhContextVarReader;
1919
use github_context::state::Root;
20-
use serde::de::DeserializeOwned;
2120
use serde::Deserialize;
2221
use serde::Serialize;
22+
use serde::de::DeserializeOwned;
2323
use std::cell::RefCell;
2424
use std::collections::BTreeMap;
2525
use std::path::PathBuf;
@@ -29,14 +29,6 @@ use user_facing::GhParam;
2929
/// Node types which are considered "user facing", and re-exported in the
3030
/// `flowey` crate.
3131
pub mod user_facing {
32-
pub use super::steps::ado::AdoResourcesRepositoryId;
33-
pub use super::steps::ado::AdoRuntimeVar;
34-
pub use super::steps::ado::AdoStepServices;
35-
pub use super::steps::github::ClaimedGhParam;
36-
pub use super::steps::github::GhParam;
37-
pub use super::steps::github::GhPermission;
38-
pub use super::steps::github::GhPermissionValue;
39-
pub use super::steps::rust::RustRuntimeServices;
4032
pub use super::ClaimVar;
4133
pub use super::ClaimedReadVar;
4234
pub use super::ClaimedWriteVar;
@@ -57,6 +49,14 @@ pub mod user_facing {
5749
pub use super::VarEqBacking;
5850
pub use super::VarNotClaimed;
5951
pub use super::WriteVar;
52+
pub use super::steps::ado::AdoResourcesRepositoryId;
53+
pub use super::steps::ado::AdoRuntimeVar;
54+
pub use super::steps::ado::AdoStepServices;
55+
pub use super::steps::github::ClaimedGhParam;
56+
pub use super::steps::github::GhParam;
57+
pub use super::steps::github::GhPermission;
58+
pub use super::steps::github::GhPermissionValue;
59+
pub use super::steps::rust::RustRuntimeServices;
6060
pub use crate::flowey_request;
6161
pub use crate::new_flow_node;
6262
pub use crate::new_simple_flow_node;
@@ -781,11 +781,7 @@ impl FlowPlatform {
781781

782782
/// The suffix to use for executables on this platform.
783783
pub fn exe_suffix(&self) -> &'static str {
784-
if self == &Self::Windows {
785-
".exe"
786-
} else {
787-
""
788-
}
784+
if self == &Self::Windows { ".exe" } else { "" }
789785
}
790786

791787
/// The full name for a binary on this platform (i.e. `name + self.exe_suffix()`).
@@ -1855,8 +1851,8 @@ pub mod steps {
18551851
use crate::node::FlowBackend;
18561852
use crate::node::FlowPlatform;
18571853
use crate::node::RuntimeVarDb;
1858-
use serde::de::DeserializeOwned;
18591854
use serde::Serialize;
1855+
use serde::de::DeserializeOwned;
18601856

18611857
pub fn new_rust_runtime_services(
18621858
runtime_var_db: &mut dyn RuntimeVarDb,
@@ -1989,9 +1985,9 @@ pub trait FlowNodeBase {
19891985
}
19901986

19911987
pub mod erased {
1992-
use crate::node::user_facing::*;
19931988
use crate::node::FlowNodeBase;
19941989
use crate::node::NodeCtx;
1990+
use crate::node::user_facing::*;
19951991

19961992
pub struct ErasedNode<N: FlowNodeBase>(pub N);
19971993

@@ -2134,8 +2130,8 @@ mod node_luts {
21342130
lookup
21352131
}
21362132

2137-
pub(super) fn erased_node_by_typeid(
2138-
) -> &'static HashMap<NodeHandle, fn() -> Box<dyn FlowNodeBase<Request = Box<[u8]>>>> {
2133+
pub(super) fn erased_node_by_typeid()
2134+
-> &'static HashMap<NodeHandle, fn() -> Box<dyn FlowNodeBase<Request = Box<[u8]>>>> {
21392135
static LOOKUP: OnceLock<
21402136
HashMap<NodeHandle, fn() -> Box<dyn FlowNodeBase<Request = Box<[u8]>>>>,
21412137
> = OnceLock::new();

flowey/flowey_core/src/node/github_context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
//! Core types and traits used to read GitHub context variables.
55
6-
use crate::node::spec::GhContextVarReaderEventPullRequest;
76
use crate::node::ClaimVar;
87
use crate::node::GhUserSecretVar;
98
use crate::node::NodeCtx;
109
use crate::node::ReadVar;
1110
use crate::node::StepCtx;
12-
use serde::de::DeserializeOwned;
11+
use crate::node::spec::GhContextVarReaderEventPullRequest;
1312
use serde::Serialize;
13+
use serde::de::DeserializeOwned;
1414
use std::collections::BTreeMap;
1515

1616
pub mod state {

flowey/flowey_core/src/pipeline.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
//! Core types and traits used to create and work with flowey pipelines.
55
66
use self::internal::*;
7-
use crate::node::steps::ado::AdoResourcesRepositoryId;
8-
use crate::node::user_facing::AdoRuntimeVar;
9-
use crate::node::user_facing::GhPermission;
10-
use crate::node::user_facing::GhPermissionValue;
117
use crate::node::FlowArch;
128
use crate::node::FlowNodeBase;
139
use crate::node::FlowPlatform;
@@ -17,10 +13,14 @@ use crate::node::IntoRequest;
1713
use crate::node::NodeHandle;
1814
use crate::node::ReadVar;
1915
use crate::node::WriteVar;
16+
use crate::node::steps::ado::AdoResourcesRepositoryId;
17+
use crate::node::user_facing::AdoRuntimeVar;
18+
use crate::node::user_facing::GhPermission;
19+
use crate::node::user_facing::GhPermissionValue;
2020
use crate::patch::PatchResolver;
2121
use crate::patch::ResolvedPatches;
22-
use serde::de::DeserializeOwned;
2322
use serde::Serialize;
23+
use serde::de::DeserializeOwned;
2424
use std::collections::BTreeMap;
2525
use std::collections::BTreeSet;
2626
use std::path::PathBuf;

flowey/flowey_hvlite/src/pipelines/build_igvm.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,17 @@ pub fn bail_if_running_in_ci() -> anyhow::Result<()> {
197197
log::warn!("Detected that {ci_env} is set");
198198
log::warn!("");
199199
log::warn!("Do not use `build-igvm` in CI scripts!");
200-
log::warn!("This is a local-only, inner-dev-loop tool to build IGVM files, with an UNSTABLE CLI.");
200+
log::warn!(
201+
"This is a local-only, inner-dev-loop tool to build IGVM files, with an UNSTABLE CLI."
202+
);
201203
log::warn!("");
202-
log::warn!("Automated pipelines should use the underlying `flowey` nodes that power build-igvm directly, _without_ relying on its CLI!");
204+
log::warn!(
205+
"Automated pipelines should use the underlying `flowey` nodes that power build-igvm directly, _without_ relying on its CLI!"
206+
);
203207
log::warn!("");
204-
log::warn!("If you _really_ know what you're doing, you can set {OVERRIDE_ENV} to disable this error.");
208+
log::warn!(
209+
"If you _really_ know what you're doing, you can set {OVERRIDE_ENV} to disable this error."
210+
);
205211
anyhow::bail!("attempted to run `build-igvm` in CI")
206212
}
207213
}

0 commit comments

Comments
 (0)