Skip to content

Commit 0cb638a

Browse files
unhappychoiceclaude
andcommitted
fix: apply code formatting and clippy auto-fixes
Fix trailing whitespace issues and apply clippy auto-fixes to meet CI requirements. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 34fa071 commit 0cb638a

Some content is hidden

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

51 files changed

+3560
-2040
lines changed

generate_all_ascii_titles.rs

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,28 @@
22
#[path = "src/scoring/ranking_title.rs"]
33
mod ranking_title;
44

5+
use ranking_title::RankingTitle;
56
use std::collections::HashMap;
6-
use std::process::Command;
77
use std::io::Write;
8-
use ranking_title::RankingTitle;
8+
use std::process::Command;
99

1010
fn main() -> Result<(), Box<dyn std::error::Error>> {
1111
// Get all rank titles from the actual RankingTitle implementation
1212
let all_titles = RankingTitle::all_titles();
13-
println!("Found {} rank titles from RankingTitle::all_titles()", all_titles.len());
13+
println!(
14+
"Found {} rank titles from RankingTitle::all_titles()",
15+
all_titles.len()
16+
);
1417

1518
let rank_titles: Vec<(&str, &str)> = all_titles
1619
.iter()
1720
.map(|title| (title.name(), title.color_palette()))
1821
.collect();
1922

20-
println!("Generating ASCII art for {} rank titles...", rank_titles.len());
23+
println!(
24+
"Generating ASCII art for {} rank titles...",
25+
rank_titles.len()
26+
);
2127

2228
let mut generated_patterns = HashMap::new();
2329

@@ -28,7 +34,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
2834

2935
// Run npx oh-my-logo
3036
let output = Command::new("npx")
31-
.args(&["oh-my-logo", title, palette])
37+
.args(["oh-my-logo", title, palette])
3238
.env("FORCE_COLOR", "1")
3339
.output()?;
3440

@@ -55,19 +61,31 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
5561
}
5662
}
5763

58-
println!("\nGenerated ASCII art for {} titles", generated_patterns.len());
64+
println!(
65+
"\nGenerated ASCII art for {} titles",
66+
generated_patterns.len()
67+
);
5968

6069
// Generate the Rust file
6170
println!("Writing ascii_rank_titles_generated.rs...");
62-
71+
6372
let mut file = std::fs::File::create("src/game/ascii_rank_titles_generated.rs")?;
64-
65-
writeln!(file, "/// ASCII art rank title patterns using oh-my-logo style with colored ANSI codes")?;
66-
writeln!(file, "/// Auto-generated from oh-my-logo with different palettes for different rank categories")?;
73+
74+
writeln!(
75+
file,
76+
"/// ASCII art rank title patterns using oh-my-logo style with colored ANSI codes"
77+
)?;
78+
writeln!(
79+
file,
80+
"/// Auto-generated from oh-my-logo with different palettes for different rank categories"
81+
)?;
6782
writeln!(file)?;
6883
writeln!(file, "use std::collections::HashMap;")?;
6984
writeln!(file)?;
70-
writeln!(file, "pub fn get_all_rank_patterns() -> HashMap<String, Vec<String>> {{")?;
85+
writeln!(
86+
file,
87+
"pub fn get_all_rank_patterns() -> HashMap<String, Vec<String>> {{"
88+
)?;
7189
writeln!(file, " let mut patterns = HashMap::new();")?;
7290
writeln!(file)?;
7391

@@ -79,7 +97,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
7997
let lines = &generated_patterns[title];
8098
writeln!(file, " // {}", title)?;
8199
writeln!(file, " patterns.insert(\"{}\".to_string(), vec![", title)?;
82-
100+
83101
for line in lines {
84102
// Escape the line for Rust string literal
85103
let escaped_line = line
@@ -88,19 +106,25 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
88106
.replace("\x1b", "\\x1b");
89107
writeln!(file, " \"{}\".to_string(),", escaped_line)?;
90108
}
91-
109+
92110
writeln!(file, " ]);")?;
93111
writeln!(file)?;
94112
}
95113

96114
writeln!(file, " patterns")?;
97115
writeln!(file, "}}")?;
98116
writeln!(file)?;
99-
writeln!(file, "pub fn get_rank_title_display(rank_title: &str) -> Vec<String> {{")?;
117+
writeln!(
118+
file,
119+
"pub fn get_rank_title_display(rank_title: &str) -> Vec<String> {{"
120+
)?;
100121
writeln!(file, " let patterns = get_all_rank_patterns();")?;
101122
writeln!(file, " patterns.get(rank_title)")?;
102123
writeln!(file, " .cloned()")?;
103-
writeln!(file, " .unwrap_or_else(|| vec![rank_title.to_string()])")?;
124+
writeln!(
125+
file,
126+
" .unwrap_or_else(|| vec![rank_title.to_string()])"
127+
)?;
104128
writeln!(file, "}}")?;
105129

106130
println!("✓ Generated src/game/ascii_rank_titles_generated.rs");
@@ -120,4 +144,4 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
120144
}
121145

122146
Ok(())
123-
}
147+
}

src/cli/config.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ impl Default for Config {
2222
fn default() -> Self {
2323
Self {
2424
extraction: ExtractionConfig {
25-
languages: vec!["rust".to_string(), "typescript".to_string(), "python".to_string()],
25+
languages: vec![
26+
"rust".to_string(),
27+
"typescript".to_string(),
28+
"python".to_string(),
29+
],
2630
max_lines: 40,
2731
include: vec!["src/**".to_string()],
2832
exclude: vec!["target/**".to_string(), "node_modules/**".to_string()],
@@ -33,4 +37,4 @@ impl Default for Config {
3337
},
3438
}
3539
}
36-
}
40+
}

src/cli/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
pub mod config;
22

3-
pub use config::Config;
3+
pub use config::Config;

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ pub enum GitTypeError {
3030
WalkDirError(#[from] walkdir::Error),
3131
}
3232

33-
pub type Result<T> = std::result::Result<T, GitTypeError>;
33+
pub type Result<T> = std::result::Result<T, GitTypeError>;

src/extractor/centered_progress.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ impl ProgressReporter for CenteredProgressReporter {
4141
fn update_spinner(&self) {
4242
self.display.update_spinner();
4343
}
44-
44+
4545
fn finish(&self) -> crate::Result<()> {
4646
self.display.show_completion()
4747
}
48-
}
48+
}

0 commit comments

Comments
 (0)