Skip to content

Commit

Permalink
fix: add support for "in more detail"
Browse files Browse the repository at this point in the history
  • Loading branch information
hippietrail committed Mar 8, 2025
1 parent ab00aa0 commit d8eccfd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions harper-core/src/linting/phrase_corrections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,12 @@ pub fn lint_group() -> LintGroup {
"Use singular `in detail` for referring to a detailed description.",
"Correct unidiomatic plural `in details` to `in detail`."
),
"InMoreDetail" => (
["in more details"],
["in more detail"],
"Use singular `in more detail` for referring to a detailed description.",
"Correct unidiomatic plural `in more details` to `in more detail`."
),
});

group.set_all_rules_to(Some(true));
Expand Down Expand Up @@ -863,6 +869,11 @@ mod tests {
assert_suggestion_result("in details", lint_group(), "in detail");
}

#[test]
fn in_more_detail_atomic() {
assert_suggestion_result("in more details", lint_group(), "in more detail");
}

#[test]
fn in_detail_real_world() {
assert_suggestion_result(
Expand All @@ -871,4 +882,13 @@ mod tests {
"c++ - who can tell me \"*this pointer\" in detail?",
);
}

#[test]
fn in_more_detail_real_world() {
assert_suggestion_result(
"Document the interface in more details · Issue #3 · owlbarn ...",
lint_group(),
"Document the interface in more detail · Issue #3 · owlbarn ...",
);
}
}

0 comments on commit d8eccfd

Please sign in to comment.