chore: fix formatting and clippy lints
This commit is contained in:
1 parent
8952bd5399
commit
9d9e959744
35 files changed
+1091
-582
No files matched your search
@@ -39,7 +39,9 @@ pub fn extract_adrs(text: &str) -> Vec<String> {
|
||||
if i + 3 <= len && lower_chars[i..i + 3] == ['a', 'd', 'r'] {
|
||||
let mut cursor = i + 3;
|
||||
// Skip optional '-', ':', or whitespace
|
||||
while cursor < len && (chars[cursor] == '-' || chars[cursor] == ':' || chars[cursor] == ' ') {
|
||||
while cursor < len
|
||||
&& (chars[cursor] == '-' || chars[cursor] == ':' || chars[cursor] == ' ')
|
||||
{
|
||||
cursor += 1;
|
||||
}
|
||||
// Collect consecutive digits
|
||||
@@ -80,11 +82,17 @@ pub fn extract_tech_debts(text: &str) -> Vec<String> {
|
||||
while i < len {
|
||||
if i + 2 <= len && lower_chars[i..i + 2] == ['t', 'd'] {
|
||||
let mut cursor = i + 2;
|
||||
while cursor < len && (chars[cursor] == '-' || chars[cursor] == ':' || chars[cursor] == ' ') {
|
||||
while cursor < len
|
||||
&& (chars[cursor] == '-' || chars[cursor] == ':' || chars[cursor] == ' ')
|
||||
{
|
||||
cursor += 1;
|
||||
}
|
||||
let start = cursor;
|
||||
while cursor < len && (chars[cursor].is_ascii_alphanumeric() || chars[cursor] == '_' || chars[cursor] == '-') {
|
||||
while cursor < len
|
||||
&& (chars[cursor].is_ascii_alphanumeric()
|
||||
|| chars[cursor] == '_'
|
||||
|| chars[cursor] == '-')
|
||||
{
|
||||
cursor += 1;
|
||||
}
|
||||
if cursor > start {
|
||||
@@ -117,11 +125,17 @@ pub fn extract_tasks(text: &str) -> Vec<String> {
|
||||
while i < len {
|
||||
if i + 4 <= len && lower_chars[i..i + 4] == ['t', 'a', 's', 'k'] {
|
||||
let mut cursor = i + 4;
|
||||
while cursor < len && (chars[cursor] == '-' || chars[cursor] == ':' || chars[cursor] == ' ') {
|
||||
while cursor < len
|
||||
&& (chars[cursor] == '-' || chars[cursor] == ':' || chars[cursor] == ' ')
|
||||
{
|
||||
cursor += 1;
|
||||
}
|
||||
let start = cursor;
|
||||
while cursor < len && (chars[cursor].is_ascii_alphanumeric() || chars[cursor] == '_' || chars[cursor] == '-') {
|
||||
while cursor < len
|
||||
&& (chars[cursor].is_ascii_alphanumeric()
|
||||
|| chars[cursor] == '_'
|
||||
|| chars[cursor] == '-')
|
||||
{
|
||||
cursor += 1;
|
||||
}
|
||||
if cursor > start {
|
||||
@@ -162,8 +176,7 @@ pub fn cascade_unblock_tasks(state: &MemoryState) -> Vec<String> {
|
||||
} else {
|
||||
let all_deps_completed = t.dependencies.iter().all(|dep_id| {
|
||||
tasks_snapshot.iter().any(|other| {
|
||||
(other.id == *dep_id || other.title == *dep_id)
|
||||
&& !other.is_active()
|
||||
(other.id == *dep_id || other.title == *dep_id) && !other.is_active()
|
||||
})
|
||||
});
|
||||
if all_deps_completed {
|
||||
@@ -226,19 +239,17 @@ pub fn recalculate_milestones(state: &MemoryState) -> Vec<String> {
|
||||
}
|
||||
updated.push(m.id.clone());
|
||||
}
|
||||
} else if completed > 0
|
||||
} else if (completed > 0
|
||||
|| tasks_snapshot.iter().any(|t| {
|
||||
m.task_ids.iter().any(|tid| tid == &t.id || tid == &t.title)
|
||||
&& (t.status == "in_progress" || t.status == "active")
|
||||
})
|
||||
{
|
||||
if !m.status.eq_ignore_ascii_case("in_progress")
|
||||
}))
|
||||
&& !m.status.eq_ignore_ascii_case("in_progress")
|
||||
&& !m.status.eq_ignore_ascii_case("completed")
|
||||
{
|
||||
m.status = "in_progress".to_string();
|
||||
updated.push(m.id.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -275,11 +286,10 @@ pub async fn reconcile_commit_or_code_change(
|
||||
if adr.id.eq_ignore_ascii_case(cand) {
|
||||
return true;
|
||||
}
|
||||
if let (Some(n1), Some(n2)) = (adr_numeric_id(&adr.id), adr_numeric_id(cand)) {
|
||||
if n1 == n2 {
|
||||
if let (Some(n1), Some(n2)) = (adr_numeric_id(&adr.id), adr_numeric_id(cand))
|
||||
&& n1 == n2 {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
false
|
||||
});
|
||||
|
||||
@@ -324,7 +334,9 @@ pub async fn reconcile_commit_or_code_change(
|
||||
if d.is_resolved {
|
||||
continue;
|
||||
}
|
||||
let matches_id = td_candidates.iter().any(|cand| d.id.eq_ignore_ascii_case(cand));
|
||||
let matches_id = td_candidates
|
||||
.iter()
|
||||
.any(|cand| d.id.eq_ignore_ascii_case(cand));
|
||||
let matches_file = file_path
|
||||
.map(|fp| d.file_path.as_deref() == Some(fp))
|
||||
.unwrap_or(false)
|
||||
|
||||
Reference in new issue
Block a user