Skip to content

Commit 3686009

Browse files
committed
Fixing test errors
1 parent e97ab0c commit 3686009

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ serde_json = "1.0"
2424
anyhow = "1.0"
2525
thiserror = "1.0"
2626
tracing = "0.1"
27-
tracing-subscriber = "0.3"
27+
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
2828

2929
# Tree-sitter dependencies
3030
tree-sitter = "0.20"

crates/cli/src/output.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ use colored::*;
66
use serde::{Deserialize, Serialize};
77
use smart_diff_parser::{Language, ASTNode};
88
use smart_diff_engine::{
9-
DiffResult, RefactoringPattern, DetailedChangeClassification, CrossFileMove
9+
DiffResult, RefactoringPattern, DetailedChangeClassification, FunctionMove
1010
};
11-
use smart_diff_semantic::{SymbolTable, ComplexityMetrics, DependencyGraph};
11+
use smart_diff_semantic::{SymbolTable, FunctionComplexityMetrics, DependencyGraph};
1212
use std::collections::HashMap;
1313
use std::path::PathBuf;
1414
use std::time::Duration;
1515

1616
/// Complete comparison result for a file pair
17-
#[derive(Debug, Clone, Serialize)]
17+
#[derive(Debug, Clone)]
1818
pub struct ComparisonResult {
1919
pub source_file: PathBuf,
2020
pub target_file: PathBuf,
@@ -23,20 +23,20 @@ pub struct ComparisonResult {
2323
pub classified_changes: Vec<DetailedChangeClassification>,
2424
pub refactoring_patterns: Vec<RefactoringPattern>,
2525
pub similarity_scores: Option<HashMap<String, f64>>,
26-
pub cross_file_moves: Vec<CrossFileMove>,
26+
pub cross_file_moves: Vec<FunctionMove>,
2727
pub stats: ComparisonStats,
2828
pub source_ast: Option<ASTNode>,
2929
pub target_ast: Option<ASTNode>,
3030
}
3131

3232
/// Analysis result for a single file
33-
#[derive(Debug, Clone, Serialize)]
33+
#[derive(Debug, Clone)]
3434
pub struct AnalysisResult {
3535
pub file_path: PathBuf,
3636
pub language: Language,
3737
pub line_count: usize,
3838
pub symbols: SymbolTable,
39-
pub complexity_metrics: Option<ComplexityMetrics>,
39+
pub complexity_metrics: Option<FunctionComplexityMetrics>,
4040
pub dependency_info: Option<DependencyGraph>,
4141
pub function_signatures: Option<HashMap<String, String>>,
4242
pub processing_time: Duration,
@@ -129,7 +129,7 @@ impl OutputFormatter {
129129
} else {
130130
output.push_str(&format!("{}\n{}\n\n",
131131
header.bold().blue(),
132-
"=".repeat(header.len()).dim()));
132+
"=".repeat(header.len()).dimmed()));
133133
}
134134

135135
for (index, result) in results.iter().enumerate() {
@@ -140,7 +140,7 @@ impl OutputFormatter {
140140
} else {
141141
output.push_str(&format!("{}\n{}\n",
142142
file_header.bold().green(),
143-
"-".repeat(file_header.len()).dim()));
143+
"-".repeat(file_header.len()).dimmed()));
144144
}
145145
}
146146

@@ -156,7 +156,7 @@ impl OutputFormatter {
156156
}
157157

158158
if let Some(ref deps) = result.dependency_info {
159-
output.push_str(&format!("Dependencies: {}\n", deps.dependencies.len()));
159+
output.push_str(&format!("Dependencies: {}\n", deps.edge_count()));
160160
}
161161

162162
output.push_str("\n");
@@ -473,7 +473,7 @@ impl OutputFormatter {
473473
html.push_str(" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n");
474474
html.push_str(" <title>Smart Code Diff Results</title>\n");
475475
html.push_str(" <style>\n");
476-
html.push_str(include_str!("../assets/diff.css"));
476+
html.push_str(include_str!("assets/diff.css"));
477477
html.push_str(" </style>\n");
478478
html.push_str("</head>\n<body>\n");
479479

crates/diff-engine/src/engine.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub struct DiffEngine {
2020
}
2121

2222
/// Result of diff computation
23-
#[derive(Debug, Serialize, Deserialize)]
23+
#[derive(Debug, Clone, Serialize, Deserialize)]
2424
pub struct DiffResult {
2525
pub match_result: MatchResult,
2626
pub refactoring_patterns: Vec<crate::refactoring::RefactoringPattern>,
@@ -29,7 +29,7 @@ pub struct DiffResult {
2929
}
3030

3131
/// Statistics about the diff computation
32-
#[derive(Debug, Serialize, Deserialize)]
32+
#[derive(Debug, Clone, Serialize, Deserialize)]
3333
pub struct DiffStatistics {
3434
pub functions_compared: usize,
3535
pub functions_matched: usize,

crates/parser/src/language.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::collections::HashMap;
66
use std::path::Path;
77

88
/// Supported programming languages
9-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
9+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
1010
pub enum Language {
1111
Java,
1212
Python,

0 commit comments

Comments
 (0)