Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

feat: IIRC correctly→IIRC (#1566)

Andrew Dunbarb6f66f5b93a9
diff --git a/harper-core/dictionary.dict b/harper-core/dictionary.dict
index 01b7ce355..55ec26280 100644
--- a/harper-core/dictionary.dict
+++ b/harper-core/dictionary.dict
@@ -4753,6 +4753,7 @@ IDF/Og # Israel's military
IE/ONJ
IED/N # improvised explosive device
IEEE/O # standards organization
+IIRC # If I recall correctly
IKEA/Og # furniture company
IL/NO
IMF/Og # International Monetary Fund
diff --git a/harper-core/src/linting/phrase_corrections/mod.rs b/harper-core/src/linting/phrase_corrections/mod.rs
index a7f9e1ed2..de8ec731b 100644
--- a/harper-core/src/linting/phrase_corrections/mod.rs
+++ b/harper-core/src/linting/phrase_corrections/mod.rs
@@ -733,6 +733,11 @@ pub fn lint_group() -> LintGroup {
"Use the correct phrase for someone who perseveres.",
"Ensures the correct use of `real trouper`, distinguishing it from `trooper`, which refers to a soldier or police officer."
),
+ "RedundantIIRC" => (
+ ["if IIRC", "IIRC correctly"], ["IIRC"],
+ "`IIRC` already means 'if I recall correctly', so adding 'if' or 'correctly' is redundant.",
+ "Flags redundant use of 'if' or 'correctly' with 'IIRC', since 'IIRC' already stands for 'if I recall correctly'."
+ ),
"RifeWith" => (
["ripe with"],
["rife with"],
diff --git a/harper-core/src/linting/phrase_corrections/tests.rs b/harper-core/src/linting/phrase_corrections/tests.rs
index bc3757c31..dd31f16de 100644
--- a/harper-core/src/linting/phrase_corrections/tests.rs
+++ b/harper-core/src/linting/phrase_corrections/tests.rs
@@ -1005,6 +1005,35 @@ fn corrects_points_of_view() {
// RealTrouper
// -none-
+// RedundantIIRC
+#[test]
+#[ignore = "The bug in replace_with_match_case erroneously generates `iiRC`."]
+fn correct_if_iirc_caps() {
+ assert_suggestion_result(
+ "This is due to the fact that if IIRC up to 2 processes mpirun will bind to core and then it will be socket.",
+ lint_group(),
+ "This is due to the fact that IIRC up to 2 processes mpirun will bind to core and then it will be socket.",
+ );
+}
+
+#[test]
+fn correct_if_iirc() {
+ assert_suggestion_result(
+ "if iirc getting it to work with the SQLite storage engine was turning into a whole project and we decided to punt it",
+ lint_group(),
+ "iirc getting it to work with the SQLite storage engine was turning into a whole project and we decided to punt it",
+ );
+}
+
+#[test]
+fn correct_iirc_correctly() {
+ assert_suggestion_result(
+ "IIRC correctly, someone on the Home Assistant forums went as far as discovering that RS-485 was being used.",
+ lint_group(),
+ "IIRC, someone on the Home Assistant forums went as far as discovering that RS-485 was being used.",
+ );
+}
+
// RifeWith
// -none-