Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
plotchy committed Jun 26, 2024
1 parent 79fc49f commit ed0b78b
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 122 deletions.
4 changes: 1 addition & 3 deletions crates/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@ fn main() {
},
};



let mut analyzer = Analyzer {
max_depth: args.max_stack_depth,
root: Root::RemappingsDirectory(env::current_dir().unwrap()),
Expand Down Expand Up @@ -273,7 +271,7 @@ fn main() {
unsafe {
USE_DEBUG_SITE = true;
}

let rt = Runtime::new().unwrap();
rt.block_on(async {
let client = Client::new();
Expand Down
22 changes: 12 additions & 10 deletions crates/graph/src/graph_elements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ use solang_parser::pt::{Identifier, Loc};

use std::collections::HashMap;


pub trait GraphBackend:
GraphLike<Edge = Edge, Node = Node, RangeElem = Elem<Concrete>>
+ GraphDot
{}
GraphLike<Edge = Edge, Node = Node, RangeElem = Elem<Concrete>> + GraphDot
{
}
pub trait AnalyzerBackend:
AnalyzerLike<
Builtin = Builtin,
Expand Down Expand Up @@ -425,34 +424,37 @@ impl GraphDot for DummyGraph {
// Provide a basic implementation or a placeholder
"digraph DummyGraph {}".to_string()
}

fn cluster_str(
&self,
_arena: &mut RangeArena<Self::T>,
_node: NodeIdx,
_cluster_num: &mut usize,
_is_killed: bool,
_handled_nodes: std::sync::Arc<std::sync::Mutex<std::collections::BTreeSet<NodeIdx>>>,
_handled_edges: std::sync::Arc<std::sync::Mutex<std::collections::BTreeSet<petgraph::prelude::EdgeIndex<usize>>>>,
_handled_edges: std::sync::Arc<
std::sync::Mutex<std::collections::BTreeSet<petgraph::prelude::EdgeIndex<usize>>>,
>,
_depth: usize,
_as_mermaid: bool,
) -> Option<String>
where
Self: std::marker::Sized {
Self: std::marker::Sized,
{
todo!()
}

fn dot_str_no_tmps(&self, _arena: &mut RangeArena<Self::T>) -> String
where
Self: std::marker::Sized,
{
todo!()
}

fn mermaid_str(&self, _arena: &mut RangeArena<Self::T>) -> String
where
Self: std::marker::Sized,
{
todo!()
}
}
}
6 changes: 3 additions & 3 deletions crates/graph/src/range/elem/elem_enum/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ impl Elem<Concrete> {
let rhs_str = range_expr.rhs.arena_graph_node_label();
let op = range_expr.op.clone();
format!("expr-{}", &self)
},
}
Elem::Arena(arena_idx) => {
format!("Arena({})", arena_idx)
},
}
Elem::Null => {
todo!()
},
}
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions crates/pyrometer/src/analyzer.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use crate::builtin_fns;
use analyzers::LocStrSpan;
use graph::elem::Elem;
use graph::{nodes::*, ContextEdge, Edge, Node, VarType};
use reqwest::Client;
use serde::{Deserialize, Serialize};
use shared::{RangeArena, USE_DEBUG_SITE};
use shared::GraphDot;
use analyzers::LocStrSpan;
use graph::{nodes::*, ContextEdge, Edge, Node, VarType};
use shared::{AnalyzerLike, GraphLike, JoinStats, NodeIdx, Search};
use shared::{RangeArena, USE_DEBUG_SITE};
use solc_expressions::{ExprErr, FnCallBuilder, IntoExprErr, StatementParser};
use tokio::runtime::Runtime;
use tracing::{debug, error, info, trace, warn};
Expand Down Expand Up @@ -1403,7 +1403,7 @@ impl Analyzer {
ty_node
}

fn post_source_to_site(file_no: usize, path: &PathBuf, source: &str)
fn post_source_to_site(file_no: usize, path: &PathBuf, source: &str)
where
Self: std::marker::Sized,
Self: AnalyzerLike,
Expand All @@ -1414,7 +1414,8 @@ impl Analyzer {
});
}

async fn post_source_to_site_async(file_no: usize, path: &PathBuf, source: &str) where
async fn post_source_to_site_async(file_no: usize, path: &PathBuf, source: &str)
where
Self: std::marker::Sized,
Self: AnalyzerLike,
{
Expand All @@ -1436,7 +1437,6 @@ impl Analyzer {
} else {
error!("Failed to post source to site: {:?}", res.status());
}

}
}

Expand Down Expand Up @@ -1504,4 +1504,4 @@ struct SourceMessage {
file_number: usize,
path: PathBuf,
source: String,
}
}
2 changes: 1 addition & 1 deletion crates/pyrometer/src/analyzer_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ impl AnalyzerLike for Analyzer {
fn handled_funcs_mut(&mut self) -> &mut Vec<FunctionNode> {
&mut self.handled_funcs
}

fn file_mapping(&self) -> BTreeMap<usize, String> {
let mut file_mapping: BTreeMap<usize, String> = BTreeMap::new();
for (source_path, _, o_file_no, _) in self.sources.iter() {
Expand Down
Loading

0 comments on commit ed0b78b

Please sign in to comment.