Skip to content

Commit 5987f9a

Browse files
haasonsaasclaude
andcommitted
fix: resolve build warnings and macOS checksum issue
- Fix sha256sum command on macOS by using shasum -a 256 - Prefix unused variables and fields with underscore - Apply cargo fix for unused imports - Add #[allow(dead_code)] for future-use code - Clean up all compilation warnings The build now compiles without any warnings, and the checksum generation will work correctly on both Linux and macOS. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ebe818a commit 5987f9a

File tree

10 files changed

+25
-17
lines changed

10 files changed

+25
-17
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,11 @@ jobs:
142142
run: |
143143
cd target/${{ matrix.target }}/release/
144144
if [ -f "${{ matrix.artifact_name }}" ]; then
145-
sha256sum ${{ matrix.artifact_name }} > ${{ matrix.asset_name }}.sha256
145+
if [[ "$RUNNER_OS" == "macOS" ]]; then
146+
shasum -a 256 ${{ matrix.artifact_name }} > ${{ matrix.asset_name }}.sha256
147+
else
148+
sha256sum ${{ matrix.artifact_name }} > ${{ matrix.asset_name }}.sha256
149+
fi
146150
else
147151
echo "Binary not found, build may have failed"
148152
exit 1

src/adapters/anthropic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl LLMAdapter for AnthropicAdapter {
128128
})
129129
}
130130

131-
fn model_name(&self) -> &str {
131+
fn _model_name(&self) -> &str {
132132
&self.config.model_name
133133
}
134134
}

src/adapters/llm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub struct Usage {
4848
#[async_trait]
4949
pub trait LLMAdapter: Send + Sync {
5050
async fn complete(&self, request: LLMRequest) -> Result<LLMResponse>;
51-
fn model_name(&self) -> &str;
51+
fn _model_name(&self) -> &str;
5252
}
5353

5454
pub fn create_adapter(config: &ModelConfig) -> Result<Box<dyn LLMAdapter>> {

src/adapters/ollama.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ struct OllamaResponse {
2525
response: String,
2626
model: String,
2727
done: bool,
28-
context: Option<Vec<i32>>,
29-
total_duration: Option<u64>,
28+
_context: Option<Vec<i32>>,
29+
_total_duration: Option<u64>,
3030
prompt_eval_count: Option<usize>,
3131
eval_count: Option<usize>,
3232
}
@@ -94,7 +94,7 @@ impl LLMAdapter for OllamaAdapter {
9494
})
9595
}
9696

97-
fn model_name(&self) -> &str {
97+
fn _model_name(&self) -> &str {
9898
&self.config.model_name
9999
}
100100
}

src/adapters/openai.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl LLMAdapter for OpenAIAdapter {
120120
})
121121
}
122122

123-
fn model_name(&self) -> &str {
123+
fn _model_name(&self) -> &str {
124124
&self.config.model_name
125125
}
126126
}

