Skip to content

Commit 19e50fd

Browse files
Update debug statements (#32)
Co-authored-by: Jane Doe <bot@email.com>
1 parent eef39fd commit 19e50fd

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

src/config.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,6 @@ impl Conf {
181181
} else {
182182
count.parse().unwrap_or(1)
183183
};
184-
println!(
185-
"DEBUG: prob={}, count={}, count_for_this_type={}, parsed_count={}",
186-
probability, count, count_for_this_type, parsed_count
187-
);
188184
for _ in 0..count_for_this_type {
189185
sequence.push(parsed_count);
190186
}
@@ -214,10 +210,6 @@ impl Conf {
214210
// Use PR number to index into the uniform sequence
215211
let pr_index = (pr_number - 1) % 1000; // Convert to 0-based index
216212
let result = sequence[pr_index as usize];
217-
println!(
218-
"DEBUG: pr_number={}, pr_index={}, result={}",
219-
pr_number, pr_index, result
220-
);
221213
return result;
222214
}
223215

src/main.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ fn create_pull_request(
345345
dry_run: bool,
346346
gh_token: &str,
347347
base_branch: &str,
348-
) -> Result<String, String> {
348+
) -> Result<(String, usize), String> {
349349
let current_branch = git(&["branch", "--show-current"]);
350350

351351
// Checkout the base branch (will fetch from origin if needed)
@@ -357,6 +357,7 @@ fn create_pull_request(
357357
// Now edit the files to create changes (after we're on the correct base branch)
358358
let next_pr_number = last_pr + 1;
359359
let words = edit_files_for_pr(filenames, next_pr_number, config);
360+
let deps_count = words.len();
360361

361362
let branch_name = format!("change/{}", words.join("-"));
362363
git(&["checkout", "-b", &branch_name]);
@@ -440,7 +441,7 @@ fn create_pull_request(
440441
if dry_run {
441442
git(&["checkout", &current_branch]);
442443
git(&["pull"]);
443-
return Ok((last_pr + 1).to_string());
444+
return Ok(((last_pr + 1).to_string(), deps_count));
444445
}
445446

446447
let result = try_gh(args.as_slice(), gh_token);
@@ -461,7 +462,7 @@ fn create_pull_request(
461462
let caps = re.captures(pr_url.trim()).unwrap();
462463
let pr_number = caps.get(2).map_or("", |m| m.as_str());
463464

464-
Ok(pr_number.to_string())
465+
Ok((pr_number.to_string(), deps_count))
465466
}
466467

467468
fn generate(config: &Conf, cli: &Cli) -> anyhow::Result<()> {
@@ -549,12 +550,13 @@ fn generate(config: &Conf, cli: &Cli) -> anyhow::Result<()> {
549550
continue;
550551
}
551552
let duration = start.elapsed();
552-
let pr = pr_result.unwrap();
553+
let (pr, deps_count) = pr_result.unwrap();
553554
println!(
554-
"created pr: {} (target: {}) in {:?} // waiting: {} mins",
555+
"created pr: {} (target: {}, deps: {}) in {}s // waiting: {} mins",
555556
pr,
556557
base_branch,
557-
duration,
558+
deps_count,
559+
duration.as_secs(),
558560
(pull_request_every as f32 / 60.0)
559561
);
560562
thread::sleep(Duration::from_secs(pull_request_every) / 2);

0 commit comments

Comments
 (0)