Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
feat: side tangent→tangent/aside (#3298)
Andrew Dunbar72061c831cd4
diff --git a/harper-core/default_config.json b/harper-core/default_config.jsonindex 92eb898e2..fea55bae7 100644--- a/harper-core/default_config.json+++ b/harper-core/default_config.json@@ -3003,6 +3003,13 @@"state": true,"label": "Was Comprised Of"}+ },+ {+ "Bool": {+ "name": "SideTangent",+ "state": true,+ "label": "Side Tangent"+ }}]}diff --git a/harper-core/src/linting/phrase_set_corrections/mod.rs b/harper-core/src/linting/phrase_set_corrections/mod.rsindex ba7c5b5f1..9b31df6e6 100644--- a/harper-core/src/linting/phrase_set_corrections/mod.rs+++ b/harper-core/src/linting/phrase_set_corrections/mod.rs@@ -900,6 +900,16 @@ pub fn lint_group() -> LintGroup {"Corrects `rise the question` to `raise the question`.",LintKind::Grammar),+ "SideTangent" => (+ &[+ (&["a side tangent"], &["a tangent", "an aside"]),+ (&["side tangent"], &["tangent", "aside"]),+ (&["side tangents"], &["tangents", "aside"])+ ],+ "The word `side` is redundant in this phrase.",+ "Corrects redundant `side tangent` and `side tangents` to more concise alternatives.",+ LintKind::Redundancy+ ),"ToTooIdioms" => (&[(&["a bridge to far"], &["a bridge too far"]),diff --git a/harper-core/src/linting/phrase_set_corrections/tests.rs b/harper-core/src/linting/phrase_set_corrections/tests.rsindex cb2f44875..36f69fbed 100644--- a/harper-core/src/linting/phrase_set_corrections/tests.rs+++ b/harper-core/src/linting/phrase_set_corrections/tests.rs@@ -3104,6 +3104,35 @@ fn detect_arisen_the_question() {);}+// SideTangent++#[test]+fn fix_side_tangent_start_of_sentence() {+ assert_suggestion_result(+ "Side tangent: I personally wouldn't worry about using ; for removing the selection unless you need to.",+ lint_group(),+ "Tangent: I personally wouldn't worry about using ; for removing the selection unless you need to.",+ );+}++#[test]+fn fix_side_tangent_aside() {+ assert_suggestion_result(+ "As a side tangent, in addition to not solving the gradual code repair problem",+ lint_group(),+ "As an aside, in addition to not solving the gradual code repair problem",+ );+}++#[test]+fn fix_side_tangents() {+ assert_suggestion_result(+ "so we don't get bogged down by tiny formatting bikeshedding side tangents",+ lint_group(),+ "so we don't get bogged down by tiny formatting bikeshedding tangents",+ );+}+// ToToo// -a bridge too far-