src/core/changelog.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub struct ChangelogEntry {
99
pub commit_hash: String,
1010
pub message: String,
1111
pub author: String,
12-
pub date: DateTime<Local>,
12+
pub _date: DateTime<Local>,
1313
pub change_type: ChangeType,
1414
pub scope: Option<String>,
1515
pub breaking: bool,
@@ -172,7 +172,7 @@ impl ChangelogGenerator {
172172
commit_hash: format!("{:.7}", commit.id()),
173173
message: description,
174174
author: commit.author().name().unwrap_or("Unknown").to_string(),
175-
date: DateTime::from_timestamp(commit.time().seconds(), 0)
175+
_date: DateTime::from_timestamp(commit.time().seconds(), 0)
176176
.unwrap_or_default()
177177
.with_timezone(&Local),
178178
change_type,
@@ -195,7 +195,7 @@ impl ChangelogGenerator {
195195
commit_hash: format!("{:.7}", commit.id()),
196196
message: first_line.to_string(),
197197
author: commit.author().name().unwrap_or("Unknown").to_string(),
198-
date: DateTime::from_timestamp(commit.time().seconds(), 0)
198+
_date: DateTime::from_timestamp(commit.time().seconds(), 0)
199199
.unwrap_or_default()
200200
.with_timezone(&Local),
201201
change_type,
@@ -216,7 +216,7 @@ impl ChangelogGenerator {
216216
// Header
217217
output.push_str("# Changelog\n\n");
218218

219-
let date = Local::now().format("%Y-%m-%d");
219+
let _date = Local::now().format("%Y-%m-%d");
220220
output.push_str(&format!("## [{} - {}]\n\n",
221221
from_tag.unwrap_or("Start"),
222222
to_ref

src/core/interactive.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ use regex::Regex;
33
use std::collections::HashSet;
44
use crate::adapters::llm::{LLMAdapter, LLMRequest};
55

6+
#[allow(dead_code)]
67
pub struct InteractiveCommand {
78
pub command: CommandType,
89
pub args: Vec<String>,
910
pub context: Option<String>,
1011
}
1112

13+
#[allow(dead_code)]
1214
#[derive(Debug, Clone, PartialEq)]
1315
pub enum CommandType {
1416
Review,
@@ -19,6 +21,7 @@ pub enum CommandType {
1921
Config,
2022
}
2123

24+
#[allow(dead_code)]
2225
impl InteractiveCommand {
2326
pub fn parse(comment: &str) -> Option<Self> {
2427
let command_regex = Regex::new(r"@diffscope\s+(\w+)(?:\s+(.*))?").ok()?;
@@ -222,10 +225,12 @@ Interactive commands respect these configurations."#.to_string()
222225
}
223226
}
224227

228+
#[allow(dead_code)]
225229
pub struct InteractiveProcessor {
226230
ignored_patterns: HashSet<String>,
227231
}
228232

233+
#[allow(dead_code)]
229234
impl InteractiveProcessor {
230235
pub fn new() -> Self {
231236
Self {

src/core/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ pub use comment::{Comment, CommentSynthesizer};
1616
pub use git::GitIntegration;
1717
pub use commit_prompt::CommitPromptBuilder;
1818
pub use smart_review_prompt::SmartReviewPromptBuilder;
19-
pub use pr_summary::{PRSummaryGenerator, PRSummary};
20-
pub use interactive::{InteractiveCommand, InteractiveProcessor};
19+
pub use pr_summary::PRSummaryGenerator;
2120
pub use changelog::ChangelogGenerator;

src/core/pr_summary.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use anyhow::Result;
22
use crate::core::{UnifiedDiff, GitIntegration};
33
use crate::adapters::llm::{LLMAdapter, LLMRequest};
4-
use std::collections::HashMap;
54

65
pub struct PRSummaryGenerator;
76

@@ -150,7 +149,7 @@ TESTING_NOTES: [what to test]"#.to_string()
150149
breaking_changes: None,
151150
testing_notes: String::new(),
152151
stats,
153-
visual_diff: None,
152+
_visual_diff: None,
154153
};
155154

156155
// Parse structured response
@@ -204,7 +203,7 @@ pub struct PRSummary {
204203
pub breaking_changes: Option<String>,
205204
pub testing_notes: String,
206205
pub stats: ChangeStats,
207-
pub visual_diff: Option<String>,
206+
pub _visual_diff: Option<String>,
208207
}
209208

210209
#[derive(Debug, Clone)]

src/plugins/plugin.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use crate::core::{UnifiedDiff, LLMContextChunk, Comment};
66
use crate::plugins::{PreAnalyzer, PostProcessor};
77

88
#[async_trait]
9+
#[allow(dead_code)]
910
pub trait Plugin: Send + Sync {
1011
fn id(&self) -> &str;
1112
fn name(&self) -> &str;
@@ -16,7 +17,7 @@ pub trait Plugin: Send + Sync {
1617
}
1718

1819
pub struct PluginManager {
19-
plugins: HashMap<String, Arc<dyn Plugin>>,
20+
_plugins: HashMap<String, Arc<dyn Plugin>>,
2021
pre_analyzers: Vec<Arc<dyn PreAnalyzer>>,
2122
post_processors: Vec<Arc<dyn PostProcessor>>,
2223
}

0 commit comments

Comments
 (0)