Skip to content

Commit 55039c6

Browse files
: lint (#1694)
Summary: lints in hyperactor, hyperactor mesh. i'm in a rush. i'll circle back to box the large errors - annotate for now. Reviewed By: dulinriley Differential Revision: D85793529
1 parent 434e447 commit 55039c6

File tree

15 files changed

+34
-21
lines changed

15 files changed

+34
-21
lines changed

hyperactor/src/channel.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,6 @@ mod tests {
906906
use super::*;
907907
use crate::clock::Clock;
908908
use crate::clock::RealClock;
909-
use crate::config;
910909

911910
#[test]
912911
fn test_channel_addr() {

hyperactor/src/mailbox/undeliverable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ use serde::Serialize;
1313
use thiserror::Error;
1414

1515
use crate as hyperactor; // for macros
16-
use crate::ActorId;
1716
use crate::Message;
1817
use crate::Named;
19-
use crate::PortId;
2018
use crate::actor::ActorStatus;
2119
use crate::id;
2220
use crate::mailbox::DeliveryError;

hyperactor_macros/src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,10 +1636,7 @@ impl syn::parse::Parse for BehaviorInput {
16361636
/// ```
16371637
#[proc_macro]
16381638
pub fn behavior(input: TokenStream) -> TokenStream {
1639-
let BehaviorInput {
1640-
behavior: behavior,
1641-
handlers,
1642-
} = parse_macro_input!(input as BehaviorInput);
1639+
let BehaviorInput { behavior, handlers } = parse_macro_input!(input as BehaviorInput);
16431640
let tys = HandlerSpec::add_indexed(handlers);
16441641

16451642
let expanded = quote! {

hyperactor_mesh/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ libc = "0.2.139"
6565
mockall = "0.13.1"
6666
ndslice = { version = "0.0.0", path = "../ndslice" }
6767
nix = { version = "0.30.1", features = ["dir", "event", "hostname", "inotify", "ioctl", "mman", "mount", "net", "poll", "ptrace", "reboot", "resource", "sched", "signal", "term", "time", "user", "zerocopy"] }
68-
notify = "5"
6968
opentelemetry = "0.29"
7069
pin-project = "1.1.10"
7170
preempt_rwlock = { version = "0.0.0", path = "../preempt_rwlock" }

hyperactor_mesh/src/actor_mesh.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ mod tests {
984984
.await
985985
.unwrap();
986986

987-
let instance = crate::v1::testing::instance().await;
987+
let instance = $crate::v1::testing::instance().await;
988988
let proc_mesh = ProcMesh::allocate(alloc).await.unwrap();
989989
let (undeliverable_tx, _undeliverable_rx) = proc_mesh.client().open_port();
990990
let params = PingPongActorParams::new(Some(undeliverable_tx.bind()), None);
@@ -1030,7 +1030,7 @@ mod tests {
10301030
.await
10311031
.unwrap();
10321032

1033-
let instance = crate::v1::testing::instance().await;
1033+
let instance = $crate::v1::testing::instance().await;
10341034
let proc_mesh = ProcMesh::allocate(alloc).await.unwrap();
10351035
let actor_mesh: RootActorMesh<TestActor> = proc_mesh.spawn(&instance, "echo", &()).await.unwrap();
10361036
let dont_simulate_error = true;
@@ -1074,7 +1074,7 @@ mod tests {
10741074
.await
10751075
.unwrap();
10761076

1077-
let instance = crate::v1::testing::instance().await;
1077+
let instance = $crate::v1::testing::instance().await;
10781078
let proc_mesh = ProcMesh::allocate(alloc).await.unwrap();
10791079
let actor_mesh: RootActorMesh<TestActor> = proc_mesh.spawn(&instance, "echo", &()).await.unwrap();
10801080

@@ -1096,7 +1096,7 @@ mod tests {
10961096
#[tokio::test]
10971097
async fn test_inter_proc_mesh_comms() {
10981098
let mut meshes = Vec::new();
1099-
let instance = crate::v1::testing::instance().await;
1099+
let instance = $crate::v1::testing::instance().await;
11001100
for _ in 0..2 {
11011101
let alloc = $allocator
11021102
.allocate(AllocSpec {
@@ -1157,7 +1157,7 @@ mod tests {
11571157
.await
11581158
.unwrap();
11591159

1160-
let instance = crate::v1::testing::instance().await;
1160+
let instance = $crate::v1::testing::instance().await;
11611161
let mut proc_mesh = ProcMesh::allocate(alloc).await.unwrap();
11621162

11631163
let (tx, mut rx) = hyperactor::mailbox::open_port(proc_mesh.client());
@@ -1220,7 +1220,7 @@ mod tests {
12201220
.await
12211221
.unwrap();
12221222

1223-
let instance = crate::v1::testing::instance().await;
1223+
let instance = $crate::v1::testing::instance().await;
12241224
let mesh = ProcMesh::allocate(alloc).await.unwrap();
12251225
let (reply_port_handle, mut reply_port_receiver) = mesh.client().open_port::<usize>();
12261226
let reply_port = reply_port_handle.bind();

hyperactor_mesh/src/bootstrap.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,13 @@ pub enum Bootstrap {
257257
impl Bootstrap {
258258
/// Serialize the mode into a environment-variable-safe string by
259259
/// base64-encoding its JSON representation.
260+
#[allow(clippy::result_large_err)]
260261
fn to_env_safe_string(&self) -> v1::Result<String> {
261262
Ok(BASE64_STANDARD.encode(serde_json::to_string(&self)?))
262263
}
263264

264265
/// Deserialize the mode from the representation returned by [`to_env_safe_string`].
266+
#[allow(clippy::result_large_err)]
265267
fn from_env_safe_string(str: &str) -> v1::Result<Self> {
266268
let data = BASE64_STANDARD.decode(str)?;
267269
let data = std::str::from_utf8(&data)?;

hyperactor_mesh/src/logging.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ use hyperactor::data::Serialized;
4747
use hyperactor::declare_attrs;
4848
use hyperactor_telemetry::env;
4949
use hyperactor_telemetry::log_file_path;
50-
use notify::Watcher;
5150
use serde::Deserialize;
5251
use serde::Serialize;
5352
use tokio::io;
@@ -1657,12 +1656,14 @@ mod tests {
16571656
"Expected deserialization to fail with invalid UTF-8 bytes"
16581657
);
16591658
}
1659+
#[allow(dead_code)]
16601660
struct MockLogSender {
16611661
log_sender: mpsc::UnboundedSender<(OutputTarget, String)>, // (output_target, content)
16621662
flush_called: Arc<Mutex<bool>>, // Track if flush was called
16631663
}
16641664

16651665
impl MockLogSender {
1666+
#[allow(dead_code)]
16661667
fn new(log_sender: mpsc::UnboundedSender<(OutputTarget, String)>) -> Self {
16671668
Self {
16681669
log_sender,

hyperactor_mesh/src/logging/line_prefixing_writer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ where
2727
W: io::AsyncWrite + Unpin,
2828
{
2929
/// Creates a new LinePrefixingWriter that will prefix each line with "[<local_rank>] ".
30+
#[allow(dead_code)]
3031
pub fn new(local_rank: usize, inner: W) -> Self {
3132
let prefix = format!("[{}] ", local_rank).into_bytes();
3233
Self {

hyperactor_mesh/src/proc_mesh.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ impl ProcMesh {
697697
.collect(),
698698
actor_event_router: actor_event_router.clone(),
699699
}),
700+
#[allow(clippy::todo)]
700701
ProcMeshKind::V1(_proc_mesh) => todo!(),
701702
}
702703
}

hyperactor_mesh/src/v1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ pub enum Error {
124124

125125
#[error(
126126
"error spawning proc mesh: statuses: {}",
127-
RankedValues::invert(&*.statuses)
127+
RankedValues::invert(statuses)
128128
)]
129129
ProcSpawnError { statuses: RankedValues<Status> },
130130

131131
#[error(
132132
"error spawning actor mesh: statuses: {}",
133-
RankedValues::invert(&*.statuses)
133+
RankedValues::invert(statuses)
134134
)]
135135
ActorSpawnError { statuses: RankedValues<Status> },
136136

0 commit comments

Comments
 (0)