Skip to content

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

feat(core): create the Weir language (#2357)

Elijah Potter46f4547f7396
diff --git a/harper-cli/src/main.rs b/harper-cli/src/main.rs
index 41c37d5f6..6d55e5ade 100644
--- a/harper-cli/src/main.rs
+++ b/harper-cli/src/main.rs
@@ -7,7 +7,7 @@ use std::fs::File;
use std::io::BufReader;
use std::path::PathBuf;
// use std::sync::Arc;
-use std::fs;
+use std::{fs, process};
use anyhow::anyhow;
use ariadne::{Color, Label, Report, ReportKind, Source};
@@ -15,6 +15,7 @@ use clap::Parser;
use dirs::{config_dir, data_local_dir};
use harper_core::linting::LintGroup;
use harper_core::parsers::MarkdownOptions;
+use harper_core::weir::WeirLinter;
use harper_core::{
CharStringExt, Dialect, DictWordMetadata, OrthFlags, Span, TokenKind, TokenStringExt,
};
@@ -188,6 +189,11 @@ enum Args {
/// The text or file to analyze. If not provided, it will be read from standard input.
input: Option<SingleInput>,
},
+ /// Run the tests contained within a Weir file.
+ Test {
+ /// The location of the Weir file to test
+ input: PathBuf,
+ },
}
fn main() -> anyhow::Result<()> {
@@ -912,6 +918,20 @@ fn main() -> anyhow::Result<()> {
Ok(())
}
+ Args::Test { input } => {
+ let weir_file = fs::read_to_string(input)?;
+ let mut linter = WeirLinter::new(&weir_file)?;
+
+ let failing_tests = linter.run_tests();
+
+ if failing_tests.is_empty() {
+ eprintln!("All tests pass!");
+ Ok(())
+ } else {
+ eprintln!("{:?}", failing_tests);
+ process::exit(1);
+ }
+ }
}
}
diff --git a/harper-core/build.rs b/harper-core/build.rs
new file mode 100644
index 000000000..3246b7d63
--- /dev/null
+++ b/harper-core/build.rs
@@ -0,0 +1,44 @@
+use std::{env, fs, path::PathBuf};
+
+fn main() {
+ let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
+ let weir_rule_dir = manifest_dir.join("./src/linting/weir_rules");
+ let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
+ let dest = out_dir.join("weir_rules_generated_list.rs");
+
+ let mut files: Vec<PathBuf> = fs::read_dir(&weir_rule_dir)
+ .unwrap()
+ .filter_map(Result::ok)
+ .filter(|e| e.file_type().unwrap().is_file())
+ .map(|e| e.path().to_path_buf())
+ .collect();
+
+ files.sort();
+
+ let mut code = String::new();
+
+ code.push_str("generate_boilerplate!{[");
+
+ for file in files {
+ if file
+ .file_name()
+ .unwrap()
+ .to_string_lossy()
+ .ends_with(".weir")
+ {
+ code.push_str(&format!(
+ "{},\n",
+ file.file_stem().unwrap().to_str().unwrap()
+ ));
+ }
+ }
+
+ code.push_str("]}");
+
+ fs::write(&dest, code).unwrap();
+
+ println!("cargo:rerun-if-changed={}", weir_rule_dir.display());
+ println!("cargo:rerun-if-changed=build.rs");
+ println!("cargo:rustc-env=WEIR_RULE_DIR={}", weir_rule_dir.display());
+ println!("cargo:rustc-env=WEIR_RULE_LIST={}", dest.display());
+}
diff --git a/harper-core/src/document.rs b/harper-core/src/document.rs
index 7f0ebc076..0ee714afe 100644
--- a/harper-core/src/document.rs
+++ b/harper-core/src/document.rs
@@ -133,7 +133,6 @@ impl Document {
self.condense_spaces();
self.condense_newlines();
self.newlines_to_breaks();
- self.condense_contractions();
self.condense_dotted_initialisms();
self.condense_number_suffixes();
self.condense_ellipsis();
@@ -844,27 +843,6 @@ impl Document {
tok.kind = TokenKind::Punctuation(Punctuation::Ellipsis)
});
}
-
- fn uncached_contraction_expr() -> Lrc<SequenceExpr> {
- Lrc::new(
- SequenceExpr::default()
- .then_any_word()
- .then_apostrophe()
- .then_any_word(),
- )
- }
-
- thread_local! {
- static CONTRACTION_EXPR: Lrc<SequenceExpr> = Document::uncached_contraction_expr();
- }
-
- /// Searches for contractions and condenses them down into single
- /// tokens.
- fn condense_contractions(&mut self) {
- let expr = Self::CONTRACTION_EXPR.with(|v| v.clone());
-
- self.condense_expr(&expr, |_| {})
- }
}
/// Creates functions necessary to implement [`TokenStringExt]` on a document.
diff --git a/harper-core/src/expr/filter.rs b/harper-core/src/expr/filter.rs
new file mode 100644
index 000000000..10440f120
--- /dev/null
+++ b/harper-core/src/expr/filter.rs
@@ -0,0 +1,63 @@
+use crate::{Span, Token};
+
+use super::Expr;
+
+/// An expression that wraps other expressions to build a filter-line pipeline.
+///
+/// For example, let's say you wanted to build an expression that matches the spaces between two
+/// specific words.
+/// To do this, you could start with expression A that detects the pattern `<WORD> <WORD>`. That is,
+/// a word, followed by a space, followed by a second word. You could then build Expression B, that
+/// simply matches the space. By combining these using a filter, you end up building an expression
+/// that matches expression A first, then narrows the result further to only match the resulting
+/// space.
+///
+/// ``` rust
+/// use harper_core::patterns::WhitespacePattern;
+/// use harper_core::expr::{SequenceExpr, Filter, ExprExt};
+/// use harper_core::{Span, Document};
+///
+/// let a = SequenceExpr::aco("chock").t_ws().t_aco("full");
+/// let b = WhitespacePattern;
+///
+/// let filter = Filter::new(vec![Box::new(a), Box::new(b)]);
+/// let doc = Document::new_markdown_default_curated("This test is chock full of insights.");
+///
+/// let matches: Vec<_> = filter.iter_matches_in_doc(&doc).collect();
+/// assert_eq!(vec![Span::new(7, 8)], matches)
+/// ```
+pub struct Filter {
+ steps: Vec<Box<dyn Expr>>,
+}
+
+impl Filter {
+ pub fn new(steps: Vec<Box<dyn Expr>>) -> Self {
+ Self { steps }
+ }
+}
+
+impl Expr for Filter {
+ fn run(&self, cursor: usize, tokens: &[Token], source: &[char]) -> Option<Span<Token>> {
+ let mut result = self.steps.first()?.run(cursor, tokens, source)?;
+
+ for step in self.steps.iter().skip(1) {
+ let mut found = false;
+
+ for i in 0..result.len() {
+ let step_res = step.run(i, result.get_content(tokens), source);
+
+ if let Some(step) = step_res {
+ result = step.pushed_by(result.start);
+ found = true;
+ break;
+ }
+ }
+
+ if !found {
+ return None;
+ }
+ }
+
+ Some(result)
+ }
+}
diff --git a/harper-core/src/expr/first_match_of.rs b/harper-core/src/expr/first_match_of.rs
index 0d21b29d1..c41eb91ca 100644
--- a/harper-core/src/expr/first_match_of.rs
+++ b/harper-core/src/expr/first_match_of.rs
@@ -18,6 +18,10 @@ impl FirstMatchOf {
pub fn add(&mut self, expr: impl Expr + 'static) {
self.exprs.push(Box::new(expr));
}
+
+ pub fn add_boxed(&mut self, expr: Box<dyn Expr>) {
+ self.exprs.push(Box::new(expr));
+ }
}
impl Expr for FirstMatchOf {
diff --git a/harper-core/src/expr/mod.rs b/harper-core/src/expr/mod.rs
index 51b8833ce..082866eb9 100644
--- a/harper-core/src/expr/mod.rs
+++ b/harper-core/src/expr/mod.rs
@@ -18,6 +18,7 @@ mod anchor_end;
mod anchor_start;
mod duration_expr;
mod expr_map;
+mod filter;
mod first_match_of;
mod fixed_phrase;
mod longest_match_of;
@@ -43,6 +44,7 @@ pub use anchor_end::AnchorEnd;
pub use anchor_start::AnchorStart;
pub use duration_expr::DurationExpr;
pub use expr_map::ExprMap;
+pub use filter::Filter;
pub use first_match_of::FirstMatchOf;
pub use fixed_phrase::FixedPhrase;
pub use longest_match_of::LongestMatchOf;
@@ -89,6 +91,12 @@ where
}
}
+impl Expr for Box<dyn Expr> {
+ fn run(&self, cursor: usize, tokens: &[Token], source: &[char]) -> Option<Span<Token>> {
+ self.as_ref().run(cursor, tokens, source)
+ }
+}
+
#[cfg(not(feature = "concurrent"))]
impl<E> Expr for Rc<E>
where
diff --git a/harper-core/src/expr/sequence_expr.rs b/harper-core/src/expr/sequence_expr.rs
index 5c6d8c940..5b7274c63 100644
--- a/harper-core/src/expr/sequence_expr.rs
+++ b/harper-core/src/expr/sequence_expr.rs
@@ -141,6 +141,12 @@ impl SequenceExpr {
self
}
+ /// Push an already-boxed [expression](Expr) to the operation list.
+ pub fn then_boxed(mut self, expr: Box<dyn Expr>) -> Self {
+ self.exprs.push(expr);
+ self
+ }
+
/// Pushes an expression that could move the cursor to the sequence, but does not require it.
pub fn then_optional(mut self, expr: impl Expr + 'static) -> Self {
self.exprs.push(Box::new(Optional::new(expr)));
diff --git a/harper-core/src/lexing/mod.rs b/harper-core/src/lexing/mod.rs
index 94babbe3d..2189f067a 100644
--- a/harper-core/src/lexing/mod.rs
+++ b/harper-core/src/lexing/mod.rs
@@ -19,7 +19,33 @@ pub struct FoundToken {
pub token: TokenKind,
}
-pub fn lex_token(source: &[char]) -> Option<FoundToken> {
+pub fn lex_weir_token(source: &[char]) -> Option<FoundToken> {
+ let lexers = [
+ lex_punctuation,
+ lex_tabs,
+ lex_spaces,
+ lex_newlines,
+ lex_plural_digit, // Before lex_number, which would match the initial digit
+ lex_hex_number, // Before lex_number, which would match the initial 0
+ lex_long_decade, // Before lex_number, which would match the digits up to the -s
+ lex_number,
+ lex_url,
+ lex_email_address,
+ lex_hostname_token,
+ lex_word,
+ lex_catch,
+ ];
+
+ for lexer in lexers {
+ if let Some(f) = lexer(source) {
+ return Some(f);
+ }
+ }
+
+ None
+}
+
+pub fn lex_english_token(source: &[char]) -> Option<FoundToken> {
let lexers = [
lex_regexish,
lex_punctuation,
@@ -47,11 +73,17 @@ pub fn lex_token(source: &[char]) -> Option<FoundToken> {
}
fn lex_word(source: &[char]) -> Option<FoundToken> {
- let end = source
+ let is_tack = |c: char| lex_punctuation(&[c]).is_some_and(|t| t.token.is_apostrophe());
+
+ let mut end = source
.iter()
- .position(|c| !c.is_english_lingual() && !c.is_ascii_digit())
+ .position(|c| !c.is_english_lingual() && !c.is_ascii_digit() && !is_tack(*c))
.unwrap_or(source.len());
+ while end >= 1 && is_tack(source[end - 1]) {
+ end -= 1;
+ }
+
if end == 0 {
None
} else {
@@ -62,7 +94,7 @@ fn lex_word(source: &[char]) -> Option<FoundToken> {
}
}
-pub fn lex_number(source: &[char]) -> Option<FoundToken> {
+fn lex_number(source: &[char]) -> Option<FoundToken> {
if source.is_empty() {
return None;
}
@@ -105,7 +137,7 @@ pub fn lex_number(source: &[char]) -> Option<FoundToken> {
// Often in comments we mention partial- or pseudo- regexes. Here's an example from Ghidra:
// ([a-z0-9]+ only) - We previously flagged just the z0 in the middle of it.
-pub fn lex_regexish(src: &[char]) -> Option<FoundToken> {
+fn lex_regexish(src: &[char]) -> Option<FoundToken> {
let l = src.len();
let mut i = 0;
@@ -139,7 +171,7 @@ pub fn lex_regexish(src: &[char]) -> Option<FoundToken> {
})
}
-pub fn lex_hex_number(source: &[char]) -> Option<FoundToken> {
+fn lex_hex_number(source: &[char]) -> Option<FoundToken> {
// < 3 to avoid accepting 0x alone
if source.len() < 3 || source[0] != '0' || source[1] != 'x' || !source[2].is_ascii_hexdigit() {
return None;
@@ -180,7 +212,7 @@ pub fn lex_hex_number(source: &[char]) -> Option<FoundToken> {
None
}
-pub fn lex_long_decade(source: &[char]) -> Option<FoundToken> {
+fn lex_long_decade(source: &[char]) -> Option<FoundToken> {
// lex 4-digit decades in their plural such as: 1980s 1990s 2000s 2020s
if source.len() < 5 {
return None;
@@ -207,7 +239,7 @@ pub fn lex_long_decade(source: &[char]) -> Option<FoundToken> {
})
}
-pub fn lex_plural_digit(src: &[char]) -> Option<FoundToken> {
+fn lex_plural_digit(src: &[char]) -> Option<FoundToken> {
// Issue #774
let l = src.len();
let mut i = 0;
@@ -314,10 +346,10 @@ mod tests {
use crate::char_string::char_string;
use crate::lexing::lex_plural_digit;
+ use super::lex_english_token;
use super::lex_hex_number;
use super::lex_long_decade;
use super::lex_number;
- use super::lex_token;
use super::lex_word;
use super::{FoundToken, TokenKind};
@@ -428,7 +460,7 @@ mod tests {
fn lexes_youtube_as_hostname() {
let source: Vec<_> = "youtube.com".chars().collect();
assert_eq!(
- lex_token(&source),
+ lex_english_token(&source),
Some(FoundToken {
token: TokenKind::Hostname,
next_index: source.len()
@@ -440,7 +472,7 @@ mod tests {
fn doesnt_lex_regex_mini_range() {
let source: Vec<_> = "[]".chars().collect();
assert!(!matches!(
- lex_token(&source),
+ lex_english_token(&source),
Some(FoundToken {
token: TokenKind::Regexish,
next_index: 2
@@ -452,7 +484,7 @@ mod tests {
fn lexes_regex_one_letter() {
let source: Vec<_> = "[a]".chars().collect();
assert_eq!(
- lex_token(&source),
+ lex_english_token(&source),
Some(FoundToken {
token: TokenKind::Regexish,
next_index: 3
@@ -464,7 +496,7 @@ mod tests {
fn lexes_regex_two_letters() {
let source: Vec<_> = "[az]".chars().collect();
assert_eq!(
- lex_token(&source),
+ lex_english_token(&source),
Some(FoundToken {
token: TokenKind::Regexish,
next_index: 4
@@ -476,7 +508,7 @@ mod tests {
fn lexes_regex_digits() {
let source: Vec<_> = "[123]".chars().collect();
assert_eq!(
- lex_token(&source),
+ lex_english_token(&source),
Some(FoundToken {
token: TokenKind::Regexish,
next_index: 5
@@ -488,7 +520,7 @@ mod tests {
fn lexes_regex_two_alphanumeric() {
let source: Vec<_> = "[a0b1c2]".chars().collect();
assert_eq!(
- lex_token(&source),
+ lex_english_token(&source),
Some(FoundToken {
token: TokenKind::Regexish,
next_index: 8
@@ -500,7 +532,7 @@ mod tests {
fn lexes_regex_one_range() {
let source: Vec<_> = "[a-z]".chars().collect();
assert_eq!(
- lex_token(&source),
+ lex_english_token(&source),
Some(FoundToken {
token: TokenKind::Regexish,
next_index: 5
@@ -512,7 +544,7 @@ mod tests {
fn lexes_regex_letter_plus_range() {
let source: Vec<_> = "[ax-z]".chars().collect();
assert_eq!(
- lex_token(&source),
+ lex_english_token(&source),
Some(FoundToken {
token: TokenKind::Regexish,
next_index: 6
@@ -524,7 +556,7 @@ mod tests {
fn lexes_regex_range_plus_letter() {
let source: Vec<_> = "[a-cz]".chars().collect();
assert_eq!(
- lex_token(&source),
+ lex_english_token(&source),
Some(FoundToken {
token: TokenKind::Regexish,
next_index: 6
@@ -536,7 +568,7 @@ mod tests {
fn lexes_regex_two_ranges() {
let source: Vec<_> = "[a-cx-z]".chars().collect();
assert_eq!(
- lex_token(&source),
+ lex_english_token(&source),
Some(FoundToken {
token: TokenKind::Regexish,
next_index: 8
@@ -549,7 +581,7 @@ mod tests {
// You can't end a range and start a range with a single letter
let source: Vec<_> = "[a-x-z]".chars().collect();
assert_eq!(
- lex_token(&source),
+ lex_english_token(&source),
Some(FoundToken {
token: TokenKind::Punctuation(Punctuation::OpenSquare),
next_index: 1
@@ -561,7 +593,7 @@ mod tests {
fn doesnt_lex_regex_hyphen_at_start() {
let source: Vec<_> = "[a-]".chars().collect();
assert!(!matches!(
- lex_token(&source),
+ lex_english_token(&source),
Some(FoundToken {
token: TokenKind::Regexish,
..
@@ -573,7 +605,7 @@ mod tests {
fn doesnt_lex_regex_hyphen_at_end() {
let source: Vec<_> = "[-z]".chars().collect();
assert!(!matches!(
- lex_token(&source),
+ lex_english_token(&source),
Some(FoundToken {
token: TokenKind::Regexish,
..
@@ -781,7 +813,7 @@ mod tests {
fn lexes_word_before_decade() {
let source: Vec<_> = "late 1980s".chars().collect();
assert!(matches!(
- lex_token(&source),
+ lex_english_token(&source),
Some(FoundToken {
token: TokenKind::Word(_),
..
@@ -793,7 +825,7 @@ mod tests {
fn lexes_word_after_decade() {
let source: Vec<_> = "1980s and".chars().collect();
assert!(matches!(
- lex_token(&source),
+ lex_english_token(&source),
Some(FoundToken {
token: TokenKind::Decade,
..
@@ -869,7 +901,7 @@ mod tests {
break; // Exit if we've processed the entire source
}
- let token = lex_token(&sentence[next_index..]).expect("Failed to lex token");
+ let token = lex_english_token(&sentence[next_index..]).expect("Failed to lex token");
assert_eq!(token.token, *expected_token);
next_index += token.next_index;
}
@@ -895,7 +927,7 @@ mod tests {
break; // Exit if we've processed the entire source
}
- let token = lex_token(&sentence[next_index..]).expect("Failed to lex token");
+ let token = lex_english_token(&sentence[next_index..]).expect("Failed to lex token");
if i < 6 {
assert_eq!(token.token, *expected_token);
diff --git a/harper-core/src/lib.rs b/harper-core/src/lib.rs
index 33ea32b2a..5807fb3a6 100644
--- a/harper-core/src/lib.rs
+++ b/harper-core/src/lib.rs
@@ -30,6 +30,7 @@ mod token;
mod token_kind;
mod token_string_ext;
mod vec_ext;
+pub mod weir;
use render_markdown::render_markdown;
use std::collections::{BTreeMap, VecDeque};
diff --git a/harper-core/src/linting/capitalize_personal_pronouns.rs b/harper-core/src/linting/capitalize_personal_pronouns.rs
index 82a722eb1..71b115c29 100644
--- a/harper-core/src/linting/capitalize_personal_pronouns.rs
+++ b/harper-core/src/linting/capitalize_personal_pronouns.rs
@@ -17,7 +17,7 @@ impl Linter for CapitalizePersonalPronouns {
span_content,
['i']
| ['i', '\'', 'd']
- | ['i', '\'', 'd', '\\', 'v', 'e']
+ | ['i', '\'', 'd', '\'', 'v', 'e']
| ['i', '\'', 'l', 'l']
| ['i', '\'', 'm']
| ['i', '\'', 'v', 'e']
diff --git a/harper-core/src/linting/chock_full.rs b/harper-core/src/linting/chock_full.rs
index 7edf50f3a..2bf71dc34 100644
--- a/harper-core/src/linting/chock_full.rs
+++ b/harper-core/src/linting/chock_full.rs
@@ -1,7 +1,6 @@
use crate::expr::Expr;
-use crate::expr::SequenceExpr;
-use crate::expr::SpaceOrHyphen;
-use crate::{Token, TokenStringExt, patterns::WordSet};
+use crate::weir::weir_expr_to_expr;
+use crate::{Token, TokenStringExt};
use super::{ExprLinter, Lint, LintKind, Suggestion};
use crate::linting::expr_linter::Chunk;
@@ -13,12 +12,7 @@ pub struct ChockFull {
impl Default for ChockFull {
fn default() -> Self {
Self {
- expr: Box::new(
- SequenceExpr::default()
- .then(WordSet::new(&["chalk", "choke"]))
- .then(SpaceOrHyphen)
- .then_exact_word("full"),
- ),
+ expr: weir_expr_to_expr("[chalk, choke][( ), -]full").unwrap(),
}
}
}
diff --git a/harper-core/src/linting/lint_group.rs b/harper-core/src/linting/lint_group.rs
index c85b9b512..c8d246b60 100644
--- a/harper-core/src/linting/lint_group.rs
+++ b/harper-core/src/linting/lint_group.rs
@@ -197,7 +197,6 @@ use super::touristic::Touristic;
use super::transposed_space::TransposedSpace;
use super::unclosed_quotes::UnclosedQuotes;
use super::update_place_names::UpdatePlaceNames;
-use super::use_genitive::UseGenitive;
use super::use_title_case::UseTitleCase;
use super::verb_to_adjective::VerbToAdjective;
use super::very_unique::VeryUnique;
@@ -216,7 +215,7 @@ use super::{HtmlDescriptionLinter, Linter};
use crate::linting::dashes::Dashes;
use crate::linting::expr_linter::Chunk;
use crate::linting::open_compounds::OpenCompounds;
-use crate::linting::{closed_compounds, initialisms, phrase_corrections, phrase_set_corrections};
+use crate::linting::{closed_compounds, initialisms, phrase_set_corrections, weir_rules};
use crate::spell::{Dictionary, MutableDictionary};
use crate::{CharString, Dialect, Document, TokenStringExt};
@@ -369,11 +368,16 @@ impl LintGroup {
/// Add a [`Linter`] to the group, returning whether the operation was successful.
/// If it returns `false`, it is because a linter with that key already existed in the group.
pub fn add(&mut self, name: impl AsRef<str>, linter: impl Linter + 'static) -> bool {
+ self.add_boxed(name, Box::new(linter))
+ }
+
+ /// Add an already-boxed [`Linter`] to the group, returning whether the operation was successful.
+ /// If it returns `false`, it is because a linter with that key already existed in the group.
+ pub fn add_boxed(&mut self, name: impl AsRef<str>, linter: Box<dyn Linter>) -> bool {
if self.contains_key(&name) {
false
} else {
- self.linters
- .insert(name.as_ref().to_string(), Box::new(linter));
+ self.linters.insert(name.as_ref().to_string(), linter);
true
}
}
@@ -485,7 +489,7 @@ impl LintGroup {
};
}
- out.merge_from(&mut phrase_corrections::lint_group());
+ out.merge_from(&mut weir_rules::lint_group());
out.merge_from(&mut phrase_set_corrections::lint_group());
out.merge_from(&mut proper_noun_capitalization_linters::lint_group(
dictionary.clone(),
@@ -670,7 +674,6 @@ impl LintGroup {
insert_expr_rule!(Touristic, true);
insert_struct_rule!(UnclosedQuotes, true);
insert_expr_rule!(UpdatePlaceNames, true);
- insert_expr_rule!(UseGenitive, false);
insert_expr_rule!(VerbToAdjective, true);
insert_expr_rule!(VeryUnique, true);
insert_expr_rule!(ViceVersa, true);
diff --git a/harper-core/src/linting/lint_kind.rs b/harper-core/src/linting/lint_kind.rs
index de6df9d7f..cb5c60186 100644
--- a/harper-core/src/linting/lint_kind.rs
+++ b/harper-core/src/linting/lint_kind.rs
@@ -55,6 +55,33 @@ pub enum LintKind {
}
impl LintKind {
+ /// The inverse of [`Self::to_string_key`]
+ pub fn from_string_key(s: &str) -> Option<Self> {
+ match s {
+ "Agreement" => Some(LintKind::Agreement),
+ "BoundaryError" => Some(LintKind::BoundaryError),
+ "Capitalization" => Some(LintKind::Capitalization),
+ "Eggcorn" => Some(LintKind::Eggcorn),
+ "Enhancement" => Some(LintKind::Enhancement),
+ "Formatting" => Some(LintKind::Formatting),
+ "Grammar" => Some(LintKind::Grammar),
+ "Malapropism" => Some(LintKind::Malapropism),
+ "Miscellaneous" => Some(LintKind::Miscellaneous),
+ "Nonstandard" => Some(LintKind::Nonstandard),
+ "Punctuation" => Some(LintKind::Punctuation),
+ "Readability" => Some(LintKind::Readability),
+ "Redundancy" => Some(LintKind::Redundancy),
+ "Regionalism" => Some(LintKind::Regionalism),
+ "Repetition" => Some(LintKind::Repetition),
+ "Spelling" => Some(LintKind::Spelling),
+ "Style" => Some(LintKind::Style),
+ "Typo" => Some(LintKind::Typo),
+ "Usage" => Some(LintKind::Usage),
+ "WordChoice" => Some(LintKind::WordChoice),
+ _ => None,
+ }
+ }
+
/// Produce a string representation, which can be used as keys in a map or CSS variables.
pub fn to_string_key(&self) -> String {
match self {
diff --git a/harper-core/src/linting/map_phrase_linter.rs b/harper-core/src/linting/map_phrase_linter.rs
index fc7ab4e45..ea1b72f48 100644
--- a/harper-core/src/linting/map_phrase_linter.rs
+++ b/harper-core/src/linting/map_phrase_linter.rs
@@ -5,6 +5,7 @@ use crate::expr::LongestMatchOf;
use crate::expr::SimilarToPhrase;
use crate::linting::Suggestion;
use crate::linting::expr_linter::Chunk;
+use crate::weir::weir_expr_to_expr;
use crate::{Token, TokenStringExt};
pub struct MapPhraseLinter {
@@ -53,7 +54,7 @@ impl MapPhraseLinter {
phrase
.into_iter()
.map(|p| {
- let expr: Box<dyn Expr> = Box::new(FixedPhrase::from_phrase(p.as_ref()));
+ let expr: Box<dyn Expr> = Box::new(weir_expr_to_expr(p.as_ref()).unwrap());
expr
})
.collect(),
diff --git a/harper-core/src/linting/mod.rs b/harper-core/src/linting/mod.rs
index e633bde02..2398ca2bb 100644
--- a/harper-core/src/linting/mod.rs
+++ b/harper-core/src/linting/mod.rs
@@ -146,7 +146,6 @@ mod out_of_date;
mod oxford_comma;
mod oxymorons;
mod phrasal_verb_as_compound_noun;
-mod phrase_corrections;
mod phrase_set_corrections;
mod pique_interest;
mod plural_wrong_word_of_phrase;
@@ -209,13 +208,13 @@ mod touristic;
mod transposed_space;
mod unclosed_quotes;
mod update_place_names;
-mod use_genitive;
mod use_title_case;
mod verb_to_adjective;
mod very_unique;
mod vice_versa;
mod was_aloud;
mod way_too_adjective;
+mod weir_rules;
mod well_educated;
mod whereas;
mod widely_accepted;
@@ -224,7 +223,7 @@ mod wish_could;
mod wordpress_dotcom;
mod would_never_have;
-pub use expr_linter::ExprLinter;
+pub use expr_linter::{Chunk, ExprLinter};
pub use initialism_linter::InitialismLinter;
pub use lint::Lint;
pub use lint_group::{LintGroup, LintGroupConfig};
diff --git a/harper-core/src/linting/phrase_corrections/mod.rs b/harper-core/src/linting/phrase_corrections/mod.rs
deleted file mode 100644
index 63e21224b..000000000
--- a/harper-core/src/linting/phrase_corrections/mod.rs
+++ /dev/null
@@ -1,1287 +0,0 @@
-use crate::linting::LintKind;
-
-use super::{LintGroup, MapPhraseLinter};
-
-#[cfg(test)]
-mod tests;
-
-/// Produce a [`LintGroup`] that looks for errors in common phrases.
-/// Comes pre-configured with the recommended default settings.
-pub fn lint_group() -> LintGroup {
- let mut group = LintGroup::default();
-
- macro_rules! add_exact_mappings {
- ($group:expr, {
- $($name:expr => ($input:expr, $corrections:expr, $hint:expr, $description:expr $(, $lint_kind:expr)?)),+ $(,)?
- }) => {
- $(
- $group.add_chunk_expr_linter(
- $name,
- Box::new(
- MapPhraseLinter::new_fixed_phrases(
- $input,
- $corrections,
- $hint,
- $description,
- None$(.or(Some($lint_kind)))?,
- ),
- ),
- );
- )+
- };
- }
-
- add_exact_mappings!(group, {
- // The name of the rule
- "ACoupleMore" => (
- // The phrase(s) to look for.
- ["a couple of more"],
- // The corrections to provide.
- ["a couple more"],
- // The message to be shown with the error.
- "The correct wording is `a couple more`, without the `of`.",
- // A description of the rule.
- "Corrects `a couple of more` to `a couple more`.",
- LintKind::Redundancy
- ),
- "AdNauseam" => (
- ["as nauseam"],
- ["ad nauseam"],
- "This phrase comes from Latin, where `ad` means `to`.",
- "Corrects `as nauseam` to `ad nauseam`.",
- LintKind::Spelling
- ),
- "AfterAWhile" => (
- ["after while"],
- ["after a while"],
- "When describing a timeframe, use `a while`.",
- "Corrects the missing article in `after while`, forming `after a while`.",
- LintKind::Grammar
- ),
- "AheadAnd" => (
- ["ahead an"],
- ["ahead and"],
- "Did you make a typo? Shouldn't it be `and`?",
- "Corrects `an` to `and` after `ahead`."
- ),
- "AllOfASudden" => (
- ["all of the sudden", "all of sudden", "all the sudden"],
- ["all of a sudden"],
- "Prefer the standard phrasing `all of a sudden`.",
- "Guides this expression toward the standard `all of a sudden`.",
- LintKind::Nonstandard
- ),
- "ALongTime" => (
- ["along time"],
- ["a long time"],
- "Use `a long time` for referring to a duration of time.",
- "Corrects `along time` to `a long time`.",
- LintKind::Grammar
- ),
- "Alongside" => (
- ["along side"],
- ["alongside"],
- "Use the single word `alongside`.",
- "Replaces the spaced form `along side` with `alongside`.",
- LintKind::WordChoice
- ),
- "AlzheimersDisease" => (
- ["old-timers' disease"],
- ["Alzheimer’s disease"],
- "Use the correct medical term.",
- "Fixes the common misnomer `old-timers' disease`, ensuring the correct medical term `Alzheimer’s disease` is used.",
- LintKind::Eggcorn
- ),
- "AnAnother" => (
- ["an another", "a another"],
- ["another"],
- "Use `another` on its own.",
- "Corrects `an another` and `a another`.",
- LintKind::Redundancy
- ),
- "AnotherAn" => (
- ["another an"],
- ["another"],
- "Use `another` on its own.",
- "Corrects `another an` to `another`.",
- LintKind::Redundancy
- ),
- "AnotherOnes" => (
- ["another ones"],
- ["another one", "another one's", "other ones"],
- "`another` is singular but `ones` is plural. Or maybe you meant the possessive `one's`.",
- "Corrects `another ones`.",
- LintKind::Agreement
- ),
- "AnotherThings" => (
- ["another things"],
- ["another thing", "other things"],
- "`another` is singular but `things` is plural.",
- "Corrects `another things`.",
- LintKind::Agreement
- ),
- "AsFarBackAs" => (
- ["as early back as"],
- ["as far back as"],
- "Use `as far back as` for referring to a time in the past.",
- "Corrects nonstandard `as early back as` to `as far back as`.",
- LintKind::WordChoice
- ),
- "AsIfThough" => (
- ["as if though"],
- ["as if", "as though"],
- "This should be `as if` or `as though`.",
- "Corrects redundant `as if though`.",
- LintKind::Redundancy
- ),
- "AsItHappens" => (
- ["as it so happens"],
- ["as it happens"],
- "Did you mean `as it happens`?",
- "Corrects `as it so happens` to `as it happens`.",
- LintKind::Usage
- ),
- "AsLongAs" => (
- ["aslong as"],
- ["as long as"],
- "`As long` should be written as two words.",
- "Corrects `aslong as` to `as long as`.",
- LintKind::BoundaryError
- ),
- "AsOfLate" => (
- ["as of lately"],
- ["as of late"],
- "The standard form is `as of late`.",
- "Corrects `as of lately` to `as of late`.",
- LintKind::WordChoice
- ),
- "AsOpposedTo" => (
- ["as oppose to"],
- ["as opposed to"],
- "Did you mean `as opposed to`?",
- "Corrects `as oppose to` to `as opposed to`.",
- LintKind::Usage
- ),
- "AtFaceValue" => (
- ["on face value"],
- ["at face value"],
- "`at face value is more idiomatic and more common.",
- "Corrects `on face value` to the more usual `at face value`.",
- LintKind::WordChoice
- ),
- "AtTheEndOfTheDay" => (
- ["in the end of the day"],
- ["at the end of the day"],
- "Did you mean `at the end of the day`?",
- "Corrects `in the end of the day` to `at the end of the day`.",
- LintKind::WordChoice
- ),
- "AvoidAndAlso" => (
- ["and also"],
- ["and"],
- "Consider using just `and`.",
- "Reduces redundancy by replacing `and also` with `and`.",
- LintKind::Redundancy
- ),
- "BadRap" => (
- ["bed rap", "bad rep"],
- ["bad rap"],
- "Did you mean `bad rap`?",
- "Changes `bed rap` to the proper idiom `bad rap`.",
- LintKind::Eggcorn
- ),
- "BanTogether" => (
- ["ban together"],
- ["band together"],
- "Did you mean `band together`?",
- "Detects and corrects the common error of using `ban together` instead of the idiom `band together`, which means to unite or join forces.",
- LintKind::Eggcorn
- ),
- "BareInMind" => (
- ["bare in mind"],
- ["bear in mind"],
- "Did you mean `bear in mind`?",
- "Ensures the phrase `bear in mind` is used correctly instead of `bare in mind`.",
- LintKind::Eggcorn
- ),
- "BatedBreath" => (
- ["baited breath"],
- ["bated breath"],
- "Did you mean `bated breath`?",
- "Changes `baited breath` to the correct `bated breath`.",
- LintKind::Eggcorn
- ),
- "BeckAndCall" => (
- ["back and call"],
- ["beck and call"],
- "Did you mean `beck and call`?",
- "Fixes `back and call` to `beck and call`.",
- LintKind::Eggcorn
- ),
- "BeenThere" => (
- ["bee there"],
- ["been there"],
- "Did you mean `been there`?",
- "Corrects the misspelling `bee there` to the proper phrase `been there`.",
- LintKind::Typo
- ),
- "Beforehand" => (
- ["before hand", "before-hand"],
- ["beforehand"],
- "Prefer the single-word adverb `beforehand`.",
- "`Beforehand` functions as a fixed adverb meaning ‘in advance’; writing it as two words or with a hyphen is nonstandard and can jar readers."
- ),
- "BesideThePoint" => (
- ["besides the point"],
- ["beside the point"],
- "Use `beside` in the idiom `beside the point`.",
- "Corrects `besides the point` to `beside the point`.",
- LintKind::Eggcorn
- ),
- "BestRegards" => (
- ["beat regards"],
- ["best regards"],
- "Use `best regards` to convey sincere well wishes in a closing.",
- "In valedictions, `best` expresses your highest regard—avoid the typo `beat regards`.",
- LintKind::Typo
- ),
- "BlanketStatement" => (
- ["blanketed statement"],
- ["blanket statement"],
- "Use the more idiomatic phrasing.",
- "Corrects common errors in the phrase `blanket statement`.",
- LintKind::Usage
- ),
- "Brutality" => (
- ["brutalness"],
- ["brutality"],
- "This word has a more standard, more common synonym.",
- "Suggests the more standard and common synonym `brutality`.",
- LintKind::WordChoice
- ),
- "BuiltIn" => (
- ["in built", "in-built", "built in"],
- ["built-in"],
- "Prefer the hyphenated compound `built-in`.",
- "English convention treats `built-in` as a single, attributive adjective—meaning something integrated from the outset—whereas other forms like `in built` are nonstandard and can feel awkward to readers."
- ),
- "ByAccident" => (
- ["on accident"],
- ["by accident"],
- "Did you mean `by accident`?",
- "Incorrect preposition: `by accident` is the idiomatic expression.",
- LintKind::Usage
- ),
- "CanBeSeen" => (
- ["can be seem"],
- ["can be seen"],
- "Did you mean `can be seen`?",
- "Corrects `can be seem` to the proper phrase `can be seen`.",
- LintKind::Typo
- ),
- "CaseInPoint" => (
- ["case and point"],
- ["case in point"],
- "`Case in point` is the correct form of the phrase.",
- "Corrects `case and point` to `case in point`.",
- LintKind::Malapropism
- ),
- "CaseSensitive" => (
- ["case sensitive"],
- ["case-sensitive"],
- "Use the hyphenated form for `case-sensitive`.",
- "Ensures `case-sensitive` is correctly hyphenated.",
- LintKind::Punctuation
- ),
- "CondenseAllThe" => (
- ["all of the"],
- ["all the"],
- "Consider simplifying to `all the`.",
- "Suggests removing `of` in `all of the` for a more concise phrase.",
- LintKind::Redundancy
- ),
- "CoursingThroughVeins" => (
- ["cursing through veins"],
- ["coursing through veins"],
- "In this idiom, blood “courses” (flows) through veins, not “curses”.",
- "In English idioms, “to course” means to flow rapidly—so avoid the eggcorn `cursing through veins.`",
- LintKind::Eggcorn
- ),
- "DampSquib" => (
- ["damp squid"],
- ["damp squib"],
- "Use the correct phrase for a disappointing outcome.",
- "Corrects the eggcorn `damp squid` to `damp squib`, ensuring the intended meaning of a failed or underwhelming outcome.",
- LintKind::Eggcorn
- ),
- "DayAndAge" => (
- ["day in age"],
- ["day and age"],
- "Use `day and age` for referring to the present time.",
- "Corrects the eggcorn `day in age` to `day and age`, which properly means the current era or time period.",
- LintKind::Eggcorn
- ),
- "DegreesKelvin" => (
- ["degrees kelvin", "degrees Kelvin", "degree kelvin", "degree Kelvin"],
- ["kelvins", "kelvin"],
- "Use `kelvins` when discussing the unit Kelvin.",
- "Corrects use of `degrees kelvin` to `kelvins`.",
- LintKind::Usage
- ),
- "DegreesKelvinSymbol" => (
- ["°K"],
- ["K"],
- "Use just the symbol `K` when discussing the unit Kelvin.",
- "Corrects use of `°K` to `K`.",
- LintKind::Usage
- ),
- "DoNotWant" => (
- ["don't wan", "do not wan"],
- ["don't want", "do not want"],
- "Use the full verb “want” after negation: “don't want” or “do not want.”",
- "In English, negation still requires the complete verb form (“want”), so avoid truncating it to “wan.”",
- LintKind::Typo
- ),
- "EggYolk" => (
- ["egg yoke"],
- ["egg yolk"],
- "Use `egg yolk` when you mean the yellow portion of an egg.",
- "Corrects the eggcorn `egg yoke`, replacing it with the standard culinary term `egg yolk`.",
- LintKind::Eggcorn
- ),
- "DontCan" => (
- ["don't can"],
- ["can't", "cannot"],
- "The grammatically correct form is `can't` or `cannot`.",
- "Corrects `don't can` to `can't` or `cannot`.",
- LintKind::Grammar
- ),
- "EachAndEveryOne" => (
- ["each and everyone"],
- ["each and every one"],
- "Use `each and every one` for referring to a group of people or things.",
- "Corrects `each and everyone` to `each and every one`.",
- LintKind::BoundaryError
- ),
- "EludedTo" => (
- ["eluded to"],
- ["alluded to"],
- "Did you mean `alluded to`?",
- "Corrects `eluded to` to `alluded to` in contexts referring to indirect references.",
- LintKind::Malapropism
- ),
- "EnMasse" => (
- ["on mass", "on masse", "in mass"],
- ["en masse"],
- "Did you mean `en masse`?",
- "Detects variants like `on mass` or `in mass` and suggests `en masse`.",
- LintKind::Eggcorn
- ),
- "EnRoute" => (
- ["on route to", "in route to", "on-route to", "in-route to"],
- ["en route to", "en-route to"],
- "Did you mean `en route`?",
- "Detects variants like `on route` or `in route` and suggests `en route`.",
- LintKind::Eggcorn
- ),
- "EverPresent" => (
- ["ever present"],
- ["ever-present"],
- "Hyphenate `ever-present` when it functions as a compound adjective.",
- "Corrects the missing hyphen in `ever present` to the compound adjective `ever-present`.",
- LintKind::Punctuation
- ),
- "EverSince" => (
- ["every since"],
- ["ever since"],
- "Did you mean `ever since`?",
- "Corrects `every since` to `ever since`.",
- LintKind::Typo
- ),
- "EveryOnceAndAgain" => (
- ["every once and again"],
- ["every once in a while", "once again"],
- "For things that happen only occasionaly use `every once in a while. For things that persistently happen use `once again`.",
- "Corrects `every once and again` to `every once in a while` or `once again`.",
- LintKind::Usage
- ),
- "EveryTime" => (
- ["everytime"],
- ["every time"],
- "`Everytime` as a single word is proscribed. Use `every time` instead.",
- "Corrects `everytime` to `every time`.",
- LintKind::Usage
- ),
- "Excellent" => (
- ["very good"],
- ["excellent"],
- "Vocabulary enhancement: use `excellent` instead of `very good`",
- "Provides a stronger word choice by replacing `very good` with `excellent` for clarity and emphasis.",
- LintKind::Enhancement
- ),
- "ExpandBecause" => (
- ["cuz"],
- ["because"],
- "Use `because` instead of informal `cuz`",
- "Expands the informal abbreviation `cuz` to the full word `because` for formality.",
- LintKind::Style
- ),
- "ExpandForward" => (
- ["fwd"],
- ["forward"],
- "Use `forward` instead of `fwd`",
- "Expands the abbreviation `fwd` to the full word `forward` for clarity.",
- LintKind::Style
- ),
- "ExpandMinimum" => (
- ["min"],
- ["minimum"],
- "Use `minimum` instead of `min`",
- "Expands the abbreviation `min` to the full word `minimum` for clarity.",
- LintKind::Style
- ),
- "ExpandWith" => (
- ["w/"],
- ["with"],
- "Use `with` instead of `w/`",
- "Expands the abbreviation `w/` to the full word `with` for clarity.",
- LintKind::Style
- ),
- "ExpandWithout" => (
- ["w/o"],
- ["without"],
- "Use `without` instead of `w/o`",
- "Expands the abbreviation `w/o` to the full word `without` for clarity.",
- LintKind::Style
- ),
- "FaceFirst" => (
- ["face first into"],
- ["face-first into"],
- "Should this be `face-first`?",
- "Ensures `face first` is correctly hyphenated as `face-first` when used before `into`.",
- LintKind::Punctuation
- ),
- "FairBit" => (
- ["fare bit"],
- ["fair bit"],
- "A `decent amount` is a `fair bit`. `Fare` is the price of a ticket.",
- "Corrects malapropisms of `a fair bit`.",
- LintKind::Eggcorn
- ),
- "FarAndFewBetween" => (
- ["far and few between"],
- ["few and far between"],
- "The correct idiom is `few and far between`?",
- "Corrects `far and few between` to the standard idiom `few and far between`.",
- LintKind::Eggcorn
- ),
- "FastPaste" => (
- ["fast paste", "fast-paste"],
- ["fast-paced"],
- "Did you mean `fast-paced`?",
- "Detects incorrect usage of `fast paste` or `fast-paste` and suggests `fast-paced` as the correct phrase.",
- LintKind::Eggcorn
- ),
- "FatalOutcome" => (
- ["fatal outcome"],
- ["death"],
- "Consider using `death` for clarity.",
- "Replaces `fatal outcome` with the more direct term `death` for conciseness.",
- LintKind::Style
- ),
- "FetalPosition" => (
- ["the feeble position"],
- ["the fetal position"],
- "Use the correct term for a curled-up posture.",
- "Ensures the correct use of `fetal position`, avoiding confusion with `feeble position`, which is not a standard phrase.",
- LintKind::Malapropism
- ),
- "ForALongTime" => (
- ["for along time"],
- ["for a long time"],
- "Use the standard phrase `for a long time` to indicate an extended duration.",
- "Eliminates the incorrect merging in `for along time`.",
- LintKind::Grammar
- ),
- "ForAWhile" => (
- ["for while"],
- ["for a while"],
- "When describing a timeframe, use `a while`.",
- "Corrects the missing article in `for while`, forming `for a while`.",
- LintKind::Typo
- ),
- "FreeRein" => (
- ["free reign"],
- ["free rein"],
- "Use the correct phrase for unrestricted control.",
- "Ensures the correct use of `free rein`, avoiding confusion with `free reign`, which incorrectly suggests authority rather than freedom of action.",
- LintKind::Eggcorn
- ),
- "Freezing" => (
- ["very cold", "really cold", "extremely cold"],
- ["freezing"],
- "A more vivid adjective would better capture extreme cold.",
- "Encourages vivid writing by suggesting `freezing` instead of weaker expressions like `very cold.`",
- LintKind::Enhancement
- ),
- "FromTheGetGo" => (
- ["from the get go"],
- ["from the get-go"],
- "Use the hyphenated form: `from the get-go`.",
- "Ensures `from the get-go` is correctly hyphenated, preserving the idiom’s meaning of ‘from the very beginning’.",
- LintKind::Punctuation
- ),
- "GildedAge" => (
- ["guilded age"],
- ["Gilded Age"],
- "The period of economic prosperity is called the `Gilded Age`.",
- "If referring to the period of economic prosperity, the correct term is `Gilded Age`.",
- LintKind::Eggcorn
- ),
- "GoingTo" => (
- ["gong to"],
- ["going to"],
- "Did you mean `going to`?",
- "Corrects `gong to` to the intended phrase `going to`.",
- LintKind::Typo
- ),
- "GuineaBissau" => (
- // Note: this lint matches any case but cannot correct wrong case
- // Note: It can only correct the hyphenation
- // Note: See linting/matcher.rs for case corrections
- // Note: $input must already be the correct case
- // Note: do not add other case variants here
- ["Guinea Bissau"],
- ["Guinea-Bissau"],
- "The official spelling is hyphenated.",
- "Checks for the correct official name of the African country.",
- LintKind::Punctuation
- ),
- "HadOf" => (
- ["had of"],
- ["had have", "had've"],
- "Did you mean `had have` or `had've`?",
- "Flags the unnecessary use of `of` after `had` and suggests the correct forms.",
- LintKind::Grammar
- ),
- "HalfAnHour" => (
- ["half an our"],
- ["half an hour"],
- "Remember the silent 'h' when writing `hour`: `half an hour`.",
- "Fixes the eggcorn `half an our` to the accepted `half an hour`.",
- LintKind::Typo
- ),
- "Haphazard" => (
- ["half hazard", "half-hazard", "halfhazard"],
- ["haphazard"],
- "Use `haphazard` for randomness or lack of organization.",
- "Corrects the eggcorn `half hazard` to `haphazard`, which properly means lacking organization or being random.",
- LintKind::Eggcorn
- ),
- "HumanBeings" => (
- ["human's beings", "humans beings"],
- ["human beings"],
- "Use `human beings` to refer to people collectively.",
- "Eliminates the incorrect possessive/plural usage like `human's beings` or `humans beings`.",
- LintKind::Grammar
- ),
- "HumanLife" => (
- ["human live"],
- ["human life"],
- "Did you mean `human life`?",
- "Changes `human live` to `human life`.",
- LintKind::Typo
- ),
- "HungerPang" => (
- ["hunger pain"],
- ["hunger pang"],
- "Did you mean `hunger pang`?",
- "Corrects `hunger pain` to `hunger pang`.",
- LintKind::Eggcorn
- ),
- "IAm" => (
- ["I a m"],
- ["I am"],
- "Did you mean `I am`?",
- "Fixes the incorrect spacing in `I a m` to properly form `I am`.",
- LintKind::Typo
- ),
- "IDo" => (
- ["I does"],
- ["I do"],
- "`I` pairs with the bare verb `do`; the –s inflection `does` is reserved for third-person singular subjects.",
- "Corrects `I does` to `I do`.",
- LintKind::Agreement
- ),
- "Initiatively" => (
- ["initiatively"],
- ["proactively", "initially"],
- "Did you mean `proactive` (taking initiative, acting in advance) or `initially` (at first, in the beginning)?",
- "Corrects nonstandard `initiatively`.",
- LintKind::Nonstandard
- ),
- "InLieuOf" => (
- ["in lue of"],
- ["in lieu of"],
- "Did you mean `in lieu of`?",
- "Corrects the misspelling `in lue of` to `in lieu of`.",
- LintKind::Spelling
- ),
- "InOfItself" => (
- ["in of itself"],
- ["in itself", "in and of itself"],
- "Use `in itself` (more common) or `in and of itself` (more formal) to mean 'intrinsically'.",
- "Corrects nonstandard `in of itself` to standard `in itself` or `in and of itself`.",
- LintKind::Usage
- ),
- "InAnyWay" => (
- ["in anyway"],
- ["in any way"],
- "Use `in any way` for emphasizing a point.",
- "Corrects ungrammatical `in anyway` to `in any way`.",
- LintKind::BoundaryError
- ),
- "InAWhile" => (
- ["in while"],
- ["in a while"],
- "When describing a timeframe, use `a while`.",
- "Corrects the missing article in `in while`, forming `in a while`.",
- LintKind::Grammar
- ),
- "InNeedOf" => (
- ["in need for"],
- ["in need of"],
- "Use `in need of` for when something is required or necessary.",
- "Corrects `in need for` to `in need of`.",
- LintKind::Usage
- ),
- "InOneFellSwoop" => (
- ["in one foul swoop"],
- ["in one fell swoop"],
- "Use the correct phrase for something happening suddenly.",
- "Corrects `in one foul swoop` to `in one fell swoop`, preserving the phrase’s original meaning of sudden and complete action.",
- LintKind::Eggcorn
- ),
- "InsteadOf" => (
- ["in stead of"],
- ["instead of"],
- "Use the modern single word `instead of` to indicate a replacement.",
- "Corrects the archaic or mistaken separation `in stead of` to `instead of` in everyday usage.",
- LintKind::BoundaryError
- ),
- "Insensitive" => (
- ["unsensitive"],
- ["insensitive"],
- "This word has a more standard, more common synonym.",
- "Suggests the more standard and common synonym `insensitive`.",
- LintKind::WordChoice
- ),
- "Insurmountable" => (
- ["unsurmountable"],
- ["insurmountable"],
- "This word has a more standard, more common synonym.",
- "Suggests the more standard and common synonym `insurmountable`.",
- LintKind::WordChoice
- ),
- "Intact" => (
- ["in tact"],
- ["intact"],
- "Use `intact` to mean undamaged or whole.",
- "Prevents the erroneous spacing in `in tact`; `intact` is the single correct word.",
- LintKind::BoundaryError
- ),
- "InThe" => (
- ["int he"],
- ["in the"],
- "Did you mean `in the`?",
- "Detects and corrects a spacing error where `in the` is mistakenly written as `int he`. Proper spacing is essential for readability and grammatical correctness in common phrases.",
- LintKind::Typo
- ),
- "IsKnownFor" => (
- ["is know for"],
- ["is known for"],
- "Did you mean `is known for`?",
- "Typo: `known` is the correct past participle.",
- LintKind::Typo
- ),
- "ItCan" => (
- ["It cam"],
- ["It can"],
- "Did you mean `It can`?",
- "Corrects the misspelling `It cam` to the proper phrase `It can`.",
- LintKind::Typo
- ),
- "IveGotTo" => (
- ["I've go to"],
- ["I've got to"],
- "Use `I've got to` for necessity or obligation.",
- "Corrects the slip `I've go to` to the idiomatic `I've got to`.",
- LintKind::Typo
- ),
- "JawDropping" => (
- ["jar-dropping"],
- ["jaw-dropping"],
- "Use the correct phrase for something astonishing.",
- "Corrects `jar-dropping` to `jaw-dropping`, ensuring the intended meaning of something that causes amazement.",
- LintKind::Eggcorn
- ),
- "JustDeserts" => (
- ["just desserts"],
- ["just deserts"],
- "Use the correct phrase for receiving what one deserves.",
- "Ensures `just deserts` is used correctly, preserving its meaning of receiving an appropriate outcome for one's actions.",
- LintKind::Spelling
- ),
- "KindOf" => (
- ["kinda of"],
- ["kind of", "kinda"],
- "`Kinda` already means `kind of`, so `kinda of` is redundant.",
- "Corrects `kinda of` to `kind of`.",
- LintKind::Redundancy
- ),
- "KindRegards" => (
- ["kid regards"],
- ["kind regards"],
- "Did you mean `kind regards`?",
- "Changes `kid regards` to `kind regards`.",
- LintKind::Typo
- ),
- "LastButNotLeast" => (
- ["last but not the least", "last, but not the least", "last but, not least", "last but not last"],
- ["last but not least"],
- "Use the more idiomatic phrasing.",
- "Corrects common errors in the phrase `last but not least`.",
- LintKind::Usage
- ),
- "LastDitch" => (
- ["last ditch", "last ditched", "last-ditched"],
- ["last-ditch"],
- "In this idiom, `ditch` is a noun and a hyphen is needed.",
- "Corrects wrong variations of the idiomatic adjective `last-ditch`.",
- LintKind::Usage
- ),
- "LastNight" => (
- ["yesterday night"],
- ["last night"],
- "The idiomatic phrase is `last night`.",
- "Flags `yesterday night` and suggests the standard phrasing `last night`.",
- LintKind::WordChoice
- ),
- "LetAlone" => (
- ["let along"],
- ["let alone"],
- "Did you mean `let alone`?",
- "Changes `let along` to `let alone`.",
- LintKind::Typo
- ),
- "LikeAsIf" => (
- ["like as if"],
- ["like", "as if"],
- "Avoid redundancy. Use either `like` or `as if`.",
- "Corrects redundant `like as if` to `like` or `as if`."
- ),
- "LikeThePlague" => (
- ["like a plague"],
- ["like the plague"],
- "`Things are avoided `like the plague` not `like a plague`.",
- "Corrects `like a plague` to `like the plague`.",
- LintKind::Usage
- ),
- "LinesOfCode" => (
- ["line of codes", "lines of codes"],
- ["lines of code"],
- "The correct plural is `lines of code`.",
- "Corrects pluralizing the wrong noun in `lines of code`.",
- LintKind::Usage
- ),
- "LowHangingFruit" => (
- ["low hanging fruit", "low hanging fruits", "low-hanging fruits"],
- ["low-hanging fruit"],
- "The standard form is `low-hanging fruit` with a hyphen and singular form.",
- "Corrects nonstandard variants of `low-hanging fruit`.",
- LintKind::Usage
- ),
- "ManagerialReins" => (
- ["managerial reigns"],
- ["managerial reins"],
- "Swap in `reins` when talking about control of a team or project.",
- "Corrects the eggcorn `managerial reigns` to the idiomatic `managerial reins`.",
- LintKind::Eggcorn
- ),
- "Monumentous" => (
- ["monumentous"],
- ["momentous", "monumental"],
- "Retain `monumentous` for jocular effect. Otherwise `momentous` indicates great signifcance while `monumental` indicates imposing size.",
- "Advises using `momentous` or `monumental` instead of `monumentous` for serious usage.",
- LintKind::Nonstandard
- ),
- "MyHouse" => (
- ["mu house"],
- ["my house"],
- "Did you mean `my house`?",
- "Fixes the typo `mu house` to `my house`.",
- LintKind::Typo
- ),
- "NeedHelp" => (
- ["ned help"],
- ["need help"],
- "Did you mean `need help`?",
- "Changes `ned help` to the correct `need help`.",
- LintKind::Typo
- ),
- "NerveRacking" => (
- ["nerve racking", "nerve wracking", "nerve wrecking", "nerve-wracking", "nerve-wrecking"],
- ["nerve-racking"],
- "Use `nerve-racking` for something that causes anxiety or tension.",
- "Corrects common misspellings and missing hyphen in `nerve-racking`.",
- LintKind::Eggcorn
- ),
- "NotIn" => (
- ["no in"],
- ["not in"],
- "Use `not in` for correct grammar.",
- "Replaces `no in` with `not in`.",
- LintKind::Typo
- ),
- "NotTo" => (
- ["no to"],
- ["not to"],
- "Did you mean `not to`?",
- "Corrects `no to` to `not to`, ensuring proper negation.",
- LintKind::Typo
- ),
- "OfCourse" => (
- // See also: `of_course.rs` for "of curse/corse" → "of course" corrections
- ["off course", "o course", "ofcourse"],
- ["of course"],
- "Did you mean `of course`?",
- "Detects the common mistake `off course` and suggests the correct form `of course`.",
- LintKind::Eggcorn
- ),
- "OffTheCuff" => (
- ["off the cuff"],
- ["off-the-cuff"],
- "Use the hyphenated form for `off-the-cuff`.",
- "Ensures `off-the-cuff` is correctly hyphenated.",
- LintKind::Punctuation
- ),
- "OldWivesTale" => (
- ["old wise tale"],
- ["old wives' tale"],
- "Use the correct phrase for a superstition or myth.",
- "Corrects `old wise tale` to `old wives' tale`, preserving the phrase’s meaning as an unfounded traditional belief.",
- LintKind::Eggcorn
- ),
- "OnceInAWhile" => (
- ["once a while", "once and a while"],
- ["once in a while"],
- "The correct idiom is `once in a while`.",
- "Corrects two common malapropisms of `once in a while`.",
- LintKind::Usage
- ),
- "OnSecondThought" => (
- ["on second though"],
- ["on second thought"],
- "Idiomatic expression: use `on second thought` instead of `on second though`",
- "Replaces the nonstandard `on second though` with the common idiom `on second thought` to indicate reconsideration.",
- LintKind::Typo
- ),
- "OnTheSpurOfTheMoment" => (
- ["on the spurt of the moment", "at the spur of the moment", "in the spur of the moment"],
- ["on the spur of the moment"],
- "Use the correct phrase for acting spontaneously.",
- "Ensures the correct use of `on the spur of the moment`, avoiding nonstandard variations.",
- // "spurt" is Eggcorn, the others are probably Usage
- LintKind::Eggcorn
- ),
- "OnTopOf" => (
- ["ontop of"],
- ["on top of"],
- "Did you mean `on top of`?",
- "Corrects `ontop of` to `on top of`.",
- LintKind::BoundaryError
- ),
- "PartsOfSpeech" => (
- ["part of speeches", "parts of speeches"],
- ["parts of speech"],
- "The correct plural is `parts of speech`.",
- "Corrects pluralizing the wrong noun in `part of speech`.",
- LintKind::Grammar
- ),
- "PeaceOfMind" => (
- ["piece of mind"],
- ["peace of mind"],
- "The phrase is `peace of mind`, meaning `calm`. A `piece` is a `part` of something.",
- "Corrects `piece of mind` to `peace of mind`.",
- LintKind::Eggcorn
- ),
- "PerSe" => (
- ["per say", "per-se", "per-say"],
- ["per se"],
- "The correct spelling is `per se` (with no hyphen)",
- "Corrects common misspellings of `per se`.",
- LintKind::Spelling
- ),
- "PointsOfView" => (
- ["point of views", "points of views"],
- ["points of view"],
- "The correct plural is `points of view`.",
- "Corrects pluralizing the wrong noun in `point of view`.",
- LintKind::Grammar
- ),
- "PortAuPrince" => (
- // Note: this lint matches any case but cannot correct wrong case
- // Note: It can only correct the hyphenation
- // Note: See linting/matcher.rs for case corrections
- // Note: $input must already be the correct case
- // Note: do not add other case variants here
- ["Port au Prince"],
- ["Port-au-Prince"],
- "The official spelling is hyphenated.",
- "Checks for the correct official name of the capital of Haiti.",
- LintKind::Punctuation
- ),
- "PortoNovo" => (
- // Note: this lint matches any case but cannot correct wrong case
- // Note: It can only correct the hyphenation
- // Note: See linting/matcher.rs for case corrections
- // Note: $input must already be the correct case
- // Note: do not add other case variants here
- ["Porto Novo"],
- ["Porto-Novo"],
- "The official spelling is hyphenated.",
- "Checks for the correct official name of the capital of Benin.",
- LintKind::Punctuation
- ),
- "PrayingMantis" => (
- ["preying mantis"],
- ["praying mantis"],
- "Use the insect's correct name.",
- "Corrects `preying mantis` to `praying mantis`, ensuring accurate reference to the insect’s characteristic pose.",
- LintKind::Eggcorn
- ),
- "QuiteMany" => (
- ["quite many"],
- ["quite a few"],
- "Use `quite a few` instead of `quite many`.",
- "Corrects `quite many` to `quite a few`, which is the more natural and idiomatic phrase in standard English. `Quite many` is considered nonstandard usage.",
- LintKind::Nonstandard
- ),
- "RapidFire" => (
- ["rapid fire"],
- ["rapid-fire"],
- "It is more idiomatic to hypenate `rapid-fire`.",
- "Checks to ensure writers hyphenate `rapid-fire`.",
- LintKind::Punctuation
- ),
- "RealTrouper" => (
- ["real trooper"],
- ["real trouper"],
- "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.",
- LintKind::Eggcorn
- ),
- "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'.",
- LintKind::Redundancy
- ),
- "RifeWith" => (
- ["ripe with"],
- ["rife with"],
- "Use the correct phrase for something abundant.",
- "Corrects `ripe with` to `rife with`, preserving the phrase’s meaning of being filled with something, often undesirable.",
- LintKind::Eggcorn
- ),
- "RoadMap" => (
- ["roadmap"],
- ["road map"],
- "Did you mean `road map`?",
- "Detects when `roadmap` is used instead of `road map`, prompting the correct spacing.",
- LintKind::WordChoice
- ),
- "RulesOfThumb" => (
- ["rule of thumbs", "rule-of-thumbs", "rules of thumbs"],
- ["rules of thumb"],
- "The correct plural is `rules of thumb`.",
- "Corrects pluralizing the wrong noun in `rule of thumb`.",
- LintKind::Grammar
- ),
- "SameAs" => (
- ["same then"],
- ["same as"],
- "Did you mean `same as`?",
- "Corrects the incorrect phrase `same then` to the standard `same as`.",
- LintKind::Grammar
- ),
- "ScantilyClad" => (
- ["scandally clad"],
- ["scantily clad"],
- "Use the correct phrase for minimal attire.",
- "Fixes `scandally clad` to `scantily clad`, ensuring clarity in describing minimal attire.",
- LintKind::Eggcorn
- ),
- "SimpleGrammatical" => (
- ["simply grammatical"],
- ["simple grammatical"],
- "Use `simple grammatical` for correct adjective usage.",
- "Corrects `simply grammatical` to `simple grammatical` for proper adjective usage.",
- LintKind::Usage
- ),
- "SneakingSuspicion" => (
- ["sneaky suspicion"],
- ["sneaking suspicion"],
- "Did you mean `sneaking suspicion`?",
- "Changes `sneaky suspicion` to `sneaking suspicion`.",
- LintKind::Eggcorn
- ),
- "SomebodyElses" => (
- ["somebody's else", "somebody's else's"],
- ["somebody else's"],
- "This should be `somebody else's`?",
- "Corrects `somebody else's` when the `'s` is in the wrong place.",
- LintKind::Grammar
- ),
- "SomeOfThe" => (
- ["some the"],
- ["some of the"],
- "Add `of` to form the partitive phrase: `some of the`.",
- "Quantity words such as `some` normally take `of` before a definite article. Including `of` signals that you mean a subset of a larger set, preventing a momentary stumble in comprehension.",
- LintKind::Typo
- ),
- "SoonerOrLater" => (
- ["sooner than later"],
- ["sooner rather than later", "sooner or later"],
- "Did you mean `sooner rather than later` or `sooner or later`?",
- "Fixes the improper phrase `sooner than later` by suggesting standard alternatives.",
- LintKind::Usage
- ),
- "SpecialAttention" => (
- ["spacial attention"],
- ["special attention"],
- "Did you mean `special attention`?",
- "Changes `spacial attention` to `special attention`.",
- LintKind::Typo
- ),
- "Starving" => (
- ["very hungry", "really hungry", "extremely hungry"],
- ["starving"],
- "A more vivid adjective would better convey intense hunger.",
- "Encourages vivid writing by suggesting `starving` instead of weaker expressions like `very hungry.`",
- LintKind::Enhancement
- ),
- "StateOfTheArt" => (
- ["state of art"],
- ["state of the art"],
- "Did you mean `state of the art`?",
- "Detects incorrect usage of `state of art` and suggests `state of the art` as the correct phrase.",
- LintKind::Usage
- ),
- "StatuteOfLimitations" => (
- ["statue of limitations"],
- ["statute of limitations"],
- "A `statue` is a sculpture; in legal terms, the correct word is `statute`.",
- "Corrects `statue of limitations` to `statute of limitations`.",
- LintKind::Eggcorn
- ),
- "SufficeItToSay" => (
- ["suffice to say"],
- ["suffice it to say"],
- "`Suffice it to say` is the more standard and more common variant.",
- "Corrects `suffice to say` to `suffice it to say`.",
- LintKind::Usage
- ),
- "SupposedTo" => (
- ["suppose to"],
- ["supposed to"],
- "Did you mean `supposed to`?",
- "Fixes `suppose to` to the correct `supposed to`.",
- LintKind::Usage
- ),
- "TakeItPersonally" => (
- ["take it personal"],
- ["take it personally"],
- "The more standard, less colloquial form is `take it personally`.",
- "Corrects `take it personal` to `take it personally`.",
- LintKind::Usage
- ),
- "ThanksALot" => (
- ["thanks lot"],
- ["thanks a lot"],
- "The indefinite article `a` is required in `thanks a lot`.",
- "Corrects the missing article in `thanks lot`, forming `thanks a lot`.",
- LintKind::Grammar
- ),
- "ThatChallenged" => (
- ["the challenged"],
- ["that challenged"],
- "Use `that challenged` for correct relative clause.",
- "Corrects `the challenged` to `that challenged` for proper relative clause usage."
- ),
- "ThatThis" => (
- ["the this"],
- ["that this"],
- "Did you mean `that this`?",
- "Fixes `the this` to the correct phrase `that this`.",
- LintKind::Typo
- ),
- "TheAnother" => (
- ["the another"],
- ["the other", "another"],
- "Use `the other` or `another`, not both.",
- "Corrects `the another`.",
- LintKind::Grammar
- ),
- "ThoughtProcess" => (
- ["though process"],
- ["thought process"],
- "Did you mean `thought process`?",
- "Changes `though process` to `thought process`.",
- LintKind::Typo
- ),
- "TickingTimeClock" => (
- ["ticking time clock"],
- ["ticking time bomb", "ticking clock"],
- "Use `ticking time bomb` for disastrous consequences, otherwise avoid redundancy with just `ticking clock`.",
- "Corrects `ticking time clock` to `ticking time bomb` for idiomatic urgency or `ticking clock` otherwise.",
- LintKind::Usage
- ),
- "ToDoHyphen" => (
- ["todo"],
- ["to-do"],
- "Hyphenate `to-do`.",
- "Ensures `to-do` is correctly hyphenated."
- ),
- "ToGreatLengths" => (
- ["through great lengths", "to a great length"],
- ["to great lengths"],
- "The idiom is to go `to great lengths`.",
- "Corrects `through great lengths` to `to great lengths`."
- ),
- "ToTheMannerBorn" => (
- ["to the manor born"],
- ["to the manner born"],
- "Use the correct phrase for being naturally suited to something.",
- "Corrects `to the manor born` to `to the manner born`, ensuring the intended meaning of being naturally suited to a way of life.",
- LintKind::Eggcorn
- ),
- "TongueInCheek" => (
- ["tongue and cheek"],
- ["tongue in cheek"],
- "Use `tongue in cheek` for the idiom.",
- "Corrects the idiom when `and` replaces the needed preposition.",
- LintKind::WordChoice
- ),
- "Towards" => (
- ["to towards"],
- ["towards"],
- "Use `towards` without the preceding `to`.",
- "Removes redundant `to` before `towards`.",
- LintKind::Redundancy
- ),
- "TrialAndError" => (
- ["trail and error"],
- ["trial and error"],
- "You misspelled `trial`.",
- "Corrects `trail` to `trial` in `trial and error`.",
- LintKind::Typo
- ),
- "TurnItOff" => (
- ["turn it of", "turn i of"],
- ["turn it off"],
- "Did you mean `turn it off`?",
- "Fixes the mistake in the phrase `turn it off`.",
- LintKind::Typo
- ),
- "Unless" => (
- ["unless if"],
- ["unless", "except if", "except when"],
- "`Unless if` is not idiomatic English. `Unless`, `except if`, and `except when` express a condition that is true in all cases except one.",
- "Corrects `unless if`.",
- LintKind::Usage
- ),
- "WantBe" => (
- ["want be"],
- ["won't be", "want to be"],
- "Did you mean `won't be` or `want to be`?",
- "Detects incorrect usage of `want be` and suggests `won't be` or `want to be` based on context."
- ),
- "WaveFunction" => (
- ["wavefunction"],
- ["wave function"],
- "Did you mean `wave function`?",
- "Identifies the mistake of merging `wave` and `function` into one word. In quantum mechanics, a `wave function` (written as two words) describes the mathematical function that represents the quantum state of a particle or system. Correct usage is crucial for clear and accurate scientific communication.",
- LintKind::WordChoice
- ),
- "WellBeing" => (
- ["wellbeing"],
- ["well-being"],
- "Use the hyphenated form for `well-being`.",
- "Ensures `well-being` is correctly hyphenated.",
- LintKind::Punctuation
- ),
- "WellKept" => (
- ["highly-kept", "highly kept"],
- // There may be other good alternatives such as closely-guarded or tightly-held
- ["well-kept"],
- "`Highly-kept` is not standard. To describe secrets, `well-kept` is the most used phrase.",
- "Flags `highly-kept` and recommends `well-kept` as an alternative.",
- LintKind::Usage
- ),
- "WhetYourAppetite" => (
- ["wet your appetite"],
- ["whet your appetite"],
- "Use the correct phrase for stimulating desire.",
- "Ensures `whet your appetite` is used correctly, distinguishing it from the incorrect `wet` variation.",
- LintKind::Eggcorn
- ),
- "WillContain" => (
- ["will contains"],
- ["will contain"],
- "Did you mean `will contain`?",
- "Incorrect verb form: `will` should be followed by the base form `contain`.",
- LintKind::Agreement
- ),
- // WorseOrWorst corrects wrong words. This corrects hyphenation.
- // The descriptions and messages differ between the two linters.
- "WorstCaseScenario" => (
- ["worst case scenario", "worst-case-scenario"],
- ["worst-case scenario"],
- "Hyphenate `worst-case`.",
- "Corrects `worst-case scenario` when the hyphen is missing or `worse` is used instead of `worst`.",
- LintKind::Punctuation
- ),
- "WroughtIron" => (
- ["rod iron", "rot iron", "rod-iron", "rot-iron"],
- ["wrought iron"],
- "Prefer the standard term `wrought iron`.",
- "`Wrought iron` is low-carbon, malleable iron used for decorative work; variants like `rod iron` or `rot iron` are phonetic misspellings that may confuse readers.",
- LintKind::Eggcorn
- ),
- "ToWorryAbout" => (
- ["to worried about"],
- ["to worry about", "too worried about"],
- "Did you mean the progressive form?",
- "Fixes incorrect use of `to worried about`."
- ),
- "The" => (
- ["teh", "te"],
- ["the"],
- "Did you mean the definite article?",
- "Fixes especially common misspellings of the word `the`",
- LintKind::Typo
- ),
- "RedundantThat" => (
- ["that that"],
- ["that"],
- "Consider whether the second `that` adds meaning in this context.",
- "There is rarely a situation where `that that` cannot be condensed into a single token.",
- LintKind::Repetition
- )
- });
-
- group.set_all_rules_to(Some(true));
-
- group
-}
diff --git a/harper-core/src/linting/phrase_corrections/tests.rs b/harper-core/src/linting/phrase_corrections/tests.rs
deleted file mode 100644
index 105bd5130..000000000
--- a/harper-core/src/linting/phrase_corrections/tests.rs
+++ /dev/null
@@ -1,2063 +0,0 @@
-use crate::linting::tests::{
- assert_lint_count, assert_no_lints, assert_nth_suggestion_result, assert_suggestion_result,
- assert_top3_suggestion_result,
-};
-
-use super::lint_group;
-
-// ACoupleMore
-#[test]
-fn corrects_a_couple_of_more() {
- assert_suggestion_result(
- "There are a couple of more rules that could be added, how can I contribute?",
- lint_group(),
- "There are a couple more rules that could be added, how can I contribute?",
- )
-}
-
-// AdNauseam
-#[test]
-fn corrects_as_nauseam_1() {
- assert_suggestion_result(
- "As you say, discussed as nauseam, but no nearer a solution.",
- lint_group(),
- "As you say, discussed ad nauseam, but no nearer a solution.",
- );
-}
-#[test]
-fn corrects_as_nauseam_2() {
- assert_suggestion_result(
- "no more autism please, hearing about it as nauseam is starting to make me sick",
- lint_group(),
- "no more autism please, hearing about it ad nauseam is starting to make me sick",
- );
-}
-
-// AfterAWhile
-#[test]
-fn correct_after_while() {
- assert_suggestion_result(
- "bromite Crashes on all sites after while.",
- lint_group(),
- "bromite Crashes on all sites after a while.",
- );
-}
-
-// AheadAnd
-#[test]
-fn correct_ahead_and() {
- assert_suggestion_result(
- "If it's important, go ahead an open an issue.",
- lint_group(),
- "If it's important, go ahead and open an issue.",
- );
-}
-
-// AllOfASudden
-#[test]
-fn corrects_all_of_a_sudden() {
- assert_suggestion_result(
- "On an app that has been released since December, all of the sudden around February 5th ANRs started going up.",
- lint_group(),
- "On an app that has been released since December, all of a sudden around February 5th ANRs started going up.",
- )
-}
-
-#[test]
-fn corrects_all_the_sudden_basic() {
- assert_suggestion_result(
- "It happened all the sudden when the lights went out.",
- lint_group(),
- "It happened all of a sudden when the lights went out.",
- );
-}
-
-#[test]
-fn corrects_all_the_sudden_sentence_start() {
- assert_suggestion_result(
- "All the sudden the room fell quiet.",
- lint_group(),
- "All of a sudden the room fell quiet.",
- );
-}
-
-#[test]
-fn corrects_all_the_sudden_with_comma() {
- assert_suggestion_result(
- "The music stopped, all the sudden, during the chorus.",
- lint_group(),
- "The music stopped, all of a sudden, during the chorus.",
- );
-}
-
-#[test]
-fn corrects_all_the_sudden_question() {
- assert_suggestion_result(
- "Did the power cut all the sudden?",
- lint_group(),
- "Did the power cut all of a sudden?",
- );
-}
-
-#[test]
-fn corrects_all_the_sudden_in_quotes() {
- assert_suggestion_result(
- "He whispered, \"all the sudden we were alone.\"",
- lint_group(),
- "He whispered, \"all of a sudden we were alone.\"",
- );
-}
-
-#[test]
-fn corrects_all_the_sudden_all_caps() {
- assert_suggestion_result(
- "ALL THE SUDDEN THE ROOM WENT DARK.",
- lint_group(),
- "ALL OF A SUDDEN THE ROOM WENT DARK.",
- );
-}
-
-#[test]
-fn corrects_all_the_sudden_end_period() {
- assert_suggestion_result(
- "They were laughing all the sudden.",
- lint_group(),
- "They were laughing all of a sudden.",
- );
-}
-
-#[test]
-fn counts_all_the_sudden_once() {
- assert_lint_count(
- "This all the sudden change surprised everyone.",
- lint_group(),
- 1,
- );
-}
-
-#[test]
-fn corrects_all_of_sudden_variant() {
- assert_suggestion_result(
- "It stormed all of sudden after a warm morning.",
- lint_group(),
- "It stormed all of a sudden after a warm morning.",
- );
-}
-
-#[test]
-fn ignores_all_the_suddenness() {
- assert_no_lints(
- "Their excitement and suddenness were all the suddenness she remembered.",
- lint_group(),
- );
-}
-
-// ALongTime
-#[test]
-fn detect_a_long_time() {
- assert_suggestion_result("along time", lint_group(), "a long time");
-}
-
-#[test]
-fn detect_a_long_time_real_world() {
- assert_suggestion_result(
- "Fast refreshing is very slow had to wait along time for it to update.",
- lint_group(),
- "Fast refreshing is very slow had to wait a long time for it to update.",
- );
-}
-
-// Alongside
-#[test]
-fn corrects_along_side_basic() {
- assert_suggestion_result(
- "They walked along side the river.",
- lint_group(),
- "They walked alongside the river.",
- );
-}
-
-#[test]
-fn corrects_along_side_sentence_start() {
- assert_suggestion_result(
- "Along side the road, we saw a parade.",
- lint_group(),
- "Alongside the road, we saw a parade.",
- );
-}
-
-#[test]
-fn corrects_along_side_all_caps() {
- assert_suggestion_result(
- "The banner read ALONG SIDE THE TEAM!",
- lint_group(),
- "The banner read ALONGSIDE THE TEAM!",
- );
-}
-
-#[test]
-fn corrects_along_side_with_period() {
- assert_suggestion_result(
- "The skiff pulled along side.",
- lint_group(),
- "The skiff pulled alongside.",
- );
-}
-
-#[test]
-fn corrects_along_side_in_quotes() {
- assert_suggestion_result(
- "\"We drifted along side,\" she said.",
- lint_group(),
- "\"We drifted alongside,\" she said.",
- );
-}
-
-#[test]
-fn corrects_along_side_before_comma() {
- assert_suggestion_result(
- "They stood along side, waiting patiently.",
- lint_group(),
- "They stood alongside, waiting patiently.",
- );
-}
-
-#[test]
-fn corrects_along_side_plural_subject() {
- assert_suggestion_result(
- "Cars lined up along side the curb.",
- lint_group(),
- "Cars lined up alongside the curb.",
- );
-}
-
-#[test]
-fn allows_correct_alongside() {
- assert_lint_count("They walked alongside the river.", lint_group(), 0);
-}
-
-#[test]
-fn allows_along_the_side_phrase() {
- assert_lint_count("They walked along the side of the river.", lint_group(), 0);
-}
-
-#[test]
-fn allows_lakeside_usage() {
- assert_lint_count("We camped along the lakeside all weekend.", lint_group(), 0);
-}
-
-// AlzheimersDisease
-// -none-
-
-// AnAnother
-#[test]
-fn correct_an_another() {
- assert_suggestion_result(
- "Render shader to use it as texture in an another shader.",
- lint_group(),
- "Render shader to use it as texture in another shader.",
- );
-}
-
-#[test]
-fn correct_a_another() {
- assert_suggestion_result(
- "Audit login is a another package for laravel framework.",
- lint_group(),
- "Audit login is another package for laravel framework.",
- );
-}
-
-// AnotherAn
-#[test]
-fn correct_another_an() {
- assert_suggestion_result(
- "Yet another an atomic deployment tool.",
- lint_group(),
- "Yet another atomic deployment tool.",
- );
-}
-
-// AnotherOnes
-#[test]
-fn correct_another_ones() {
- assert_nth_suggestion_result(
- "Change list params of a resource, another ones change too",
- lint_group(),
- "Change list params of a resource, other ones change too",
- 2,
- );
-}
-
-// AnotherThings
-#[test]
-fn correct_another_things() {
- assert_nth_suggestion_result(
- "Another things to fix in the Mask editor",
- lint_group(),
- "Other things to fix in the Mask editor",
- 1,
- );
-}
-
-// AsFarBackAs
-#[test]
-fn detect_as_early_back_as() {
- assert_suggestion_result("as early back as", lint_group(), "as far back as");
-}
-
-#[test]
-fn detect_as_early_back_as_real_world() {
- assert_suggestion_result(
- "skin overrides also supports a wide variety of minecraft versions - as early back as 1.14.4.",
- lint_group(),
- "skin overrides also supports a wide variety of minecraft versions - as far back as 1.14.4.",
- );
-}
-
-// AsIfThough
-#[test]
-fn correct_as_if_though_usagi_1() {
- assert_top3_suggestion_result(
- "It's coming back to you. and looking as if though it's very bright red.",
- lint_group(),
- "It's coming back to you. and looking as if it's very bright red.",
- );
-}
-
-#[test]
-fn correct_as_if_though_usagi_2() {
- assert_top3_suggestion_result(
- "it passes right on by it as if though nothing happened.",
- lint_group(),
- "it passes right on by it as though nothing happened.",
- );
-}
-
-// AsItHappens
-#[test]
-fn correct_as_it_happens() {
- assert_suggestion_result(
- "As it so happens, we have language currently in review that basically states that a major version break means backwards incompatibility ...",
- lint_group(),
- "As it happens, we have language currently in review that basically states that a major version break means backwards incompatibility ...",
- );
-}
-
-// AsLongAs
-#[test]
-fn correct_as_long_as() {
- assert_suggestion_result(
- "server loads up fine but cant log on client side aslong as the plugin is installed",
- lint_group(),
- "server loads up fine but cant log on client side as long as the plugin is installed",
- );
-}
-
-// AsOfLate
-#[test]
-fn corrects_as_of_lately() {
- assert_suggestion_result(
- "I haven't noticed any crashing with AMDGPU as of lately, so this looks to not be an issue anymore.",
- lint_group(),
- "I haven't noticed any crashing with AMDGPU as of late, so this looks to not be an issue anymore.",
- )
-}
-
-// AsOpposedTo
-#[test]
-fn correct_as_oppose_to() {
- assert_suggestion_result(
- "Distorted image upon opening the app as oppose to running the app after successful build",
- lint_group(),
- "Distorted image upon opening the app as opposed to running the app after successful build",
- );
-}
-
-// AtFaceValue
-#[test]
-fn correct_on_face_value() {
- assert_suggestion_result(
- "Obviously what you want is possible and on face value it's a trivial change on our end.",
- lint_group(),
- "Obviously what you want is possible and at face value it's a trivial change on our end.",
- );
-}
-
-// AtTheEndOfTheDay
-#[test]
-fn correct_at_the_end_of_the_day() {
- assert_suggestion_result(
- "In the end of the day, it's not a big deal.",
- lint_group(),
- "At the end of the day, it's not a big deal.",
- );
-}
-
-// AvoidAndAlso
-// -none-
-
-// BadRap
-#[test]
-fn bad_rep() {
- assert_suggestion_result("bad rep", lint_group(), "bad rap");
-}
-
-// BaitedBreath
-#[test]
-fn baited_breath() {
- assert_suggestion_result("baited breath", lint_group(), "bated breath");
-}
-
-// BandTogether
-// -none-
-
-// BareInMind
-// -none-
-
-// BeckAndCall
-// -none-
-
-// BeenThere
-// -none-
-
-// BeforeHand
-#[test]
-fn corrects_before_hand() {
- assert_suggestion_result(
- "Let me know before hand if you will attend.",
- lint_group(),
- "Let me know beforehand if you will attend.",
- );
-}
-
-#[test]
-fn corrects_before_hand_hyphen() {
- assert_suggestion_result(
- "I prepared the documents before-hand.",
- lint_group(),
- "I prepared the documents beforehand.",
- );
-}
-
-#[test]
-fn allows_beforehand() {
- assert_lint_count("We finished the preparations beforehand.", lint_group(), 0);
-}
-
-// BesideThePoint
-#[test]
-fn beside_the_point() {
- assert_suggestion_result(
- "we kind of focus on GPUs a lot but uh that's besides the point so uh sometime ago",
- lint_group(),
- "we kind of focus on GPUs a lot but uh that's beside the point so uh sometime ago",
- );
-}
-
-// BestRegards
-// -none-
-
-// BlanketStatement
-#[test]
-fn issue_790() {
- assert_suggestion_result(
- "This seems like a blanketed statement and I have not found any info to back up whether PyJWT is affected.",
- lint_group(),
- "This seems like a blanket statement and I have not found any info to back up whether PyJWT is affected.",
- );
-}
-
-// Brutality
-#[test]
-fn corrects_brutalness() {
- assert_suggestion_result(
- "the mildness and brutalness of the story rises.",
- lint_group(),
- "the mildness and brutality of the story rises.",
- )
-}
-
-// ByAccident
-// -none-
-
-// CanBeSeen
-// -none-
-
-// CaseInPoint
-#[test]
-fn correct_case_and_point_spaced() {
- assert_suggestion_result(
- "They are just not as high of a priority as other tasks that user's are requesting for, a case and point is I have never ran into this issue.",
- lint_group(),
- "They are just not as high of a priority as other tasks that user's are requesting for, a case in point is I have never ran into this issue.",
- );
-}
-
-// CaseSensitive
-// -none-
-
-// CondenseAllThe
-// -none-
-
-// CoursingThroughVeins
-#[test]
-fn detect_cursing_through_veins_atomic() {
- assert_suggestion_result(
- "cursing through veins",
- lint_group(),
- "coursing through veins",
- );
-}
-
-#[test]
-fn detect_cursing_through_veins_real_world() {
- assert_suggestion_result(
- "It felt like the drugs were cursing through veins.",
- lint_group(),
- "It felt like the drugs were coursing through veins.",
- );
-}
-
-#[test]
-fn does_not_flag_other_contexts() {
- assert_lint_count(
- "He was cursing through the entire meeting.",
- lint_group(),
- 0,
- );
-}
-
-// DampSquib
-// -none-
-
-// DayAndAge
-// -none
-
-// DegreesKelvin
-#[test]
-fn corrects_degrees_kelvin() {
- assert_suggestion_result("degrees kelvin", lint_group(), "kelvins");
- assert_suggestion_result("°K", lint_group(), "K");
-}
-
-// DoNotWant
-#[test]
-fn corrects_dont_wan() {
- assert_suggestion_result(
- "I don't wan to pay for this.",
- lint_group(),
- "I don't want to pay for this.",
- );
-}
-
-#[test]
-fn corrects_mixed_case() {
- assert_suggestion_result(
- "Don't Wan that option.",
- lint_group(),
- "Don't Want that option.",
- );
-}
-
-#[test]
-fn does_not_flag_already_correct() {
- assert_lint_count("I don't want to leave.", lint_group(), 0);
-}
-
-// EggYolk
-#[test]
-fn corrects_simple_egg_yoke() {
- assert_suggestion_result(
- "She whisked the egg yoke briskly.",
- lint_group(),
- "She whisked the egg yolk briskly.",
- );
-}
-
-#[test]
-fn corrects_sentence_start_egg_yoke() {
- assert_suggestion_result(
- "Egg yoke is rich in nutrients.",
- lint_group(),
- "Egg yolk is rich in nutrients.",
- );
-}
-
-#[test]
-fn corrects_all_caps_egg_yoke() {
- assert_suggestion_result(
- "Add the EGG YOKE to the batter.",
- lint_group(),
- "Add the EGG YOLK to the batter.",
- );
-}
-
-#[test]
-fn corrects_punctuated_egg_yoke() {
- assert_suggestion_result(
- "Separate the egg yoke, then fold it in.",
- lint_group(),
- "Separate the egg yolk, then fold it in.",
- );
-}
-
-#[test]
-fn corrects_adjective_egg_yoke() {
- assert_suggestion_result(
- "The runny egg yoke spilled over the toast.",
- lint_group(),
- "The runny egg yolk spilled over the toast.",
- );
-}
-
-#[test]
-fn corrects_plural_context_egg_yoke() {
- assert_suggestion_result(
- "Blend the cream with each egg yoke before baking.",
- lint_group(),
- "Blend the cream with each egg yolk before baking.",
- );
-}
-
-#[test]
-fn allows_correct_egg_yolk() {
- assert_lint_count("The custard calls for one egg yolk.", lint_group(), 0);
-}
-
-#[test]
-fn allows_plural_egg_yolks() {
- assert_lint_count("Reserve the egg yolks for later.", lint_group(), 0);
-}
-
-#[test]
-fn allows_yoke_without_egg() {
- assert_lint_count(
- "The artisan carved a wooden yoke for the oxen.",
- lint_group(),
- 0,
- );
-}
-
-#[test]
-fn does_not_flag_partial_phrase() {
- assert_lint_count("Crack the eggs so no yoke spills.", lint_group(), 0);
-}
-
-// DontCan
-#[test]
-fn corrects_dont_can() {
- assert_suggestion_result(
- "And currently uh I'm looking at it when I don't can see it like you know where it is, right?",
- lint_group(),
- "And currently uh I'm looking at it when I can't see it like you know where it is, right?",
- );
-}
-
-// EachAndEveryOne
-#[test]
-fn detect_each_and_everyone() {
- assert_suggestion_result("each and everyone", lint_group(), "each and every one");
-}
-
-#[test]
-fn detect_each_and_everyone_real_world() {
- assert_suggestion_result(
- "I have modified each and everyone of them to keep only the best of the best!",
- lint_group(),
- "I have modified each and every one of them to keep only the best of the best!",
- );
-}
-
-// EludedTo
-// -none-
-
-// EnMasse
-#[test]
-fn in_mass() {
- assert_suggestion_result("in mass", lint_group(), "en masse");
-}
-
-// EnRoute
-#[test]
-fn on_route() {
- assert_suggestion_result("on route to", lint_group(), "en route to");
-}
-
-#[test]
-fn in_route() {
- assert_suggestion_result("in route to", lint_group(), "en route to");
-}
-
-#[test]
-fn on_route_real_world() {
- assert_suggestion_result(
- "vehicles may already be on route to one end of a Shipment",
- lint_group(),
- "vehicles may already be en route to one end of a Shipment",
- );
-}
-
-#[test]
-fn on_hyphen_route_real_world() {
- assert_top3_suggestion_result(
- "I ultimately just want a slight preference for matches that are on-route to correct cases like the above.",
- lint_group(),
- "I ultimately just want a slight preference for matches that are en-route to correct cases like the above.",
- );
-}
-
-#[test]
-fn in_route_real_world() {
- assert_suggestion_result(
- "TF-South is in route to conduct SSE on the strike.",
- lint_group(),
- "TF-South is en route to conduct SSE on the strike.",
- );
-}
-
-// EverPresent
-#[test]
-fn detect_ever_present_atomic() {
- assert_suggestion_result("ever present", lint_group(), "ever-present");
-}
-
-#[test]
-fn detect_ever_present_real_world() {
- assert_suggestion_result(
- "Distrust was an ever present tension in the negotiations.",
- lint_group(),
- "Distrust was an ever-present tension in the negotiations.",
- );
-}
-
-// EverSince
-#[test]
-fn detect_ever_since() {
- assert_suggestion_result(
- "einstein been real quiet every since this dropped",
- lint_group(),
- "einstein been real quiet ever since this dropped",
- );
-}
-
-// EveryOnceAndAgain
-#[test]
-fn fix_every_once_and_again() {
- assert_suggestion_result(
- "Ys have been replaced with Ps, happens randomly every once and again with different letters",
- lint_group(),
- "Ys have been replaced with Ps, happens randomly every once in a while with different letters",
- );
-}
-
-// EveryTime
-#[test]
-fn fix_everytime() {
- assert_suggestion_result(
- "Init tool everytime a file in a directory is modified",
- lint_group(),
- "Init tool every time a file in a directory is modified",
- );
-}
-
-// Excellent
-#[test]
-fn excellent_clean() {
- assert_lint_count(
- "The performance was excellent, drawing praise from all critics.",
- lint_group(),
- 0,
- );
-}
-
-#[test]
-fn excellent_incorrect() {
- assert_suggestion_result(
- "Her results were very good this semester.",
- lint_group(),
- "Her results were excellent this semester.",
- );
-}
-
-#[test]
-fn excellent_no_false_positive() {
- assert_lint_count(
- "He radiated a sense of very goodness in his charitable acts.",
- lint_group(),
- 0,
- );
-}
-
-// ExpandBecause
-#[test]
-fn expand_cuz() {
- assert_suggestion_result(
- "Stick around cuz I got a surprise for you at the end.",
- lint_group(),
- "Stick around because I got a surprise for you at the end.",
- );
-}
-
-// ExpandForward
-#[test]
-fn expand_fwd() {
- assert_suggestion_result(
- "Now I look fwd to the interior, the color, etc.",
- lint_group(),
- "Now I look forward to the interior, the color, etc.",
- );
-}
-
-// ExpandMinimum
-// -none
-
-// ExpandWith
-// -none-
-
-// ExpandWithout
-// -none-
-
-// FaceFirst
-// -none-
-
-// FairBit
-#[test]
-fn corrects_fair_bit() {
- assert_suggestion_result(
- "I've read through a fare bit of the ecosystem framework, but I am not clear on what is modified...",
- lint_group(),
- "I've read through a fair bit of the ecosystem framework, but I am not clear on what is modified...",
- );
-}
-
-// FarAndFewBetween
-#[test]
-fn corrects_far_and_few_between() {
- assert_suggestion_result(
- "Their neighbors were far and few between, which only made it even more unlikely that surveillance footage recovered from their properties could help.",
- lint_group(),
- "Their neighbors were few and far between, which only made it even more unlikely that surveillance footage recovered from their properties could help.",
- );
-}
-
-// FastPaste
-// -none-
-
-// FatalOutcome
-// -none-
-
-// FetalPosition
-// -none-
-
-// ForALongTime
-#[test]
-fn test_for_a_long_time() {
- assert_suggestion_result(
- "I was stuck there for along time.",
- lint_group(),
- "I was stuck there for a long time.",
- );
-}
-
-// ForAWhile
-#[test]
-fn correct_for_while() {
- assert_suggestion_result(
- "Build flutter releases in github actions for production only android for while.",
- lint_group(),
- "Build flutter releases in github actions for production only android for a while.",
- );
-}
-
-// FreeRein
-// -none-
-
-// Freezing
-// -none-
-
-// GildedAge
-#[test]
-#[ignore = "There's a bug when changing the length of title case phrases.\nI believe there's a fix coming in a PR. Uncomment when fixed."]
-fn corrects_gilded_age_capitalized() {
- assert_suggestion_result(
- "It is especially a reflection of the socio-economic patterns in the Guilded Age.",
- lint_group(),
- "It is especially a reflection of the socio-economic patterns in the Gilded Age.",
- );
-}
-
-#[test]
-#[ignore = "Currently the correct spelling is suggested but the case is not changed.\nThis may also be fixed in the coming PR mentioned above."]
-fn corrects_gilded_age_lowercase() {
- assert_suggestion_result(
- "It is especially a reflection of the socio-economic patterns in the guilded age.",
- lint_group(),
- "It is especially a reflection of the socio-economic patterns in the Gilded Age.",
- );
-}
-
-// GoingTo
-// -none-
-
-// GuineaBissau
-#[test]
-fn guinea_bissau_missing_hyphen_only() {
- assert_suggestion_result("Guinea Bissau", lint_group(), "Guinea-Bissau");
-}
-
-// HadOf
-// -none-
-
-// HalfAnHour
-#[test]
-fn test_half_an_hour() {
- assert_suggestion_result(
- "It took half an our to get there.",
- lint_group(),
- "It took half an hour to get there.",
- );
-}
-
-// Haphazard
-// -none-
-
-// HumanBeings
-#[test]
-fn test_human_beings() {
- assert_suggestion_result(
- "All humans beings deserve empathy.",
- lint_group(),
- "All human beings deserve empathy.",
- );
- assert_suggestion_result(
- "We should respect a human's beings fundamental rights.",
- lint_group(),
- "We should respect a human beings fundamental rights.",
- );
-}
-
-// HumanLife
-// -none-
-
-// HungerPang
-#[test]
-fn hunger_pain() {
- assert_suggestion_result("hunger pain", lint_group(), "hunger pang");
-}
-
-// IAm
-// -none-
-
-// IDo
-#[test]
-fn corrects_i_does() {
- assert_suggestion_result(
- "I does enjoy writing Rust.",
- lint_group(),
- "I do enjoy writing Rust.",
- );
-}
-
-// Initiatively
-#[test]
-fn corrects_initiatively_2422() {
- assert_suggestion_result(
- "I have initiatively signed up for the course.",
- lint_group(),
- "I have proactively signed up for the course.",
- );
-}
-
-// InLieuOf
-
-#[test]
-fn corrects_in_lue_of() {
- assert_suggestion_result(
- "Controller Emulation in lue of Direct Controller binding",
- lint_group(),
- "Controller Emulation in lieu of Direct Controller binding",
- );
-}
-
-// InAndOfItself
-#[test]
-fn detect_atomic_in_of_itself() {
- assert_top3_suggestion_result("in of itself", lint_group(), "in and of itself");
-}
-
-#[test]
-fn correct_real_world_in_of_itself() {
- assert_top3_suggestion_result(
- "This is not entirely unexpected in of itself, as Git and GitHub Desktop both generally prove fairly bad at delineating context intelligently...",
- lint_group(),
- "This is not entirely unexpected in and of itself, as Git and GitHub Desktop both generally prove fairly bad at delineating context intelligently...",
- )
-}
-
-// InAnyWay
-#[test]
-fn detect_in_anyway_atomic() {
- assert_suggestion_result("in anyway", lint_group(), "in any way");
-}
-
-#[test]
-fn detect_in_anyway_real_world() {
- assert_suggestion_result(
- "The names should not affect your application in anyway and you can override extension names.",
- lint_group(),
- "The names should not affect your application in any way and you can override extension names.",
- );
-}
-
-// InAWhile
-#[test]
-fn test_in_a_while() {
- assert_suggestion_result(
- "We’ll talk again in while.",
- lint_group(),
- "We’ll talk again in a while.",
- );
-}
-
-// InNeedOf
-#[test]
-fn corrects_in_need_of() {
- assert_suggestion_result(
- "In need for a native control for map symbols (map legend) #5203.",
- lint_group(),
- "In need of a native control for map symbols (map legend) #5203.",
- );
-}
-
-// InOneFellSwoop
-// -none-
-
-// Insensitive
-#[test]
-fn test_insensitive() {
- assert_suggestion_result(
- "We want to potentially make an unsensitive header",
- lint_group(),
- "We want to potentially make an insensitive header",
- );
-}
-
-// InsteadOf
-#[test]
-fn test_instead_of() {
- assert_suggestion_result(
- "He used water in stead of soda.",
- lint_group(),
- "He used water instead of soda.",
- );
-}
-
-#[test]
-fn test_instead_of_clean() {
- // Ensure no lint is triggered when it's already correct
- assert_lint_count("He used water instead of soda.", lint_group(), 0);
-}
-
-// Insurmountable
-#[test]
-fn corrects_unsurmountable() {
- assert_suggestion_result(
- "That being said, if you find upgrading to newer versions to be unsurmountable, please open an issue.",
- lint_group(),
- "That being said, if you find upgrading to newer versions to be insurmountable, please open an issue.",
- )
-}
-
-// Intact
-#[test]
-fn test_intact() {
- assert_suggestion_result(
- "The code remains in tact after the merge.",
- lint_group(),
- "The code remains intact after the merge.",
- );
-}
-
-#[test]
-fn test_intact_clean() {
- assert_lint_count("The data set remains intact.", lint_group(), 0);
-}
-
-// InThe
-// -none-
-
-// IsKnownFor
-// -none-
-
-// ItCan
-// -none-
-
-// IveGotTo
-#[test]
-fn test_ive_got_to() {
- assert_suggestion_result(
- "I've go to finish this before Monday.",
- lint_group(),
- "I've got to finish this before Monday.",
- );
-}
-
-// JawDropping
-// -none-
-
-// JustDeserts
-// -none-
-
-// KindOf
-#[test]
-fn corrects_kinda_of() {
- assert_suggestion_result(
- "Some kinda of Sync issue only with 0.79.1",
- lint_group(),
- "Some kind of Sync issue only with 0.79.1",
- );
-}
-
-// KindRegards
-// -none-
-
-// LastButNotLeast
-#[test]
-fn issue_777() {
- assert_suggestion_result(
- "Last but not the least, with VS2013 you can use Web Essentials 2013",
- lint_group(),
- "Last but not least, with VS2013 you can use Web Essentials 2013",
- );
-}
-
-#[test]
-fn test_last_but_not_least() {
- assert_suggestion_result(
- "Last but not last, I'd like to thank my parents.",
- lint_group(),
- "Last but not least, I'd like to thank my parents.",
- );
-}
-
-// LastDitch
-#[test]
-fn correct_last_ditched() {
- assert_suggestion_result(
- "I was actually just trying that as a last ditched attempt to get it working, previously those ...",
- lint_group(),
- "I was actually just trying that as a last-ditch attempt to get it working, previously those ...",
- );
-}
-
-#[test]
-fn correct_last_ditch_space() {
- assert_suggestion_result(
- "There are unique use cases and is meant to be a last ditch option.",
- lint_group(),
- "There are unique use cases and is meant to be a last-ditch option.",
- );
-}
-
-// LastNight
-#[test]
-fn corrects_yesterday_night_basic() {
- assert_suggestion_result(
- "I was there yesterday night.",
- lint_group(),
- "I was there last night.",
- );
-}
-
-#[test]
-fn corrects_yesterday_night_capitalized() {
- assert_suggestion_result(
- "Yesterday night was fun.",
- lint_group(),
- "Last night was fun.",
- );
-}
-
-#[test]
-fn corrects_yesterday_night_with_comma() {
- assert_suggestion_result(
- "Yesterday night, we watched a movie.",
- lint_group(),
- "Last night, we watched a movie.",
- );
-}
-
-#[test]
-fn corrects_yesterday_night_across_newline() {
- assert_suggestion_result(
- "They left yesterday\nnight after the show.",
- lint_group(),
- "They left last night after the show.",
- );
-}
-
-#[test]
-fn no_lint_for_last_night_phrase() {
- assert_lint_count("I remember last night clearly.", lint_group(), 0);
-}
-
-// LetAlone
-#[test]
-fn let_along() {
- assert_suggestion_result("let along", lint_group(), "let alone");
-}
-
-// LikeAsIf
-#[test]
-fn correct_like_as_if() {
- assert_top3_suggestion_result(
- "And looks like as if linux-personality hasn't got any changes for 8 years.",
- lint_group(),
- "And looks as if linux-personality hasn't got any changes for 8 years.",
- );
-}
-
-// LikeThePlague
-#[test]
-fn correct_like_a_plague() {
- assert_suggestion_result(
- "Below is the worst example of them all (avoid such coding like a plague):",
- lint_group(),
- "Below is the worst example of them all (avoid such coding like the plague):",
- );
-}
-
-// LowHangingFruit
-#[test]
-fn corrects_low_hanging_fruit() {
- assert_suggestion_result(
- "If you add me as a collaborator i can start merging some of the low hanging fruit.",
- lint_group(),
- "If you add me as a collaborator i can start merging some of the low-hanging fruit.",
- )
-}
-
-#[test]
-fn corrects_low_hanging_fruits_hyphen() {
- assert_suggestion_result(
- "Field guide to gather low-hanging fruits.",
- lint_group(),
- "Field guide to gather low-hanging fruit.",
- )
-}
-
-#[test]
-fn corrects_low_hanging_fruits_space() {
- assert_suggestion_result(
- "Will search for low hanging fruits and useful information for escalation on a compromised workstation.",
- lint_group(),
- "Will search for low-hanging fruit and useful information for escalation on a compromised workstation.",
- )
-}
-
-// ManagerialReins
-#[test]
-fn fixes_managerial_reigns_basic() {
- assert_suggestion_result(
- "She grabbed the managerial reigns during the crisis.",
- lint_group(),
- "She grabbed the managerial reins during the crisis.",
- );
-}
-
-#[test]
-fn fixes_managerial_reigns_sentence_start() {
- assert_suggestion_result(
- "Managerial reigns are never easy to hand over.",
- lint_group(),
- "Managerial reins are never easy to hand over.",
- );
-}
-
-#[test]
-fn fixes_managerial_reigns_with_article() {
- assert_suggestion_result(
- "The managerial reigns belong to Carla now.",
- lint_group(),
- "The managerial reins belong to Carla now.",
- );
-}
-
-#[test]
-fn fixes_managerial_reigns_with_comma() {
- assert_suggestion_result(
- "By winter, he held the managerial reigns, and morale improved.",
- lint_group(),
- "By winter, he held the managerial reins, and morale improved.",
- );
-}
-
-#[test]
-fn fixes_managerial_reigns_question() {
- assert_suggestion_result(
- "Who will hold the managerial reigns after April?",
- lint_group(),
- "Who will hold the managerial reins after April?",
- );
-}
-
-#[test]
-fn fixes_managerial_reigns_in_quotes() {
- assert_suggestion_result(
- "\"managerial reigns\" showed up in the draft notes.",
- lint_group(),
- "\"managerial reins\" showed up in the draft notes.",
- );
-}
-
-#[test]
-fn counts_managerial_reigns_error() {
- assert_lint_count(
- "They debated who should manage the managerial reigns for the quarter.",
- lint_group(),
- 1,
- );
-}
-
-#[test]
-fn counts_managerial_reigns_caps() {
- assert_lint_count("Their memo shouted MANAGERIAL REIGNS.", lint_group(), 1);
-}
-
-#[test]
-fn allows_managerial_reins_correct() {
- assert_no_lints(
- "He kept the managerial reins despite the reshuffle.",
- lint_group(),
- );
-}
-
-#[test]
-fn allows_reigns_without_managerial() {
- assert_no_lints("Legends of ancient reigns filled the museum.", lint_group());
-}
-
-// Monumentous
-#[test]
-fn detect_monumentous_atomic() {
- assert_suggestion_result("monumentous", lint_group(), "momentous");
-}
-
-#[test]
-fn detect_monumentous_real_world() {
- assert_suggestion_result(
- "I think that would be a monumentous step in the right direction, and would DEFINATLY turn heads in not just the music industry, but every ...",
- lint_group(),
- "I think that would be a momentous step in the right direction, and would DEFINATLY turn heads in not just the music industry, but every ...",
- );
-}
-
-// MyHouse
-// -none-
-
-// NeedHelp
-// -none-
-
-// NerveRacking
-#[test]
-fn detect_nerve_wracking_hyphen() {
- assert_suggestion_result(
- "We've gone through several major changes / upgrades to atlantis, and it's always a little bit nerve-wracking because if we mess something up we ...",
- lint_group(),
- "We've gone through several major changes / upgrades to atlantis, and it's always a little bit nerve-racking because if we mess something up we ...",
- );
-}
-
-#[test]
-fn detect_nerve_wrecking_hyphen() {
- assert_suggestion_result(
- "The issue happens to me on a daily basis, and it is nerve-wrecking because I become unsure if I have actually saved the diagram, but every time ...",
- lint_group(),
- "The issue happens to me on a daily basis, and it is nerve-racking because I become unsure if I have actually saved the diagram, but every time ...",
- );
-}
-
-#[test]
-fn detect_nerve_wracking_no_hyphen() {
- assert_suggestion_result(
- "Very nerve wracking landing in an unfamiliar mountainous airport in dead of night with no radar to show surrounding terrain.",
- lint_group(),
- "Very nerve-racking landing in an unfamiliar mountainous airport in dead of night with no radar to show surrounding terrain.",
- );
-}
-
-#[test]
-fn detect_nerve_wrecking_no_hyphen() {
- assert_suggestion_result(
- "I appreciate any kind of help since this is kind of nerve wrecking.",
- lint_group(),
- "I appreciate any kind of help since this is kind of nerve-racking.",
- );
-}
-
-#[test]
-fn detect_nerve_racking_no_hyphen() {
- assert_suggestion_result(
- "It's nerve racking to think about it because I have code inside the callback that resolves the member and somehow I feel like it's so ..",
- lint_group(),
- "It's nerve-racking to think about it because I have code inside the callback that resolves the member and somehow I feel like it's so ..",
- );
-}
-
-// NotIn
-// -none-
-
-// NotTo
-// -none-
-
-// NotUncommon moved to phrase_set_corrections as part of the
-// generalized double negative mapping.
-
-// OfCourse
-// See also: tests in `of_course.rs` for "of curse/corse" → "of course" corrections
-#[test]
-fn off_course() {
- assert_suggestion_result(
- "Yes, off course we should do that.",
- lint_group(),
- "Yes, of course we should do that.",
- );
-}
-
-#[test]
-fn o_course() {
- assert_suggestion_result(
- "Yes, o course we should do that.",
- lint_group(),
- "Yes, of course we should do that.",
- );
-}
-
-#[test]
-fn ofcourse() {
- assert_suggestion_result(
- "Ofcourse, I like other languages.. uzulla has 183 repositories available.",
- lint_group(),
- "Of course, I like other languages.. uzulla has 183 repositories available.",
- );
-}
-
-// OffTheCuff
-// -none-
-
-// OldWivesTale
-// -none-
-
-// OnceInAWhile
-#[test]
-fn corrects_once_a_while() {
- assert_suggestion_result(
- "For me it is a SMB mount I have on the client device that I sync only once a while for a backup into the cloud.",
- lint_group(),
- "For me it is a SMB mount I have on the client device that I sync only once in a while for a backup into the cloud.",
- );
-}
-
-#[test]
-fn corrects_once_and_a_while() {
- assert_suggestion_result(
- "Every once and a while all the links on my page seem to stop working.",
- lint_group(),
- "Every once in a while all the links on my page seem to stop working.",
- );
-}
-
-// OnSecondThought
-#[test]
-fn on_second_thought_clean() {
- assert_lint_count(
- "She considered driving home, but on second thought, she decided to walk.",
- lint_group(),
- 0,
- );
-}
-
-#[test]
-fn on_second_thought_incorrect() {
- assert_suggestion_result(
- "I was going to buy it, but on second though, maybe I'll wait.",
- lint_group(),
- "I was going to buy it, but on second thought, maybe I'll wait.",
- );
-}
-
-#[test]
-fn on_second_thought_no_false_positive() {
- assert_lint_count(
- "My second though is that I'd prefer something else entirely.",
- lint_group(),
- 0,
- );
-}
-
-// OnTheSpurOfTheMoment
-fn fix_on_the_spurt_of_the_moment() {
- assert_suggestion_result(
- "Quite often in the spurt of the moment, someone will say something which they think is witty.",
- lint_group(),
- "Quite often on the spur of the moment, someone will say something which they think is witty.",
- );
-}
-
-fn fix_at_the_spur_of_the_moment() {
- assert_suggestion_result(
- "but at the spur of the moment, I'd say that ansible-lint should work exactly like ansible",
- lint_group(),
- "but on the spur of the moment, I'd say that ansible-lint should work exactly like ansible",
- );
-}
-
-fn fix_in_the_spur_of_the_moment() {
- assert_suggestion_result(
- "an assortment of things I started yesterday in the spur of the moment",
- lint_group(),
- "an assortment of things I started yesterday on the spur of the moment",
- );
-}
-
-// OnTopOf
-#[test]
-fn correct_on_top_of() {
- assert_suggestion_result(
- "Initcpio hooks for overlayfs ontop of root.",
- lint_group(),
- "Initcpio hooks for overlayfs on top of root.",
- );
-}
-
-// PeaceOfMind
-#[test]
-fn corrects_piece_of_mind() {
- assert_suggestion_result(
- "A Discord bot that gives you piece of mind knowing you are free from obnoxious intrusions in a Discord Voice Channel",
- lint_group(),
- "A Discord bot that gives you peace of mind knowing you are free from obnoxious intrusions in a Discord Voice Channel",
- )
-}
-
-// PerSe
-#[test]
-fn corrects_per_se_hyphenated() {
- assert_suggestion_result(
- "It's not a problem per-se, but it would make the desktop more consistent when using QT and KDE apps.",
- lint_group(),
- "It's not a problem per se, but it would make the desktop more consistent when using QT and KDE apps.",
- )
-}
-
-#[test]
-fn corrects_per_say() {
- assert_suggestion_result(
- "Hi all - not really an issue per say, but more of a request for some suggestions and guidance.",
- lint_group(),
- "Hi all - not really an issue per se, but more of a request for some suggestions and guidance.",
- );
-}
-
-#[test]
-fn corrects_per_say_hyphenated() {
- assert_suggestion_result(
- "Whilst I don't think this is wrong per-say, I'm not confident it is necessary.",
- lint_group(),
- "Whilst I don't think this is wrong per se, I'm not confident it is necessary.",
- );
-}
-
-// PrayingMantis
-// -none-
-
-// QuiteMany
-#[test]
-fn corrects_quite_many() {
- assert_suggestion_result(
- "To me it seems it might be caused by a2aaa55 which contains quite many build-related changes.",
- lint_group(),
- "To me it seems it might be caused by a2aaa55 which contains quite a few build-related changes.",
- );
-}
-
-// RapidFire
-// -none-
-
-// 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-
-
-// RoadMap
-// -none-
-
-// SameAs
-// -none-
-
-// ScantilyClad
-// -none-
-
-// SimpleGrammatical
-// -none-
-
-// SneakingSuspicion
-#[test]
-fn sneaky_suspicion() {
- assert_suggestion_result("sneaky suspicion", lint_group(), "sneaking suspicion");
-}
-
-// SomebodyElses
-#[test]
-fn correct_somebodys_else() {
- assert_suggestion_result(
- "I really like your component and change to somebody's else would be really bad for now.",
- lint_group(),
- "I really like your component and change to somebody else's would be really bad for now.",
- );
-}
-
-#[test]
-fn correct_somebodys_elses() {
- assert_suggestion_result(
- "Nice to know it's somebody's else's problem for a change.",
- lint_group(),
- "Nice to know it's somebody else's problem for a change.",
- );
-}
-
-// SomeOfThe
-#[test]
-fn corrects_some_the_beginning() {
- assert_suggestion_result(
- "Some the trees are too thick to climb.",
- lint_group(),
- "Some of the trees are too thick to climb.",
- );
-}
-
-#[test]
-fn corrects_some_the() {
- assert_suggestion_result(
- "You have misplaced some the config files.",
- lint_group(),
- "You have misplaced some of the config files.",
- );
-}
-
-// SoonerOrLater
-// -none-
-
-// SpecialAttention
-#[test]
-fn spacial_attention() {
- assert_suggestion_result("spacial attention", lint_group(), "special attention");
-}
-
-// Starving
-// -none-
-
-// StateOfTheArt
-// -none-
-
-// StatuteOfLimitations
-#[test]
-fn statute_of_limitations() {
- assert_suggestion_result(
- "Shouldn't there be a grandfathered-in or statue of limitations for posts before the original punishment?",
- lint_group(),
- "Shouldn't there be a grandfathered-in or statute of limitations for posts before the original punishment?",
- );
-}
-
-// SufficeItToSay
-#[test]
-fn suffice_it_to_say() {
- assert_suggestion_result(
- "I don't fully grok the bug, but suffice to say it is not an RCD issue.",
- lint_group(),
- "I don't fully grok the bug, but suffice it to say it is not an RCD issue.",
- );
-}
-
-// SupposedTo
-#[test]
-fn supposed_to() {
- assert_suggestion_result("suppose to", lint_group(), "supposed to");
-}
-
-// TakeItPersonally
-#[test]
-fn corrects_take_it_personal() {
- assert_suggestion_result(
- "This is not personal, do not take it personal, we also think Thingsboard is a extraordinary tool (we are using in several scenarios in fact)",
- lint_group(),
- "This is not personal, do not take it personally, we also think Thingsboard is a extraordinary tool (we are using in several scenarios in fact)",
- );
-}
-
-// TakeItSeriously
-// -none-
-
-// ThatChallenged
-// -none-
-
-// ThatThis
-// -none-
-
-// TheAnother
-#[test]
-fn correct_the_another() {
- assert_suggestion_result(
- "Another possible cause is simply that the application does not have file creation permissions on the another machine.",
- lint_group(),
- "Another possible cause is simply that the application does not have file creation permissions on the other machine.",
- );
-}
-
-// ThereIsAny
-// -none-
-
-// ThoughtProcess
-// -none-
-
-// TickingTimeClock
-#[test]
-fn suggests_ticking_time_bomb() {
- assert_suggestion_result(
- "One element that can help up the stakes (and tension!) is a “ticking time clock.”",
- lint_group(),
- "One element that can help up the stakes (and tension!) is a “ticking time bomb.”",
- );
-}
-
-#[test]
-fn suggests_ticking_clock() {
- assert_nth_suggestion_result(
- "The opportunity itself has a ticking time clock as all great opportunities do.",
- lint_group(),
- "The opportunity itself has a ticking clock as all great opportunities do.",
- 1,
- );
-}
-
-// ToDoHyphen
-// -none-
-
-// ToGreatLengths
-#[test]
-fn correct_through_great_lengths() {
- assert_suggestion_result(
- "Bloomberg's sponsored paid for content goes through great lengths to market Nvidia's products and in particular its AI products that we've frequently criticized.",
- lint_group(),
- "Bloomberg's sponsored paid for content goes to great lengths to market Nvidia's products and in particular its AI products that we've frequently criticized.",
- );
-}
-
-#[test]
-fn correct_to_a_great_length() {
- assert_suggestion_result(
- "While ratatui-image goes to a great length to detect a rendered image's pixel size in terms of \"character cells that will be covered\", via font pixel size detection, ultimately it's up to the terminal emulator to decide what exactly a pixel is.",
- lint_group(),
- "While ratatui-image goes to great lengths to detect a rendered image's pixel size in terms of \"character cells that will be covered\", via font pixel size detection, ultimately it's up to the terminal emulator to decide what exactly a pixel is.",
- );
-}
-
-// ToTheMannerBorn
-// -none-
-
-// TongueInCheek
-#[test]
-fn tongue_and_cheek_plain() {
- assert_suggestion_result(
- "The remark was entirely tongue and cheek.",
- lint_group(),
- "The remark was entirely tongue in cheek.",
- );
-}
-
-#[test]
-fn tongue_and_cheek_with_article() {
- assert_suggestion_result(
- "It was a tongue and cheek response.",
- lint_group(),
- "It was a tongue in cheek response.",
- );
-}
-
-#[test]
-fn tongue_and_cheek_with_comma() {
- assert_suggestion_result(
- "He delivered it tongue and cheek, expecting a laugh.",
- lint_group(),
- "He delivered it tongue in cheek, expecting a laugh.",
- );
-}
-
-#[test]
-fn tongue_and_cheek_in_quotes() {
- assert_suggestion_result(
- "\"tongue and cheek\" jokes are tough to read.",
- lint_group(),
- "\"tongue in cheek\" jokes are tough to read.",
- );
-}
-
-#[test]
-fn tongue_and_cheek_all_caps() {
- assert_suggestion_result(
- "Their tone was TONGUE AND CHEEK all night.",
- lint_group(),
- "Their tone was TONGUE IN CHEEK all night.",
- );
-}
-
-#[test]
-fn tongue_and_cheek_capitalized() {
- assert_suggestion_result(
- "Tongue and cheek banter kept the meeting light.",
- lint_group(),
- "Tongue in cheek banter kept the meeting light.",
- );
-}
-
-#[test]
-fn tongue_and_cheek_in_parentheses() {
- assert_suggestion_result(
- "Her note (totally tongue and cheek) made us smile.",
- lint_group(),
- "Her note (totally tongue in cheek) made us smile.",
- );
-}
-
-#[test]
-fn tongue_and_cheek_question() {
- assert_suggestion_result(
- "Was that tongue and cheek or sincere?",
- lint_group(),
- "Was that tongue in cheek or sincere?",
- );
-}
-
-#[test]
-fn tongue_in_cheek_is_allowed() {
- assert_lint_count(
- "Their comments were deliberately tongue in cheek.",
- lint_group(),
- 0,
- );
-}
-
-#[test]
-fn tongue_in_cheek_hyphenated_is_allowed() {
- assert_lint_count("That was a tongue-in-cheek reply.", lint_group(), 0);
-}
-
-// Towards
-// -none-
-
-// TrialAndError
-#[test]
-fn correct_trail_and_error() {
- assert_suggestion_result(
- "It was produced through trail and error.",
- lint_group(),
- "It was produced through trial and error.",
- );
-}
-
-// TurnItOff
-#[test]
-fn turn_it_off_clean_lower() {
- assert_lint_count("turn it off", lint_group(), 0);
-}
-
-#[test]
-fn turn_it_off_clean_upper() {
- assert_lint_count("Turn it off", lint_group(), 0);
-}
-
-#[test]
-fn of_confusion() {
- assert_suggestion_result("Turn it of", lint_group(), "Turn it off");
-}
-
-#[test]
-fn i_and_of_confusion() {
- assert_suggestion_result("Turn i of", lint_group(), "Turn it off");
-}
-
-#[test]
-fn issue_574() {
- assert_lint_count("run by one", lint_group(), 0);
-}
-
-// Unless
-#[test]
-fn correct_unless_if() {
- assert_suggestion_result(
- "Simplex does not interpret the following invite link as an invite link unless if it has https:// in front of it.",
- lint_group(),
- "Simplex does not interpret the following invite link as an invite link unless it has https:// in front of it.",
- );
-}
-
-// WantBe
-// -none-
-
-// WaveFunction
-// -none-
-
-// WellBeing
-// -noun-
-
-// WellKept
-#[test]
-fn correct_highly_kept_space() {
- assert_suggestion_result(
- "I assure you that frequency/angle dependence is a highly kept secret.",
- lint_group(),
- "I assure you that frequency/angle dependence is a well-kept secret.",
- );
-}
-
-#[test]
-fn correct_highly_kept_no_hyphen() {
- assert_suggestion_result(
- "Well, Kushina's giving birth was already a highly-kept secret so it makes sense to operate with only the completely necessary personnel.",
- lint_group(),
- "Well, Kushina's giving birth was already a well-kept secret so it makes sense to operate with only the completely necessary personnel.",
- );
-}
-
-// WhetYourAppetite
-// -none-
-
-// WillContain
-// -none-
-
-// WorldWarII
-// -none-
-
-// WorstCaseScenario
-#[test]
-fn correct_worst_case_space() {
- assert_suggestion_result(
- "The worst case scenario can be calculated without looking at streams of data.",
- lint_group(),
- "The worst-case scenario can be calculated without looking at streams of data.",
- );
-}
-
-#[test]
-fn correct_worst_case_two_hyphens() {
- assert_suggestion_result(
- "CAPD worst-case-scenario cloud simulator for naughty clouds.",
- lint_group(),
- "CAPD worst-case scenario cloud simulator for naughty clouds.",
- );
-}
-
-// Used to belong to LoAndBehold which disappeared in #efb3b82
-#[test]
-fn now_on_hold() {
- assert_lint_count("Those are now on hold for month.", lint_group(), 0);
-}
-
-// ThanksALot
-#[test]
-fn thanks_lot() {
- assert_suggestion_result("thanks lot", lint_group(), "thanks a lot");
-}
-
-#[test]
-fn thanks_a_lot_clean() {
- assert_lint_count("thanks a lot", lint_group(), 0);
-}
-
-#[test]
-fn fixes_to_worry_about() {
- assert_top3_suggestion_result(
- "I don't want you to worried about it.",
- lint_group(),
- "I don't want you to worry about it.",
- );
- assert_top3_suggestion_result(
- "I don't want you to worried about it.",
- lint_group(),
- "I don't want you too worried about it.",
- );
-}
-
-// WroughtIron
-#[test]
-fn corrects_rod_iron() {
- assert_suggestion_result(
- "The gate was crafted from rod iron.",
- lint_group(),
- "The gate was crafted from wrought iron.",
- );
-}
-
-#[test]
-fn corrects_rot_iron() {
- assert_suggestion_result(
- "The artisan works in rot iron.",
- lint_group(),
- "The artisan works in wrought iron.",
- );
-}
-
-#[test]
-fn allows_wrought_iron() {
- assert_lint_count("She specialized in wrought iron artwork.", lint_group(), 0);
-}
-
-#[test]
-fn fixes_teh() {
- assert_suggestion_result(
- "I adore teh light of the moon.",
- lint_group(),
- "I adore the light of the moon.",
- );
-}
-
-#[test]
-fn issue_2132() {
- assert_suggestion_result(
- "I know that that answer is correct",
- lint_group(),
- "I know that answer is correct",
- );
-}
diff --git a/harper-core/src/linting/use_genitive.rs b/harper-core/src/linting/use_genitive.rs
deleted file mode 100644
index 141f04814..000000000
--- a/harper-core/src/linting/use_genitive.rs
+++ /dev/null
@@ -1,184 +0,0 @@
-use crate::expr::Expr;
-use crate::expr::FirstMatchOf;
-use crate::expr::SequenceExpr;
-use crate::expr::WordExprGroup;
-use crate::linting::expr_linter::Chunk;
-use crate::linting::{ExprLinter, LintKind, Suggestion};
-use crate::patterns::Word;
-use crate::{Lint, Lrc, Token};
-
-// Looks for places where the genitive case _isn't_ being used, and should be.
-pub struct UseGenitive {
- expr: Box<dyn Expr>,
-}
-
-impl UseGenitive {
- fn new() -> Self {
- // Define the environment in which the genitive case __should__ be used.
- let environment = Lrc::new(SequenceExpr::default().then_whitespace().then_longest_of(
- vec![
- Box::new(
- SequenceExpr::default()
- .then_one_or_more_adjectives()
- .then_whitespace()
- .then_noun(),
- ),
- Box::new(SequenceExpr::default().then_noun()),
- ],
- ));
-
- let trigger_words = ["there", "they're"];
-
- let mut primary_pattern = WordExprGroup::default();
-
- for word in trigger_words {
- primary_pattern.add(
- word,
- SequenceExpr::default()
- .then(Word::new_exact(word))
- .then(environment.clone()),
- )
- }
-
- // Add a prelude to remove false-positives.
- let full_pattern = SequenceExpr::default()
- .then_unless(FirstMatchOf::new(vec![
- Box::new(SequenceExpr::default().t_aco("is")),
- Box::new(SequenceExpr::default().t_aco("were")),
- Box::new(SequenceExpr::default().then_adjective()),
- ]))
- .then_whitespace()
- .then(primary_pattern);
-
- Self {
- expr: Box::new(full_pattern),
- }
- }
-}
-
-impl ExprLinter for UseGenitive {
- type Unit = Chunk;
-
- fn expr(&self) -> &dyn Expr {
- self.expr.as_ref()
- }
-
- fn match_to_lint(&self, matched_tokens: &[Token], _source: &[char]) -> Option<Lint> {
- Some(Lint {
- span: matched_tokens[2].span,
- lint_kind: LintKind::Miscellaneous,
- suggestions: vec![Suggestion::ReplaceWith(vec!['t', 'h', 'e', 'i', 'r'])],
- message: "Use the genitive case.".to_string(),
- priority: 31,
- })
- }
-
- fn description(&self) -> &'static str {
- "Looks for situations where the genitive case of \"there\" should be used."
- }
-}
-
-impl Default for UseGenitive {
- fn default() -> Self {
- Self::new()
- }
-}
-
-#[cfg(test)]
-mod tests {
- use crate::linting::tests::{assert_lint_count, assert_suggestion_result};
-
- use super::UseGenitive;
-
- #[test]
- fn catches_adjective_noun() {
- assert_suggestion_result(
- "What are there big problems?",
- UseGenitive::default(),
- "What are their big problems?",
- )
- }
-
- #[test]
- fn catches_just_noun() {
- assert_suggestion_result(
- "What are there problems?",
- UseGenitive::default(),
- "What are their problems?",
- )
- }
-
- #[test]
- fn allows_clause_termination() {
- assert_lint_count("Look there!", UseGenitive::default(), 0)
- }
-
- #[test]
- fn allows_there_are() {
- assert_lint_count(
- "Since there are people here, we should be socially aware.",
- UseGenitive::default(),
- 0,
- )
- }
-
- #[test]
- fn allows_there_at_beginning() {
- assert_lint_count(
- "There is a cute cat sitting on the chair at home.",
- UseGenitive::default(),
- 0,
- )
- }
-
- #[test]
- #[should_panic] // currently fails, because "received" is ambiguous between verb and adjective
- fn catches_they_are() {
- assert_suggestion_result(
- "The students received they're test results today.",
- UseGenitive::default(),
- "The students received their test results today.",
- )
- }
-
- #[test]
- fn allows_grantlemons_issue_267_cat() {
- assert_lint_count("Were there cats at her house?", UseGenitive::default(), 0);
- }
-
- #[test]
- fn allows_grantlemons_issue_267_apple() {
- assert_lint_count(
- "Were there any apples at the store?",
- UseGenitive::default(),
- 0,
- );
- }
-
- #[test]
- fn allows_grantlemons_issue_267_fruit() {
- assert_lint_count(
- "Were there many kinds of fruit at the store?",
- UseGenitive::default(),
- 0,
- );
- }
-
- #[test]
- fn allows_grantlemons_issue_267_people() {
- assert_lint_count(
- "Were there more than, or less than six people at the party?",
- UseGenitive::default(),
- 0,
- );
- }
-
- #[test]
- fn allows_faster_at_running() {
- assert_lint_count(
- "Melissa was faster at running than her friend.",
- UseGenitive::default(),
- 0,
- );
- }
-}
diff --git a/harper-core/src/linting/weir_rules/ACoupleMore.weir b/harper-core/src/linting/weir_rules/ACoupleMore.weir
new file mode 100644
index 000000000..56bbbd703
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ACoupleMore.weir
@@ -0,0 +1,8 @@
+expr main (a couple of more)
+
+let message "The correct wording is `a couple more`, without the `of`."
+let description "Corrects `a couple of more` to `a couple more`."
+let kind "Redundancy"
+let becomes "a couple more"
+
+test "There are a couple of more rules that could be added, how can I contribute?" "There are a couple more rules that could be added, how can I contribute?"
diff --git a/harper-core/src/linting/weir_rules/ALongTime.weir b/harper-core/src/linting/weir_rules/ALongTime.weir
new file mode 100644
index 000000000..59e351d51
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ALongTime.weir
@@ -0,0 +1,9 @@
+expr main (along time)
+
+let message "Use `a long time` for referring to a duration of time."
+let description "Corrects `along time` to `a long time`."
+let kind "Grammar"
+let becomes "a long time"
+
+test "along time" "a long time"
+test "Fast refreshing is very slow had to wait along time for it to update." "Fast refreshing is very slow had to wait a long time for it to update."
diff --git a/harper-core/src/linting/weir_rules/AdNauseam.weir b/harper-core/src/linting/weir_rules/AdNauseam.weir
new file mode 100644
index 000000000..147c5ce6e
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AdNauseam.weir
@@ -0,0 +1,9 @@
+expr main (as nauseam)
+
+let message "This phrase comes from Latin, where `ad` means `to`."
+let description "Corrects `as nauseam` to `ad nauseam`."
+let kind "Spelling"
+let becomes "ad nauseam"
+
+test "As you say, discussed as nauseam, but no nearer a solution." "As you say, discussed ad nauseam, but no nearer a solution."
+test "no more autism please, hearing about it as nauseam is starting to make me sick" "no more autism please, hearing about it ad nauseam is starting to make me sick"
diff --git a/harper-core/src/linting/weir_rules/AfterAWhile.weir b/harper-core/src/linting/weir_rules/AfterAWhile.weir
new file mode 100644
index 000000000..040847968
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AfterAWhile.weir
@@ -0,0 +1,8 @@
+expr main (after while)
+
+let message "When describing a timeframe, use `a while`."
+let description "Corrects the missing article in `after while`, forming `after a while`."
+let kind "Grammar"
+let becomes "after a while"
+
+test "bromite Crashes on all sites after while." "bromite Crashes on all sites after a while."
diff --git a/harper-core/src/linting/weir_rules/AheadAnd.weir b/harper-core/src/linting/weir_rules/AheadAnd.weir
new file mode 100644
index 000000000..f778754eb
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AheadAnd.weir
@@ -0,0 +1,7 @@
+expr main (ahead an)
+
+let message "Did you make a typo? Shouldn't it be `and`?"
+let description "Corrects `an` to `and` after `ahead`."
+let becomes "ahead and"
+
+test "If it's important, go ahead an open an issue." "If it's important, go ahead and open an issue."
diff --git a/harper-core/src/linting/weir_rules/AllOfASudden.weir b/harper-core/src/linting/weir_rules/AllOfASudden.weir
new file mode 100644
index 000000000..6859b2821
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AllOfASudden.weir
@@ -0,0 +1,18 @@
+expr main [(all of the sudden), (all of sudden), (all the sudden)]
+
+let message "Prefer the standard phrasing `all of a sudden`."
+let description "Guides this expression toward the standard `all of a sudden`."
+let kind "Nonstandard"
+let becomes "all of a sudden"
+
+test "On an app that has been released since December, all of the sudden around February 5th ANRs started going up." "On an app that has been released since December, all of a sudden around February 5th ANRs started going up."
+test "It happened all the sudden when the lights went out." "It happened all of a sudden when the lights went out."
+test "All the sudden the room fell quiet." "All of a sudden the room fell quiet."
+test "The music stopped, all the sudden, during the chorus." "The music stopped, all of a sudden, during the chorus."
+test "Did the power cut all the sudden?" "Did the power cut all of a sudden?"
+test "He whispered, \"all the sudden we were alone.\"" "He whispered, \"all of a sudden we were alone.\""
+test "ALL THE SUDDEN THE ROOM WENT DARK." "ALL OF A SUDDEN THE ROOM WENT DARK."
+test "They were laughing all the sudden." "They were laughing all of a sudden."
+test "It stormed all of sudden after a warm morning." "It stormed all of a sudden after a warm morning."
+test "Their excitement and suddenness were all the suddenness she remembered." "Their excitement and suddenness were all the suddenness she remembered."
+test "This all the sudden change surprised everyone." "This all of a sudden change surprised everyone."
diff --git a/harper-core/src/linting/weir_rules/Alongside.weir b/harper-core/src/linting/weir_rules/Alongside.weir
new file mode 100644
index 000000000..93be74e4b
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/Alongside.weir
@@ -0,0 +1,17 @@
+expr main (along side)
+
+let message "Use the single word `alongside`."
+let description "Replaces the spaced form `along side` with `alongside`."
+let kind "WordChoice"
+let becomes "alongside"
+
+test "They walked along side the river." "They walked alongside the river."
+test "Along side the road, we saw a parade." "Alongside the road, we saw a parade."
+test "The banner read ALONG SIDE THE TEAM!" "The banner read ALONGSIDE THE TEAM!"
+test "The skiff pulled along side." "The skiff pulled alongside."
+test "\"We drifted along side,\" she said." "\"We drifted alongside,\" she said."
+test "They stood along side, waiting patiently." "They stood alongside, waiting patiently."
+test "Cars lined up along side the curb." "Cars lined up alongside the curb."
+test "They walked alongside the river." "They walked alongside the river."
+test "They walked along the side of the river." "They walked along the side of the river."
+test "We camped along the lakeside all weekend." "We camped along the lakeside all weekend."
diff --git a/harper-core/src/linting/weir_rules/AlzheimersDisease.weir b/harper-core/src/linting/weir_rules/AlzheimersDisease.weir
new file mode 100644
index 000000000..7aba9fa83
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AlzheimersDisease.weir
@@ -0,0 +1,7 @@
+expr main (old-timers' disease)
+
+let message "Use the correct medical term."
+let description "Fixes the common misnomer `old-timers' disease`, ensuring the correct medical term `Alzheimer’s disease` is used."
+let kind "Eggcorn"
+let becomes "Alzheimer’s disease"
+
diff --git a/harper-core/src/linting/weir_rules/AnAnother.weir b/harper-core/src/linting/weir_rules/AnAnother.weir
new file mode 100644
index 000000000..f1c442918
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AnAnother.weir
@@ -0,0 +1,9 @@
+expr main [(an another), (a another)]
+
+let message "Use `another` on its own."
+let description "Corrects `an another` and `a another`."
+let kind "Redundancy"
+let becomes "another"
+
+test "Render shader to use it as texture in an another shader." "Render shader to use it as texture in another shader."
+test "Audit login is a another package for laravel framework." "Audit login is another package for laravel framework."
diff --git a/harper-core/src/linting/weir_rules/AnotherAn.weir b/harper-core/src/linting/weir_rules/AnotherAn.weir
new file mode 100644
index 000000000..f17090c4d
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AnotherAn.weir
@@ -0,0 +1,8 @@
+expr main (another an)
+
+let message "Use `another` on its own."
+let description "Corrects `another an` to `another`."
+let kind "Redundancy"
+let becomes "another"
+
+test "Yet another an atomic deployment tool." "Yet another atomic deployment tool."
diff --git a/harper-core/src/linting/weir_rules/AnotherOnes.weir b/harper-core/src/linting/weir_rules/AnotherOnes.weir
new file mode 100644
index 000000000..46ade76ec
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AnotherOnes.weir
@@ -0,0 +1,8 @@
+expr main (another ones)
+
+let message "`another` is singular but `ones` is plural. Or maybe you meant the possessive `one's`."
+let description "Corrects `another ones`."
+let kind "Agreement"
+let becomes ["another one", "another one's", "other ones"]
+
+test "Change list params of a resource, another ones change too" "Change list params of a resource, other ones change too"
diff --git a/harper-core/src/linting/weir_rules/AnotherThings.weir b/harper-core/src/linting/weir_rules/AnotherThings.weir
new file mode 100644
index 000000000..1daf338de
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AnotherThings.weir
@@ -0,0 +1,8 @@
+expr main (another things)
+
+let message "`another` is singular but `things` is plural."
+let description "Corrects `another things`."
+let kind "Agreement"
+let becomes ["another thing", "other things"]
+
+test "Another things to fix in the Mask editor" "Other things to fix in the Mask editor"
diff --git a/harper-core/src/linting/weir_rules/AsFarBackAs.weir b/harper-core/src/linting/weir_rules/AsFarBackAs.weir
new file mode 100644
index 000000000..209bf7c06
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AsFarBackAs.weir
@@ -0,0 +1,9 @@
+expr main (as early back as)
+
+let message "Use `as far back as` for referring to a time in the past."
+let description "Corrects nonstandard `as early back as` to `as far back as`."
+let kind "WordChoice"
+let becomes "as far back as"
+
+test "as early back as" "as far back as"
+test "skin overrides also supports a wide variety of minecraft versions - as early back as 1.14.4." "skin overrides also supports a wide variety of minecraft versions - as far back as 1.14.4."
diff --git a/harper-core/src/linting/weir_rules/AsIfThough.weir b/harper-core/src/linting/weir_rules/AsIfThough.weir
new file mode 100644
index 000000000..33baafedf
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AsIfThough.weir
@@ -0,0 +1,9 @@
+expr main (as if though)
+
+let message "This should be `as if` or `as though`."
+let description "Corrects redundant `as if though`."
+let kind "Redundancy"
+let becomes ["as if", "as though"]
+
+test "It's coming back to you. and looking as if though it's very bright red." "It's coming back to you. and looking as if it's very bright red."
+test "it passes right on by it as if though nothing happened." "it passes right on by it as though nothing happened."
diff --git a/harper-core/src/linting/weir_rules/AsItHappens.weir b/harper-core/src/linting/weir_rules/AsItHappens.weir
new file mode 100644
index 000000000..185cb1f0f
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AsItHappens.weir
@@ -0,0 +1,8 @@
+expr main (as it so happens)
+
+let message "Did you mean `as it happens`?"
+let description "Corrects `as it so happens` to `as it happens`."
+let kind "Usage"
+let becomes "as it happens"
+
+test "As it so happens, we have language currently in review that basically states that a major version break means backwards incompatibility ..." "As it happens, we have language currently in review that basically states that a major version break means backwards incompatibility ..."
diff --git a/harper-core/src/linting/weir_rules/AsLongAs.weir b/harper-core/src/linting/weir_rules/AsLongAs.weir
new file mode 100644
index 000000000..502d751c3
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AsLongAs.weir
@@ -0,0 +1,8 @@
+expr main (aslong as)
+
+let message "`As long` should be written as two words."
+let description "Corrects `aslong as` to `as long as`."
+let kind "BoundaryError"
+let becomes "as long as"
+
+test "server loads up fine but cant log on client side aslong as the plugin is installed" "server loads up fine but cant log on client side as long as the plugin is installed"
diff --git a/harper-core/src/linting/weir_rules/AsOfLate.weir b/harper-core/src/linting/weir_rules/AsOfLate.weir
new file mode 100644
index 000000000..0d3ce7e05
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AsOfLate.weir
@@ -0,0 +1,8 @@
+expr main (as of lately)
+
+let message "The standard form is `as of late`."
+let description "Corrects `as of lately` to `as of late`."
+let kind "WordChoice"
+let becomes "as of late"
+
+test "I haven't noticed any crashing with AMDGPU as of lately, so this looks to not be an issue anymore." "I haven't noticed any crashing with AMDGPU as of late, so this looks to not be an issue anymore."
diff --git a/harper-core/src/linting/weir_rules/AsOpposedTo.weir b/harper-core/src/linting/weir_rules/AsOpposedTo.weir
new file mode 100644
index 000000000..07b06d30c
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AsOpposedTo.weir
@@ -0,0 +1,8 @@
+expr main (as oppose to)
+
+let message "Did you mean `as opposed to`?"
+let description "Corrects `as oppose to` to `as opposed to`."
+let kind "Usage"
+let becomes "as opposed to"
+
+test "Distorted image upon opening the app as oppose to running the app after successful build" "Distorted image upon opening the app as opposed to running the app after successful build"
diff --git a/harper-core/src/linting/weir_rules/AtFaceValue.weir b/harper-core/src/linting/weir_rules/AtFaceValue.weir
new file mode 100644
index 000000000..9cd029589
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AtFaceValue.weir
@@ -0,0 +1,8 @@
+expr main (on face value)
+
+let message "`at face value is more idiomatic and more common."
+let description "Corrects `on face value` to the more usual `at face value`."
+let kind "WordChoice"
+let becomes "at face value"
+
+test "Obviously what you want is possible and on face value it's a trivial change on our end." "Obviously what you want is possible and at face value it's a trivial change on our end."
diff --git a/harper-core/src/linting/weir_rules/AtTheEndOfTheDay.weir b/harper-core/src/linting/weir_rules/AtTheEndOfTheDay.weir
new file mode 100644
index 000000000..3b4cb0a98
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AtTheEndOfTheDay.weir
@@ -0,0 +1,8 @@
+expr main (in the end of the day)
+
+let message "Did you mean `at the end of the day`?"
+let description "Corrects `in the end of the day` to `at the end of the day`."
+let kind "WordChoice"
+let becomes "at the end of the day"
+
+test "In the end of the day, it's not a big deal." "At the end of the day, it's not a big deal."
diff --git a/harper-core/src/linting/weir_rules/AvoidAndAlso.weir b/harper-core/src/linting/weir_rules/AvoidAndAlso.weir
new file mode 100644
index 000000000..93a50fbf7
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AvoidAndAlso.weir
@@ -0,0 +1,7 @@
+expr main (and also)
+
+let message "Consider using just `and`."
+let description "Reduces redundancy by replacing `and also` with `and`."
+let kind "Redundancy"
+let becomes "and"
+
diff --git a/harper-core/src/linting/weir_rules/BadRap.weir b/harper-core/src/linting/weir_rules/BadRap.weir
new file mode 100644
index 000000000..7af8a015f
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/BadRap.weir
@@ -0,0 +1,8 @@
+expr main [(bed rap), (bad rep)]
+
+let message "Did you mean `bad rap`?"
+let description "Changes `bed rap` to the proper idiom `bad rap`."
+let kind "Eggcorn"
+let becomes "bad rap"
+
+test "bad rep" "bad rap"
diff --git a/harper-core/src/linting/weir_rules/BanTogether.weir b/harper-core/src/linting/weir_rules/BanTogether.weir
new file mode 100644
index 000000000..14e0f0e30
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/BanTogether.weir
@@ -0,0 +1,7 @@
+expr main (ban together)
+
+let message "Did you mean `band together`?"
+let description "Detects and corrects the common error of using `ban together` instead of the idiom `band together`, which means to unite or join forces."
+let kind "Eggcorn"
+let becomes "band together"
+
diff --git a/harper-core/src/linting/weir_rules/BareInMind.weir b/harper-core/src/linting/weir_rules/BareInMind.weir
new file mode 100644
index 000000000..aa71b64e0
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/BareInMind.weir
@@ -0,0 +1,7 @@
+expr main (bare in mind)
+
+let message "Did you mean `bear in mind`?"
+let description "Ensures the phrase `bear in mind` is used correctly instead of `bare in mind`."
+let kind "Eggcorn"
+let becomes "bear in mind"
+
diff --git a/harper-core/src/linting/weir_rules/BatedBreath.weir b/harper-core/src/linting/weir_rules/BatedBreath.weir
new file mode 100644
index 000000000..e419e708f
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/BatedBreath.weir
@@ -0,0 +1,8 @@
+expr main (baited breath)
+
+let message "Did you mean `bated breath`?"
+let description "Changes `baited breath` to the correct `bated breath`."
+let kind "Eggcorn"
+let becomes "bated breath"
+
+test "baited breath" "bated breath"
diff --git a/harper-core/src/linting/weir_rules/BeckAndCall.weir b/harper-core/src/linting/weir_rules/BeckAndCall.weir
new file mode 100644
index 000000000..975a8a518
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/BeckAndCall.weir
@@ -0,0 +1,7 @@
+expr main (back and call)
+
+let message "Did you mean `beck and call`?"
+let description "Fixes `back and call` to `beck and call`."
+let kind "Eggcorn"
+let becomes "beck and call"
+
diff --git a/harper-core/src/linting/weir_rules/BeenThere.weir b/harper-core/src/linting/weir_rules/BeenThere.weir
new file mode 100644
index 000000000..af4ff9779
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/BeenThere.weir
@@ -0,0 +1,7 @@
+expr main (bee there)
+
+let message "Did you mean `been there`?"
+let description "Corrects the misspelling `bee there` to the proper phrase `been there`."
+let kind "Typo"
+let becomes "been there"
+
diff --git a/harper-core/src/linting/weir_rules/Beforehand.weir b/harper-core/src/linting/weir_rules/Beforehand.weir
new file mode 100644
index 000000000..d951d4a15
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/Beforehand.weir
@@ -0,0 +1,9 @@
+expr main [(before hand), (before-hand)]
+
+let message "Prefer the single-word adverb `beforehand`."
+let description "`Beforehand` functions as a fixed adverb meaning ‘in advance’; writing it as two words or with a hyphen is nonstandard and can jar readers."
+let becomes "beforehand"
+
+test "Let me know before hand if you will attend." "Let me know beforehand if you will attend."
+test "I prepared the documents before-hand." "I prepared the documents beforehand."
+test "We finished the preparations beforehand." "We finished the preparations beforehand."
diff --git a/harper-core/src/linting/weir_rules/BesideThePoint.weir b/harper-core/src/linting/weir_rules/BesideThePoint.weir
new file mode 100644
index 000000000..9be9cfb7a
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/BesideThePoint.weir
@@ -0,0 +1,8 @@
+expr main (besides the point)
+
+let message "Use `beside` in the idiom `beside the point`."
+let description "Corrects `besides the point` to `beside the point`."
+let kind "Eggcorn"
+let becomes "beside the point"
+
+test "we kind of focus on GPUs a lot but uh that's besides the point so uh sometime ago" "we kind of focus on GPUs a lot but uh that's beside the point so uh sometime ago"
diff --git a/harper-core/src/linting/weir_rules/BestRegards.weir b/harper-core/src/linting/weir_rules/BestRegards.weir
new file mode 100644
index 000000000..a86273c83
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/BestRegards.weir
@@ -0,0 +1,7 @@
+expr main (beat regards)
+
+let message "Use `best regards` to convey sincere well wishes in a closing."
+let description "In valedictions, `best` expresses your highest regard—avoid the typo `beat regards`."
+let kind "Typo"
+let becomes "best regards"
+
diff --git a/harper-core/src/linting/weir_rules/BlanketStatement.weir b/harper-core/src/linting/weir_rules/BlanketStatement.weir
new file mode 100644
index 000000000..e0f41387d
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/BlanketStatement.weir
@@ -0,0 +1,8 @@
+expr main (blanketed statement)
+
+let message "Use the more idiomatic phrasing."
+let description "Corrects common errors in the phrase `blanket statement`."
+let kind "Usage"
+let becomes "blanket statement"
+
+test "This seems like a blanketed statement and I have not found any info to back up whether PyJWT is affected." "This seems like a blanket statement and I have not found any info to back up whether PyJWT is affected."
diff --git a/harper-core/src/linting/weir_rules/Brutality.weir b/harper-core/src/linting/weir_rules/Brutality.weir
new file mode 100644
index 000000000..53567acf0
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/Brutality.weir
@@ -0,0 +1,8 @@
+expr main (brutalness)
+
+let message "This word has a more standard, more common synonym."
+let description "Suggests the more standard and common synonym `brutality`."
+let kind "WordChoice"
+let becomes "brutality"
+
+test "the mildness and brutalness of the story rises." "the mildness and brutality of the story rises."
diff --git a/harper-core/src/linting/weir_rules/BuiltIn.weir b/harper-core/src/linting/weir_rules/BuiltIn.weir
new file mode 100644
index 000000000..3338a8e2b
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/BuiltIn.weir
@@ -0,0 +1,7 @@
+expr main [(in built), (in-built), (built in)]
+
+let message "Prefer the hyphenated compound `built-in`."
+let description "English convention treats `built-in` as a single, attributive adjective—meaning something integrated from the outset—whereas other forms like `in built` are nonstandard and can feel awkward to readers."
+let becomes "built-in"
+let kind "Punctuation"
+
diff --git a/harper-core/src/linting/weir_rules/ByAccident.weir b/harper-core/src/linting/weir_rules/ByAccident.weir
new file mode 100644
index 000000000..463f27290
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ByAccident.weir
@@ -0,0 +1,7 @@
+expr main (on accident)
+
+let message "Did you mean `by accident`?"
+let description "Incorrect preposition: `by accident` is the idiomatic expression."
+let kind "Usage"
+let becomes "by accident"
+
diff --git a/harper-core/src/linting/weir_rules/CanBeSeen.weir b/harper-core/src/linting/weir_rules/CanBeSeen.weir
new file mode 100644
index 000000000..8697191a5
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/CanBeSeen.weir
@@ -0,0 +1,7 @@
+expr main (can be seem)
+
+let message "Did you mean `can be seen`?"
+let description "Corrects `can be seem` to the proper phrase `can be seen`."
+let kind "Typo"
+let becomes "can be seen"
+
diff --git a/harper-core/src/linting/weir_rules/CaseInPoint.weir b/harper-core/src/linting/weir_rules/CaseInPoint.weir
new file mode 100644
index 000000000..1d8266b57
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/CaseInPoint.weir
@@ -0,0 +1,8 @@
+expr main (case and point)
+
+let message "`Case in point` is the correct form of the phrase."
+let description "Corrects `case and point` to `case in point`."
+let kind "Malapropism"
+let becomes "case in point"
+
+test "They are just not as high of a priority as other tasks that user's are requesting for, a case and point is I have never ran into this issue." "They are just not as high of a priority as other tasks that user's are requesting for, a case in point is I have never ran into this issue."
diff --git a/harper-core/src/linting/weir_rules/CaseSensitive.weir b/harper-core/src/linting/weir_rules/CaseSensitive.weir
new file mode 100644
index 000000000..c5c6f79b0
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/CaseSensitive.weir
@@ -0,0 +1,7 @@
+expr main (case sensitive)
+
+let message "Use the hyphenated form for `case-sensitive`."
+let description "Ensures `case-sensitive` is correctly hyphenated."
+let kind "Punctuation"
+let becomes "case-sensitive"
+
diff --git a/harper-core/src/linting/weir_rules/CondenseAllThe.weir b/harper-core/src/linting/weir_rules/CondenseAllThe.weir
new file mode 100644
index 000000000..d9538b408
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/CondenseAllThe.weir
@@ -0,0 +1,7 @@
+expr main (all of the)
+
+let message "Consider simplifying to `all the`."
+let description "Suggests removing `of` in `all of the` for a more concise phrase."
+let kind "Redundancy"
+let becomes "all the"
+
diff --git a/harper-core/src/linting/weir_rules/CoursingThroughVeins.weir b/harper-core/src/linting/weir_rules/CoursingThroughVeins.weir
new file mode 100644
index 000000000..3d159cbe4
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/CoursingThroughVeins.weir
@@ -0,0 +1,10 @@
+expr main (cursing through veins)
+
+let message "In this idiom, blood `courses` (flows) through veins, not `curses`."
+let description "In English idioms, `to course` means to flow rapidly—so avoid the eggcorn `cursing through veins.`"
+let kind "Eggcorn"
+let becomes "coursing through veins"
+
+test "cursing through veins" "coursing through veins"
+test "It felt like the drugs were cursing through veins." "It felt like the drugs were coursing through veins."
+test "He was cursing through the entire meeting." "He was cursing through the entire meeting."
diff --git a/harper-core/src/linting/weir_rules/DampSquib.weir b/harper-core/src/linting/weir_rules/DampSquib.weir
new file mode 100644
index 000000000..252bc3bdd
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/DampSquib.weir
@@ -0,0 +1,7 @@
+expr main (damp squid)
+
+let message "Use the correct phrase for a disappointing outcome."
+let description "Corrects the eggcorn `damp squid` to `damp squib`, ensuring the intended meaning of a failed or underwhelming outcome."
+let kind "Eggcorn"
+let becomes "damp squib"
+
diff --git a/harper-core/src/linting/weir_rules/DayAndAge.weir b/harper-core/src/linting/weir_rules/DayAndAge.weir
new file mode 100644
index 000000000..3137518ea
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/DayAndAge.weir
@@ -0,0 +1,7 @@
+expr main (day in age)
+
+let message "Use `day and age` for referring to the present time."
+let description "Corrects the eggcorn `day in age` to `day and age`, which properly means the current era or time period."
+let kind "Eggcorn"
+let becomes "day and age"
+
diff --git a/harper-core/src/linting/weir_rules/DegreesKelvin.weir b/harper-core/src/linting/weir_rules/DegreesKelvin.weir
new file mode 100644
index 000000000..2cb645899
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/DegreesKelvin.weir
@@ -0,0 +1,8 @@
+expr main [(degrees kelvin), (degrees Kelvin), (degree kelvin), (degree Kelvin)]
+
+let message "Use `kelvins` when discussing the unit Kelvin."
+let description "Corrects use of `degrees kelvin` to `kelvins`."
+let kind "Usage"
+let becomes ["kelvins", "kelvin"]
+
+test "degrees kelvin" "kelvins"
diff --git a/harper-core/src/linting/weir_rules/DegreesKelvinSymbol.weir b/harper-core/src/linting/weir_rules/DegreesKelvinSymbol.weir
new file mode 100644
index 000000000..a6d9f5e40
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/DegreesKelvinSymbol.weir
@@ -0,0 +1,8 @@
+expr main (°K)
+
+let message "Use just the symbol `K` when discussing the unit Kelvin."
+let description "Corrects use of `°K` to `K`."
+let kind "Usage"
+let becomes "K"
+
+test "°K" "K"
diff --git a/harper-core/src/linting/weir_rules/DoNotWant.weir b/harper-core/src/linting/weir_rules/DoNotWant.weir
new file mode 100644
index 000000000..2fdc5eab5
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/DoNotWant.weir
@@ -0,0 +1,10 @@
+expr main [(don't wan), (do not wan)]
+
+let message "Use the full verb `want` after negation: `don't want` or `do not want.`"
+let description "In English, negation still requires the complete verb form (`want`), so avoid truncating it to `wan.`"
+let kind "Typo"
+let becomes ["don't want", "do not want"]
+
+test "I don't wan to pay for this." "I don't want to pay for this."
+test "Don't Wan that option." "Don't Want that option."
+test "I don't want to leave." "I don't want to leave."
diff --git a/harper-core/src/linting/weir_rules/DontCan.weir b/harper-core/src/linting/weir_rules/DontCan.weir
new file mode 100644
index 000000000..c26d4d96d
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/DontCan.weir
@@ -0,0 +1,8 @@
+expr main (don't can)
+
+let message "The grammatically correct form is `can't` or `cannot`."
+let description "Corrects `don't can` to `can't` or `cannot`."
+let kind "Grammar"
+let becomes ["can't", "cannot"]
+
+test "And currently uh I'm looking at it when I don't can see it like you know where it is, right?" "And currently uh I'm looking at it when I can't see it like you know where it is, right?"
diff --git a/harper-core/src/linting/weir_rules/EachAndEveryOne.weir b/harper-core/src/linting/weir_rules/EachAndEveryOne.weir
new file mode 100644
index 000000000..34ad6f9c9
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/EachAndEveryOne.weir
@@ -0,0 +1,9 @@
+expr main (each and everyone)
+
+let message "Use `each and every one` for referring to a group of people or things."
+let description "Corrects `each and everyone` to `each and every one`."
+let kind "BoundaryError"
+let becomes "each and every one"
+
+test "each and everyone" "each and every one"
+test "I have modified each and everyone of them to keep only the best of the best!" "I have modified each and every one of them to keep only the best of the best!"
diff --git a/harper-core/src/linting/weir_rules/EggYolk.weir b/harper-core/src/linting/weir_rules/EggYolk.weir
new file mode 100644
index 000000000..5340b2069
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/EggYolk.weir
@@ -0,0 +1,17 @@
+expr main (egg yoke)
+
+let message "Use `egg yolk` when you mean the yellow portion of an egg."
+let description "Corrects the eggcorn `egg yoke`, replacing it with the standard culinary term `egg yolk`."
+let kind "Eggcorn"
+let becomes "egg yolk"
+
+test "She whisked the egg yoke briskly." "She whisked the egg yolk briskly."
+test "Egg yoke is rich in nutrients." "Egg yolk is rich in nutrients."
+test "Add the EGG YOKE to the batter." "Add the EGG YOLK to the batter."
+test "Separate the egg yoke, then fold it in." "Separate the egg yolk, then fold it in."
+test "The runny egg yoke spilled over the toast." "The runny egg yolk spilled over the toast."
+test "Blend the cream with each egg yoke before baking." "Blend the cream with each egg yolk before baking."
+test "The custard calls for one egg yolk." "The custard calls for one egg yolk."
+test "Reserve the egg yolks for later." "Reserve the egg yolks for later."
+test "The artisan carved a wooden yoke for the oxen." "The artisan carved a wooden yoke for the oxen."
+test "Crack the eggs so no yoke spills." "Crack the eggs so no yoke spills."
diff --git a/harper-core/src/linting/weir_rules/EludedTo.weir b/harper-core/src/linting/weir_rules/EludedTo.weir
new file mode 100644
index 000000000..d9dc87d7a
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/EludedTo.weir
@@ -0,0 +1,7 @@
+expr main (eluded to)
+
+let message "Did you mean `alluded to`?"
+let description "Corrects `eluded to` to `alluded to` in contexts referring to indirect references."
+let kind "Malapropism"
+let becomes "alluded to"
+
diff --git a/harper-core/src/linting/weir_rules/EnMasse.weir b/harper-core/src/linting/weir_rules/EnMasse.weir
new file mode 100644
index 000000000..ae58c90d4
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/EnMasse.weir
@@ -0,0 +1,8 @@
+expr main [(on mass), (on masse), (in mass)]
+
+let message "Did you mean `en masse`?"
+let description "Detects variants like `on mass` or `in mass` and suggests `en masse`."
+let kind "Eggcorn"
+let becomes "en masse"
+
+test "in mass" "en masse"
diff --git a/harper-core/src/linting/weir_rules/EnRoute.weir b/harper-core/src/linting/weir_rules/EnRoute.weir
new file mode 100644
index 000000000..8ffb69138
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/EnRoute.weir
@@ -0,0 +1,12 @@
+expr main [(on route to), (in route to), (on-route to), (in-route to)]
+
+let message "Did you mean `en route`?"
+let description "Detects variants like `on route` or `in route` and suggests `en route`."
+let kind "Eggcorn"
+let becomes ["en route to", "en-route to"]
+
+test "on route to" "en route to"
+test "in route to" "en route to"
+test "vehicles may already be on route to one end of a Shipment" "vehicles may already be en route to one end of a Shipment"
+test "TF-South is in route to conduct SSE on the strike." "TF-South is en route to conduct SSE on the strike."
+test "I ultimately just want a slight preference for matches that are on-route to correct cases like the above." "I ultimately just want a slight preference for matches that are en-route to correct cases like the above."
diff --git a/harper-core/src/linting/weir_rules/EverPresent.weir b/harper-core/src/linting/weir_rules/EverPresent.weir
new file mode 100644
index 000000000..25da75129
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/EverPresent.weir
@@ -0,0 +1,9 @@
+expr main (ever present)
+
+let message "Hyphenate `ever-present` when it functions as a compound adjective."
+let description "Corrects the missing hyphen in `ever present` to the compound adjective `ever-present`."
+let kind "Punctuation"
+let becomes "ever-present"
+
+test "ever present" "ever-present"
+test "Distrust was an ever present tension in the negotiations." "Distrust was an ever-present tension in the negotiations."
diff --git a/harper-core/src/linting/weir_rules/EverSince.weir b/harper-core/src/linting/weir_rules/EverSince.weir
new file mode 100644
index 000000000..ba6ff6415
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/EverSince.weir
@@ -0,0 +1,8 @@
+expr main (every since)
+
+let message "Did you mean `ever since`?"
+let description "Corrects `every since` to `ever since`."
+let kind "Typo"
+let becomes "ever since"
+
+test "einstein been real quiet every since this dropped" "einstein been real quiet ever since this dropped"
diff --git a/harper-core/src/linting/weir_rules/EveryOnceAndAgain.weir b/harper-core/src/linting/weir_rules/EveryOnceAndAgain.weir
new file mode 100644
index 000000000..015f9fd84
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/EveryOnceAndAgain.weir
@@ -0,0 +1,8 @@
+expr main (every once and again)
+
+let message "For things that happen only occasionaly use `every once in a while. For things that persistently happen use `once again`."
+let description "Corrects `every once and again` to `every once in a while` or `once again`."
+let kind "Usage"
+let becomes ["every once in a while", "once again"]
+
+test "Ys have been replaced with Ps, happens randomly every once and again with different letters" "Ys have been replaced with Ps, happens randomly every once in a while with different letters"
diff --git a/harper-core/src/linting/weir_rules/EveryTime.weir b/harper-core/src/linting/weir_rules/EveryTime.weir
new file mode 100644
index 000000000..1c7aeb8a1
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/EveryTime.weir
@@ -0,0 +1,8 @@
+expr main (everytime)
+
+let message "`Everytime` as a single word is proscribed. Use `every time` instead."
+let description "Corrects `everytime` to `every time`."
+let kind "Usage"
+let becomes "every time"
+
+test "Init tool everytime a file in a directory is modified" "Init tool every time a file in a directory is modified"
diff --git a/harper-core/src/linting/weir_rules/Excellent.weir b/harper-core/src/linting/weir_rules/Excellent.weir
new file mode 100644
index 000000000..f53b55fa6
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/Excellent.weir
@@ -0,0 +1,11 @@
+expr main (very good)
+
+let message "Vocabulary enhancement: use `excellent` instead of `very good`"
+let description "Provides a stronger word choice by replacing `very good` with `excellent` for clarity and emphasis."
+let kind "Enhancement"
+let becomes "excellent"
+
+test "Her results were very good this semester." "Her results were excellent this semester."
+test "The performance was excellent, drawing praise from all critics." "The performance was excellent, drawing praise from all critics."
+test "He radiated a sense of very goodness in his charitable acts." "He radiated a sense of very goodness in his charitable acts."
+test "She generally gave herself very good advice" "She generally gave herself excellent advice"
diff --git a/harper-core/src/linting/weir_rules/ExpandBecause.weir b/harper-core/src/linting/weir_rules/ExpandBecause.weir
new file mode 100644
index 000000000..a5298fc83
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ExpandBecause.weir
@@ -0,0 +1,8 @@
+expr main (cuz)
+
+let message "Use `because` instead of informal `cuz`"
+let description "Expands the informal abbreviation `cuz` to the full word `because` for formality."
+let kind "Style"
+let becomes "because"
+
+test "Stick around cuz I got a surprise for you at the end." "Stick around because I got a surprise for you at the end."
diff --git a/harper-core/src/linting/weir_rules/ExpandForward.weir b/harper-core/src/linting/weir_rules/ExpandForward.weir
new file mode 100644
index 000000000..8eb9b04e8
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ExpandForward.weir
@@ -0,0 +1,8 @@
+expr main (fwd)
+
+let message "Use `forward` instead of `fwd`"
+let description "Expands the abbreviation `fwd` to the full word `forward` for clarity."
+let kind "Style"
+let becomes "forward"
+
+test "Now I look fwd to the interior, the color, etc." "Now I look forward to the interior, the color, etc."
diff --git a/harper-core/src/linting/weir_rules/ExpandMinimum.weir b/harper-core/src/linting/weir_rules/ExpandMinimum.weir
new file mode 100644
index 000000000..c69fd4ed3
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ExpandMinimum.weir
@@ -0,0 +1,7 @@
+expr main (min)
+
+let message "Use `minimum` instead of `min`"
+let description "Expands the abbreviation `min` to the full word `minimum` for clarity."
+let kind "Style"
+let becomes "minimum"
+
diff --git a/harper-core/src/linting/weir_rules/ExpandWith.weir b/harper-core/src/linting/weir_rules/ExpandWith.weir
new file mode 100644
index 000000000..5fe7dbcd7
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ExpandWith.weir
@@ -0,0 +1,7 @@
+expr main (w/)
+
+let message "Use `with` instead of `w/`"
+let description "Expands the abbreviation `w/` to the full word `with` for clarity."
+let kind "Style"
+let becomes "with"
+
diff --git a/harper-core/src/linting/weir_rules/ExpandWithout.weir b/harper-core/src/linting/weir_rules/ExpandWithout.weir
new file mode 100644
index 000000000..92cd56d59
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ExpandWithout.weir
@@ -0,0 +1,12 @@
+expr main (w/o)
+
+let message "Use `without` instead of `w/o`"
+let description "Expands the abbreviation `w/o` to the full word `without` for clarity."
+let kind "Style"
+let becomes "without"
+
+test "She lacks w/o experience." "She lacks without experience."
+test "He has w/o skills w/o knowledge." "He has without skills without knowledge."
+test "The report includes w/o details." "The report includes without details."
+test "She works with out effort." "She works with out effort."
+test "She’s w/o a plan." "She’s without a plan."
diff --git a/harper-core/src/linting/weir_rules/FaceFirst.weir b/harper-core/src/linting/weir_rules/FaceFirst.weir
new file mode 100644
index 000000000..5c18c551c
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/FaceFirst.weir
@@ -0,0 +1,7 @@
+expr main (face first into)
+
+let message "Should this be `face-first`?"
+let description "Ensures `face first` is correctly hyphenated as `face-first` when used before `into`."
+let kind "Punctuation"
+let becomes "face-first into"
+
diff --git a/harper-core/src/linting/weir_rules/FairBit.weir b/harper-core/src/linting/weir_rules/FairBit.weir
new file mode 100644
index 000000000..f1f1ad8ad
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/FairBit.weir
@@ -0,0 +1,8 @@
+expr main (fare bit)
+
+let message "A `decent amount` is a `fair bit`. `Fare` is the price of a ticket."
+let description "Corrects malapropisms of `a fair bit`."
+let kind "Eggcorn"
+let becomes "fair bit"
+
+test "I've read through a fare bit of the ecosystem framework, but I am not clear on what is modified..." "I've read through a fair bit of the ecosystem framework, but I am not clear on what is modified..."
diff --git a/harper-core/src/linting/weir_rules/FarAndFewBetween.weir b/harper-core/src/linting/weir_rules/FarAndFewBetween.weir
new file mode 100644
index 000000000..3b670592e
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/FarAndFewBetween.weir
@@ -0,0 +1,8 @@
+expr main (far and few between)
+
+let message "The correct idiom is `few and far between`?"
+let description "Corrects `far and few between` to the standard idiom `few and far between`."
+let kind "Eggcorn"
+let becomes "few and far between"
+
+test "Their neighbors were far and few between, which only made it even more unlikely that surveillance footage recovered from their properties could help." "Their neighbors were few and far between, which only made it even more unlikely that surveillance footage recovered from their properties could help."
diff --git a/harper-core/src/linting/weir_rules/FastPaste.weir b/harper-core/src/linting/weir_rules/FastPaste.weir
new file mode 100644
index 000000000..994e13551
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/FastPaste.weir
@@ -0,0 +1,7 @@
+expr main [(fast paste), (fast-paste)]
+
+let message "Did you mean `fast-paced`?"
+let description "Detects incorrect usage of `fast paste` or `fast-paste` and suggests `fast-paced` as the correct phrase."
+let kind "Eggcorn"
+let becomes "fast-paced"
+
diff --git a/harper-core/src/linting/weir_rules/FatalOutcome.weir b/harper-core/src/linting/weir_rules/FatalOutcome.weir
new file mode 100644
index 000000000..83137b2b4
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/FatalOutcome.weir
@@ -0,0 +1,7 @@
+expr main (fatal outcome)
+
+let message "Consider using `death` for clarity."
+let description "Replaces `fatal outcome` with the more direct term `death` for conciseness."
+let kind "Style"
+let becomes "death"
+
diff --git a/harper-core/src/linting/weir_rules/FetalPosition.weir b/harper-core/src/linting/weir_rules/FetalPosition.weir
new file mode 100644
index 000000000..3807147fe
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/FetalPosition.weir
@@ -0,0 +1,7 @@
+expr main (the feeble position)
+
+let message "Use the correct term for a curled-up posture."
+let description "Ensures the correct use of `fetal position`, avoiding confusion with `feeble position`, which is not a standard phrase."
+let kind "Malapropism"
+let becomes "the fetal position"
+
diff --git a/harper-core/src/linting/weir_rules/ForALongTime.weir b/harper-core/src/linting/weir_rules/ForALongTime.weir
new file mode 100644
index 000000000..d5fae258f
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ForALongTime.weir
@@ -0,0 +1,8 @@
+expr main (for along time)
+
+let message "Use the standard phrase `for a long time` to indicate an extended duration."
+let description "Eliminates the incorrect merging in `for along time`."
+let kind "Grammar"
+let becomes "for a long time"
+
+test "I was stuck there for along time." "I was stuck there for a long time."
diff --git a/harper-core/src/linting/weir_rules/ForAWhile.weir b/harper-core/src/linting/weir_rules/ForAWhile.weir
new file mode 100644
index 000000000..9445aa0ff
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ForAWhile.weir
@@ -0,0 +1,8 @@
+expr main (for while)
+
+let message "When describing a timeframe, use `a while`."
+let description "Corrects the missing article in `for while`, forming `for a while`."
+let kind "Typo"
+let becomes "for a while"
+
+test "Build flutter releases in github actions for production only android for while." "Build flutter releases in github actions for production only android for a while."
diff --git a/harper-core/src/linting/weir_rules/FreeRein.weir b/harper-core/src/linting/weir_rules/FreeRein.weir
new file mode 100644
index 000000000..84200c2c6
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/FreeRein.weir
@@ -0,0 +1,7 @@
+expr main (free reign)
+
+let message "Use the correct phrase for unrestricted control."
+let description "Ensures the correct use of `free rein`, avoiding confusion with `free reign`, which incorrectly suggests authority rather than freedom of action."
+let kind "Eggcorn"
+let becomes "free rein"
+
diff --git a/harper-core/src/linting/weir_rules/Freezing.weir b/harper-core/src/linting/weir_rules/Freezing.weir
new file mode 100644
index 000000000..f64272b06
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/Freezing.weir
@@ -0,0 +1,7 @@
+expr main [(very cold), (really cold), (extremely cold)]
+
+let message "A more vivid adjective would better capture extreme cold."
+let description "Encourages vivid writing by suggesting `freezing` instead of weaker expressions like `very cold.`"
+let kind "Enhancement"
+let becomes "freezing"
+
diff --git a/harper-core/src/linting/weir_rules/FromTheGetGo.weir b/harper-core/src/linting/weir_rules/FromTheGetGo.weir
new file mode 100644
index 000000000..8c56eefae
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/FromTheGetGo.weir
@@ -0,0 +1,7 @@
+expr main (from the get go)
+
+let message "Use the hyphenated form: `from the get-go`."
+let description "Ensures `from the get-go` is correctly hyphenated, preserving the idiom’s meaning of ‘from the very beginning’."
+let kind "Punctuation"
+let becomes "from the get-go"
+
diff --git a/harper-core/src/linting/weir_rules/GildedAge.weir b/harper-core/src/linting/weir_rules/GildedAge.weir
new file mode 100644
index 000000000..0daa06a08
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/GildedAge.weir
@@ -0,0 +1,10 @@
+expr main (guilded age)
+
+let message "The period of economic prosperity is called the `Gilded Age`."
+let description "If referring to the period of economic prosperity, the correct term is `Gilded Age`."
+let kind "Eggcorn"
+let becomes "Gilded Age"
+let strategy "Exact"
+
+test "It is especially a reflection of the socio-economic patterns in the Guilded Age." "It is especially a reflection of the socio-economic patterns in the Gilded Age."
+test "It is especially a reflection of the socio-economic patterns in the guilded age." "It is especially a reflection of the socio-economic patterns in the Gilded Age."
diff --git a/harper-core/src/linting/weir_rules/GoingTo.weir b/harper-core/src/linting/weir_rules/GoingTo.weir
new file mode 100644
index 000000000..545308274
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/GoingTo.weir
@@ -0,0 +1,7 @@
+expr main (gong to)
+
+let message "Did you mean `going to`?"
+let description "Corrects `gong to` to the intended phrase `going to`."
+let kind "Typo"
+let becomes "going to"
+
diff --git a/harper-core/src/linting/weir_rules/GuineaBissau.weir b/harper-core/src/linting/weir_rules/GuineaBissau.weir
new file mode 100644
index 000000000..b9926388d
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/GuineaBissau.weir
@@ -0,0 +1,8 @@
+expr main (Guinea Bissau)
+
+let message "The official spelling is hyphenated."
+let description "Checks for the correct official name of the African country."
+let kind "Punctuation"
+let becomes "Guinea-Bissau"
+
+test "Guinea Bissau" "Guinea-Bissau"
diff --git a/harper-core/src/linting/weir_rules/HadOf.weir b/harper-core/src/linting/weir_rules/HadOf.weir
new file mode 100644
index 000000000..05a8cdcce
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/HadOf.weir
@@ -0,0 +1,7 @@
+expr main (had of)
+
+let message "Did you mean `had have` or `had've`?"
+let description "Flags the unnecessary use of `of` after `had` and suggests the correct forms."
+let kind "Grammar"
+let becomes ["had have", "had've"]
+
diff --git a/harper-core/src/linting/weir_rules/HalfAnHour.weir b/harper-core/src/linting/weir_rules/HalfAnHour.weir
new file mode 100644
index 000000000..c2da3eeac
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/HalfAnHour.weir
@@ -0,0 +1,8 @@
+expr main (half an our)
+
+let message "Remember the silent 'h' when writing `hour`: `half an hour`."
+let description "Fixes the eggcorn `half an our` to the accepted `half an hour`."
+let kind "Typo"
+let becomes "half an hour"
+
+test "It took half an our to get there." "It took half an hour to get there."
diff --git a/harper-core/src/linting/weir_rules/Haphazard.weir b/harper-core/src/linting/weir_rules/Haphazard.weir
new file mode 100644
index 000000000..6ca1de37a
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/Haphazard.weir
@@ -0,0 +1,7 @@
+expr main [(half hazard), (half-hazard), (halfhazard)]
+
+let message "Use `haphazard` for randomness or lack of organization."
+let description "Corrects the eggcorn `half hazard` to `haphazard`, which properly means lacking organization or being random."
+let kind "Eggcorn"
+let becomes "haphazard"
+
diff --git a/harper-core/src/linting/weir_rules/HumanBeings.weir b/harper-core/src/linting/weir_rules/HumanBeings.weir
new file mode 100644
index 000000000..45cc1865b
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/HumanBeings.weir
@@ -0,0 +1,9 @@
+expr main [(human's beings), (humans beings)]
+
+let message "Use `human beings` to refer to people collectively."
+let description "Eliminates the incorrect possessive/plural usage like `human's beings` or `humans beings`."
+let kind "Grammar"
+let becomes "human beings"
+
+test "All humans beings deserve empathy." "All human beings deserve empathy."
+test "We should respect a human's beings fundamental rights." "We should respect a human beings fundamental rights."
diff --git a/harper-core/src/linting/weir_rules/HumanLife.weir b/harper-core/src/linting/weir_rules/HumanLife.weir
new file mode 100644
index 000000000..bcad5d880
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/HumanLife.weir
@@ -0,0 +1,7 @@
+expr main (human live)
+
+let message "Did you mean `human life`?"
+let description "Changes `human live` to `human life`."
+let kind "Typo"
+let becomes "human life"
+
diff --git a/harper-core/src/linting/weir_rules/HungerPang.weir b/harper-core/src/linting/weir_rules/HungerPang.weir
new file mode 100644
index 000000000..10cd2f358
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/HungerPang.weir
@@ -0,0 +1,8 @@
+expr main (hunger pain)
+
+let message "Did you mean `hunger pang`?"
+let description "Corrects `hunger pain` to `hunger pang`."
+let kind "Eggcorn"
+let becomes "hunger pang"
+
+test "hunger pain" "hunger pang"
diff --git a/harper-core/src/linting/weir_rules/IAm.weir b/harper-core/src/linting/weir_rules/IAm.weir
new file mode 100644
index 000000000..a479591a1
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/IAm.weir
@@ -0,0 +1,7 @@
+expr main (I a m)
+
+let message "Did you mean `I am`?"
+let description "Fixes the incorrect spacing in `I a m` to properly form `I am`."
+let kind "Typo"
+let becomes "I am"
+
diff --git a/harper-core/src/linting/weir_rules/IDo.weir b/harper-core/src/linting/weir_rules/IDo.weir
new file mode 100644
index 000000000..071ccdbbf
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/IDo.weir
@@ -0,0 +1,8 @@
+expr main (I does)
+
+let message "`I` pairs with the bare verb `do`; the –s inflection `does` is reserved for third-person singular subjects."
+let description "Corrects `I does` to `I do`."
+let kind "Agreement"
+let becomes "I do"
+
+test "I does enjoy writing Rust." "I do enjoy writing Rust."
diff --git a/harper-core/src/linting/weir_rules/InAWhile.weir b/harper-core/src/linting/weir_rules/InAWhile.weir
new file mode 100644
index 000000000..e51d8daac
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/InAWhile.weir
@@ -0,0 +1,8 @@
+expr main (in while)
+
+let message "When describing a timeframe, use `a while`."
+let description "Corrects the missing article in `in while`, forming `in a while`."
+let kind "Grammar"
+let becomes "in a while"
+
+test "We’ll talk again in while." "We’ll talk again in a while."
diff --git a/harper-core/src/linting/weir_rules/InAnyWay.weir b/harper-core/src/linting/weir_rules/InAnyWay.weir
new file mode 100644
index 000000000..74a60f26d
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/InAnyWay.weir
@@ -0,0 +1,9 @@
+expr main (in anyway)
+
+let message "Use `in any way` for emphasizing a point."
+let description "Corrects ungrammatical `in anyway` to `in any way`."
+let kind "BoundaryError"
+let becomes "in any way"
+
+test "in anyway" "in any way"
+test "The names should not affect your application in anyway and you can override extension names." "The names should not affect your application in any way and you can override extension names."
diff --git a/harper-core/src/linting/weir_rules/InLieuOf.weir b/harper-core/src/linting/weir_rules/InLieuOf.weir
new file mode 100644
index 000000000..bcb113ead
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/InLieuOf.weir
@@ -0,0 +1,8 @@
+expr main (in lue of)
+
+let message "Did you mean `in lieu of`?"
+let description "Corrects the misspelling `in lue of` to `in lieu of`."
+let kind "Spelling"
+let becomes "in lieu of"
+
+test "Controller Emulation in lue of Direct Controller binding" "Controller Emulation in lieu of Direct Controller binding"
diff --git a/harper-core/src/linting/weir_rules/InNeedOf.weir b/harper-core/src/linting/weir_rules/InNeedOf.weir
new file mode 100644
index 000000000..a68f03dee
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/InNeedOf.weir
@@ -0,0 +1,8 @@
+expr main (in need for)
+
+let message "Use `in need of` for when something is required or necessary."
+let description "Corrects `in need for` to `in need of`."
+let kind "Usage"
+let becomes "in need of"
+
+test "In need for a native control for map symbols (map legend) #5203." "In need of a native control for map symbols (map legend) #5203."
diff --git a/harper-core/src/linting/weir_rules/InOfItself.weir b/harper-core/src/linting/weir_rules/InOfItself.weir
new file mode 100644
index 000000000..8f2fd759a
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/InOfItself.weir
@@ -0,0 +1,9 @@
+expr main (in of itself)
+
+let message "Use `in itself` (more common) or `in and of itself` (more formal) to mean 'intrinsically'."
+let description "Corrects nonstandard `in of itself` to standard `in itself` or `in and of itself`."
+let kind "Usage"
+let becomes ["in itself", "in and of itself"]
+
+test "in of itself" "in and of itself"
+test "This is not entirely unexpected in of itself, as Git and GitHub Desktop both generally prove fairly bad at delineating context intelligently..." "This is not entirely unexpected in and of itself, as Git and GitHub Desktop both generally prove fairly bad at delineating context intelligently..."
diff --git a/harper-core/src/linting/weir_rules/InOneFellSwoop.weir b/harper-core/src/linting/weir_rules/InOneFellSwoop.weir
new file mode 100644
index 000000000..71ea3d7e7
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/InOneFellSwoop.weir
@@ -0,0 +1,7 @@
+expr main (in one foul swoop)
+
+let message "Use the correct phrase for something happening suddenly."
+let description "Corrects `in one foul swoop` to `in one fell swoop`, preserving the phrase’s original meaning of sudden and complete action."
+let kind "Eggcorn"
+let becomes "in one fell swoop"
+
diff --git a/harper-core/src/linting/weir_rules/InThe.weir b/harper-core/src/linting/weir_rules/InThe.weir
new file mode 100644
index 000000000..69ecc1e66
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/InThe.weir
@@ -0,0 +1,7 @@
+expr main (int he)
+
+let message "Did you mean `in the`?"
+let description "Detects and corrects a spacing error where `in the` is mistakenly written as `int he`. Proper spacing is essential for readability and grammatical correctness in common phrases."
+let kind "Typo"
+let becomes "in the"
+
diff --git a/harper-core/src/linting/weir_rules/Initiatively.weir b/harper-core/src/linting/weir_rules/Initiatively.weir
new file mode 100644
index 000000000..8c91b502b
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/Initiatively.weir
@@ -0,0 +1,8 @@
+expr main initiatively
+
+let message "Did you mean `proactive` (taking initiative, acting in advance) or `initially` (at first, in the beginning)?"
+let description "Corrects nonstandard `initiatively`."
+let kind "Nonstandard"
+let becomes ["proactively", "initially"]
+
+test "I have initiatively signed up for the course." "I have proactively signed up for the course."
diff --git a/harper-core/src/linting/weir_rules/Insensitive.weir b/harper-core/src/linting/weir_rules/Insensitive.weir
new file mode 100644
index 000000000..95ae8d72e
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/Insensitive.weir
@@ -0,0 +1,8 @@
+expr main (unsensitive)
+
+let message "This word has a more standard, more common synonym."
+let description "Suggests the more standard and common synonym `insensitive`."
+let kind "WordChoice"
+let becomes "insensitive"
+
+test "We want to potentially make an unsensitive header" "We want to potentially make an insensitive header"
diff --git a/harper-core/src/linting/weir_rules/InsteadOf.weir b/harper-core/src/linting/weir_rules/InsteadOf.weir
new file mode 100644
index 000000000..37b3a2c44
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/InsteadOf.weir
@@ -0,0 +1,9 @@
+expr main (in stead of)
+
+let message "Use the modern single word `instead of` to indicate a replacement."
+let description "Corrects the archaic or mistaken separation `in stead of` to `instead of` in everyday usage."
+let kind "BoundaryError"
+let becomes "instead of"
+
+test "He used water in stead of soda." "He used water instead of soda."
+test "He used water instead of soda." "He used water instead of soda."
diff --git a/harper-core/src/linting/weir_rules/Insurmountable.weir b/harper-core/src/linting/weir_rules/Insurmountable.weir
new file mode 100644
index 000000000..61ba6b3dd
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/Insurmountable.weir
@@ -0,0 +1,8 @@
+expr main (unsurmountable)
+
+let message "This word has a more standard, more common synonym."
+let description "Suggests the more standard and common synonym `insurmountable`."
+let kind "WordChoice"
+let becomes "insurmountable"
+
+test "That being said, if you find upgrading to newer versions to be unsurmountable, please open an issue." "That being said, if you find upgrading to newer versions to be insurmountable, please open an issue."
diff --git a/harper-core/src/linting/weir_rules/Intact.weir b/harper-core/src/linting/weir_rules/Intact.weir
new file mode 100644
index 000000000..c50682ffb
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/Intact.weir
@@ -0,0 +1,9 @@
+expr main (in tact)
+
+let message "Use `intact` to mean undamaged or whole."
+let description "Prevents the erroneous spacing in `in tact`; `intact` is the single correct word."
+let kind "BoundaryError"
+let becomes "intact"
+
+test "The code remains in tact after the merge." "The code remains intact after the merge."
+test "The data set remains intact." "The data set remains intact."
diff --git a/harper-core/src/linting/weir_rules/IsKnownFor.weir b/harper-core/src/linting/weir_rules/IsKnownFor.weir
new file mode 100644
index 000000000..c872cd937
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/IsKnownFor.weir
@@ -0,0 +1,7 @@
+expr main (is know for)
+
+let message "Did you mean `is known for`?"
+let description "Typo: `known` is the correct past participle."
+let kind "Typo"
+let becomes "is known for"
+
diff --git a/harper-core/src/linting/weir_rules/ItCan.weir b/harper-core/src/linting/weir_rules/ItCan.weir
new file mode 100644
index 000000000..5574c77e2
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ItCan.weir
@@ -0,0 +1,7 @@
+expr main (It cam)
+
+let message "Did you mean `It can`?"
+let description "Corrects the misspelling `It cam` to the proper phrase `It can`."
+let kind "Typo"
+let becomes "It can"
+
diff --git a/harper-core/src/linting/weir_rules/IveGotTo.weir b/harper-core/src/linting/weir_rules/IveGotTo.weir
new file mode 100644
index 000000000..2ce9faf80
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/IveGotTo.weir
@@ -0,0 +1,8 @@
+expr main (I've go to)
+
+let message "Use `I've got to` for necessity or obligation."
+let description "Corrects the slip `I've go to` to the idiomatic `I've got to`."
+let kind "Typo"
+let becomes "I've got to"
+
+test "I've go to finish this before Monday." "I've got to finish this before Monday."
diff --git a/harper-core/src/linting/weir_rules/JawDropping.weir b/harper-core/src/linting/weir_rules/JawDropping.weir
new file mode 100644
index 000000000..fb11bfc0a
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/JawDropping.weir
@@ -0,0 +1,7 @@
+expr main (jar-dropping)
+
+let message "Use the correct phrase for something astonishing."
+let description "Corrects `jar-dropping` to `jaw-dropping`, ensuring the intended meaning of something that causes amazement."
+let kind "Eggcorn"
+let becomes "jaw-dropping"
+
diff --git a/harper-core/src/linting/weir_rules/JustDeserts.weir b/harper-core/src/linting/weir_rules/JustDeserts.weir
new file mode 100644
index 000000000..99d0c3203
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/JustDeserts.weir
@@ -0,0 +1,7 @@
+expr main (just desserts)
+
+let message "Use the correct phrase for receiving what one deserves."
+let description "Ensures `just deserts` is used correctly, preserving its meaning of receiving an appropriate outcome for one's actions."
+let kind "Spelling"
+let becomes "just deserts"
+
diff --git a/harper-core/src/linting/weir_rules/KindOf.weir b/harper-core/src/linting/weir_rules/KindOf.weir
new file mode 100644
index 000000000..8bbc6a684
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/KindOf.weir
@@ -0,0 +1,8 @@
+expr main (kinda of)
+
+let message "`Kinda` already means `kind of`, so `kinda of` is redundant."
+let description "Corrects `kinda of` to `kind of`."
+let kind "Redundancy"
+let becomes ["kind of", "kinda"]
+
+test "Some kinda of Sync issue only with 0.79.1" "Some kind of Sync issue only with 0.79.1"
diff --git a/harper-core/src/linting/weir_rules/KindRegards.weir b/harper-core/src/linting/weir_rules/KindRegards.weir
new file mode 100644
index 000000000..d17973101
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/KindRegards.weir
@@ -0,0 +1,7 @@
+expr main (kid regards)
+
+let message "Did you mean `kind regards`?"
+let description "Changes `kid regards` to `kind regards`."
+let kind "Typo"
+let becomes "kind regards"
+
diff --git a/harper-core/src/linting/weir_rules/LastButNotLeast.weir b/harper-core/src/linting/weir_rules/LastButNotLeast.weir
new file mode 100644
index 000000000..e05ed6dc6
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/LastButNotLeast.weir
@@ -0,0 +1,9 @@
+expr main [(last but not the least), (last, but not the least), (last but, not least), (last but not last)]
+
+let message "Use the more idiomatic phrasing."
+let description "Corrects common errors in the phrase `last but not least`."
+let kind "Usage"
+let becomes "last but not least"
+
+test "Last but not the least, with VS2013 you can use Web Essentials 2013" "Last but not least, with VS2013 you can use Web Essentials 2013"
+test "Last but not last, I'd like to thank my parents." "Last but not least, I'd like to thank my parents."
diff --git a/harper-core/src/linting/weir_rules/LastDitch.weir b/harper-core/src/linting/weir_rules/LastDitch.weir
new file mode 100644
index 000000000..548cba41e
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/LastDitch.weir
@@ -0,0 +1,9 @@
+expr main [(last ditch), (last ditched), (last-ditched)]
+
+let message "In this idiom, `ditch` is a noun and a hyphen is needed."
+let description "Corrects wrong variations of the idiomatic adjective `last-ditch`."
+let kind "Usage"
+let becomes "last-ditch"
+
+test "I was actually just trying that as a last ditched attempt to get it working, previously those ..." "I was actually just trying that as a last-ditch attempt to get it working, previously those ..."
+test "There are unique use cases and is meant to be a last ditch option." "There are unique use cases and is meant to be a last-ditch option."
diff --git a/harper-core/src/linting/weir_rules/LastNight.weir b/harper-core/src/linting/weir_rules/LastNight.weir
new file mode 100644
index 000000000..72ff2a0c4
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/LastNight.weir
@@ -0,0 +1,12 @@
+expr main (yesterday night)
+
+let message "The idiomatic phrase is `last night`."
+let description "Flags `yesterday night` and suggests the standard phrasing `last night`."
+let kind "WordChoice"
+let becomes "last night"
+
+test "I was there yesterday night." "I was there last night."
+test "Yesterday night was fun." "Last night was fun."
+test "Yesterday night, we watched a movie." "Last night, we watched a movie."
+test "They left yesterday night after the show." "They left last night after the show."
+test "I remember last night clearly." "I remember last night clearly."
diff --git a/harper-core/src/linting/weir_rules/LetAlone.weir b/harper-core/src/linting/weir_rules/LetAlone.weir
new file mode 100644
index 000000000..a9fdbeef7
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/LetAlone.weir
@@ -0,0 +1,8 @@
+expr main (let along)
+
+let message "Did you mean `let alone`?"
+let description "Changes `let along` to `let alone`."
+let kind "Typo"
+let becomes "let alone"
+
+test "let along" "let alone"
diff --git a/harper-core/src/linting/weir_rules/LikeAsIf.weir b/harper-core/src/linting/weir_rules/LikeAsIf.weir
new file mode 100644
index 000000000..e610ab90a
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/LikeAsIf.weir
@@ -0,0 +1,12 @@
+expr main (like as if)
+
+let message "Avoid redundancy. Use either `like` or `as if`."
+let description "Corrects redundant `like as if` to `like` or `as if`."
+let becomes ["like", "as if"]
+
+test "And looks like as if linux-personality hasn't got any changes for 8 years." "And looks as if linux-personality hasn't got any changes for 8 years."
+test "She looks like as if she’s tired." "She looks as if she’s tired."
+test "He seems like as if he’s happy." "He seems as if he’s happy."
+test "It feels like as if it’s a dream." "It feels as if it’s a dream."
+test "She acts like a hero." "She acts like a hero."
+test "She seems like as if she’s in love." "She seems as if she’s in love."
diff --git a/harper-core/src/linting/weir_rules/LikeThePlague.weir b/harper-core/src/linting/weir_rules/LikeThePlague.weir
new file mode 100644
index 000000000..f49a80ab1
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/LikeThePlague.weir
@@ -0,0 +1,8 @@
+expr main (like a plague)
+
+let message "`Things are avoided `like the plague` not `like a plague`."
+let description "Corrects `like a plague` to `like the plague`."
+let kind "Usage"
+let becomes "like the plague"
+
+test "Below is the worst example of them all (avoid such coding like a plague):" "Below is the worst example of them all (avoid such coding like the plague):"
diff --git a/harper-core/src/linting/weir_rules/LinesOfCode.weir b/harper-core/src/linting/weir_rules/LinesOfCode.weir
new file mode 100644
index 000000000..6a69c9138
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/LinesOfCode.weir
@@ -0,0 +1,9 @@
+expr main [(line of codes), (lines of codes)]
+
+let message "The correct plural is `lines of code`."
+let description "Corrects pluralizing the wrong noun in `lines of code`."
+let kind "Usage"
+let becomes "lines of code"
+
+test "These are line of codes we should refactor." "These are lines of code we should refactor."
+test "We removed several lines of codes yesterday." "We removed several lines of code yesterday."
diff --git a/harper-core/src/linting/weir_rules/LowHangingFruit.weir b/harper-core/src/linting/weir_rules/LowHangingFruit.weir
new file mode 100644
index 000000000..72ac62f28
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/LowHangingFruit.weir
@@ -0,0 +1,10 @@
+expr main [(low[-, ( )]hanging fruits), (low hanging fruit)]
+
+let message "The standard form is `low-hanging fruit` with a hyphen and singular form."
+let description "Corrects nonstandard variants of `low-hanging fruit`."
+let kind "Usage"
+let becomes "low-hanging fruit"
+
+test "If you add me as a collaborator i can start merging some of the low hanging fruit." "If you add me as a collaborator i can start merging some of the low-hanging fruit."
+test "Field guide to gather low-hanging fruits." "Field guide to gather low-hanging fruit."
+test "Will search for low hanging fruits and useful information for escalation on a compromised workstation." "Will search for low-hanging fruit and useful information for escalation on a compromised workstation."
diff --git a/harper-core/src/linting/weir_rules/ManagerialReins.weir b/harper-core/src/linting/weir_rules/ManagerialReins.weir
new file mode 100644
index 000000000..fc2692b73
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ManagerialReins.weir
@@ -0,0 +1,17 @@
+expr main (managerial reigns)
+
+let message "Swap in `reins` when talking about control of a team or project."
+let description "Corrects the eggcorn `managerial reigns` to the idiomatic `managerial reins`."
+let kind "Eggcorn"
+let becomes "managerial reins"
+
+test "She grabbed the managerial reigns during the crisis." "She grabbed the managerial reins during the crisis."
+test "Managerial reigns are never easy to hand over." "Managerial reins are never easy to hand over."
+test "The managerial reigns belong to Carla now." "The managerial reins belong to Carla now."
+test "By winter, he held the managerial reigns, and morale improved." "By winter, he held the managerial reins, and morale improved."
+test "Who will hold the managerial reigns after April?" "Who will hold the managerial reins after April?"
+test "\"managerial reigns\" showed up in the draft notes." "\"managerial reins\" showed up in the draft notes."
+test "He kept the managerial reins despite the reshuffle." "He kept the managerial reins despite the reshuffle."
+test "Legends of ancient reigns filled the museum." "Legends of ancient reigns filled the museum."
+test "They debated who should manage the managerial reigns for the quarter." "They debated who should manage the managerial reins for the quarter."
+test "Their memo shouted MANAGERIAL REIGNS." "Their memo shouted MANAGERIAL REINS."
diff --git a/harper-core/src/linting/weir_rules/Monumentous.weir b/harper-core/src/linting/weir_rules/Monumentous.weir
new file mode 100644
index 000000000..4707fefe7
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/Monumentous.weir
@@ -0,0 +1,9 @@
+expr main (monumentous)
+
+let message "Retain `monumentous` for jocular effect. Otherwise `momentous` indicates great signifcance while `monumental` indicates imposing size."
+let description "Advises using `momentous` or `monumental` instead of `monumentous` for serious usage."
+let kind "Nonstandard"
+let becomes ["momentous", "monumental"]
+
+test "monumentous" "momentous"
+test "I think that would be a monumentous step in the right direction, and would DEFINATLY turn heads in not just the music industry, but every ..." "I think that would be a momentous step in the right direction, and would DEFINATLY turn heads in not just the music industry, but every ..."
diff --git a/harper-core/src/linting/weir_rules/MyHouse.weir b/harper-core/src/linting/weir_rules/MyHouse.weir
new file mode 100644
index 000000000..ba6288272
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/MyHouse.weir
@@ -0,0 +1,7 @@
+expr main (mu house)
+
+let message "Did you mean `my house`?"
+let description "Fixes the typo `mu house` to `my house`."
+let kind "Typo"
+let becomes "my house"
+
diff --git a/harper-core/src/linting/weir_rules/NeedHelp.weir b/harper-core/src/linting/weir_rules/NeedHelp.weir
new file mode 100644
index 000000000..6cab117ad
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/NeedHelp.weir
@@ -0,0 +1,7 @@
+expr main (ned help)
+
+let message "Did you mean `need help`?"
+let description "Changes `ned help` to the correct `need help`."
+let kind "Typo"
+let becomes "need help"
+
diff --git a/harper-core/src/linting/weir_rules/NerveRacking.weir b/harper-core/src/linting/weir_rules/NerveRacking.weir
new file mode 100644
index 000000000..ec4a1e08b
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/NerveRacking.weir
@@ -0,0 +1,12 @@
+expr main [(nerve racking), (nerve wracking), (nerve wrecking), (nerve-wracking), (nerve-wrecking)]
+
+let message "Use `nerve-racking` for something that causes anxiety or tension."
+let description "Corrects common misspellings and missing hyphen in `nerve-racking`."
+let kind "Eggcorn"
+let becomes "nerve-racking"
+
+test "We've gone through several major changes / upgrades to atlantis, and it's always a little bit nerve-wracking because if we mess something up we ..." "We've gone through several major changes / upgrades to atlantis, and it's always a little bit nerve-racking because if we mess something up we ..."
+test "The issue happens to me on a daily basis, and it is nerve-wrecking because I become unsure if I have actually saved the diagram, but every time ..." "The issue happens to me on a daily basis, and it is nerve-racking because I become unsure if I have actually saved the diagram, but every time ..."
+test "Very nerve wracking landing in an unfamiliar mountainous airport in dead of night with no radar to show surrounding terrain." "Very nerve-racking landing in an unfamiliar mountainous airport in dead of night with no radar to show surrounding terrain."
+test "I appreciate any kind of help since this is kind of nerve wrecking." "I appreciate any kind of help since this is kind of nerve-racking."
+test "It's nerve racking to think about it because I have code inside the callback that resolves the member and somehow I feel like it's so .." "It's nerve-racking to think about it because I have code inside the callback that resolves the member and somehow I feel like it's so .."
diff --git a/harper-core/src/linting/weir_rules/NotIn.weir b/harper-core/src/linting/weir_rules/NotIn.weir
new file mode 100644
index 000000000..0fbf1fc62
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/NotIn.weir
@@ -0,0 +1,7 @@
+expr main (no in)
+
+let message "Use `not in` for correct grammar."
+let description "Replaces `no in` with `not in`."
+let kind "Typo"
+let becomes "not in"
+
diff --git a/harper-core/src/linting/weir_rules/NotTo.weir b/harper-core/src/linting/weir_rules/NotTo.weir
new file mode 100644
index 000000000..646ab9641
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/NotTo.weir
@@ -0,0 +1,7 @@
+expr main (no to)
+
+let message "Did you mean `not to`?"
+let description "Corrects `no to` to `not to`, ensuring proper negation."
+let kind "Typo"
+let becomes "not to"
+
diff --git a/harper-core/src/linting/weir_rules/OfCourse.weir b/harper-core/src/linting/weir_rules/OfCourse.weir
new file mode 100644
index 000000000..a0018d01a
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/OfCourse.weir
@@ -0,0 +1,10 @@
+expr main [(off course), (o course), (ofcourse)]
+
+let message "Did you mean `of course`?"
+let description "Detects the common mistake `off course` and suggests the correct form `of course`."
+let kind "Eggcorn"
+let becomes "of course"
+
+test "Yes, off course we should do that." "Yes, of course we should do that."
+test "Yes, o course we should do that." "Yes, of course we should do that."
+test "Ofcourse, I like other languages.. uzulla has 183 repositories available." "Of course, I like other languages.. uzulla has 183 repositories available."
diff --git a/harper-core/src/linting/weir_rules/OffTheCuff.weir b/harper-core/src/linting/weir_rules/OffTheCuff.weir
new file mode 100644
index 000000000..0e1e0d319
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/OffTheCuff.weir
@@ -0,0 +1,7 @@
+expr main (off the cuff)
+
+let message "Use the hyphenated form for `off-the-cuff`."
+let description "Ensures `off-the-cuff` is correctly hyphenated."
+let kind "Punctuation"
+let becomes "off-the-cuff"
+
diff --git a/harper-core/src/linting/weir_rules/OldWivesTale.weir b/harper-core/src/linting/weir_rules/OldWivesTale.weir
new file mode 100644
index 000000000..abdeec7ca
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/OldWivesTale.weir
@@ -0,0 +1,7 @@
+expr main (old wise tale)
+
+let message "Use the correct phrase for a superstition or myth."
+let description "Corrects `old wise tale` to `old wives' tale`, preserving the phrase’s meaning as an unfounded traditional belief."
+let kind "Eggcorn"
+let becomes "old wives' tale"
+
diff --git a/harper-core/src/linting/weir_rules/OnSecondThought.weir b/harper-core/src/linting/weir_rules/OnSecondThought.weir
new file mode 100644
index 000000000..67ac9654b
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/OnSecondThought.weir
@@ -0,0 +1,10 @@
+expr main <([on, my] second though), (second though)>
+
+let message "Idiomatic expression: use `on second thought` instead of `on second though`"
+let description "Replaces the nonstandard `on second though` with the common idiom `on second thought` to indicate reconsideration."
+let kind "Typo"
+let becomes "second thought"
+
+test "I was going to buy it, but on second though, maybe I'll wait." "I was going to buy it, but on second thought, maybe I'll wait."
+test "She considered driving home, but on second thought, she decided to walk." "She considered driving home, but on second thought, she decided to walk."
+test "My second though is that I'd prefer something else entirely." "My second thought is that I'd prefer something else entirely."
diff --git a/harper-core/src/linting/weir_rules/OnTheSpurOfTheMoment.weir b/harper-core/src/linting/weir_rules/OnTheSpurOfTheMoment.weir
new file mode 100644
index 000000000..f37796519
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/OnTheSpurOfTheMoment.weir
@@ -0,0 +1,10 @@
+expr main [(on the spurt of the moment), (at the spur of the moment), (in the spur of the moment), (in the spurt of the moment)]
+
+let message "Use the correct phrase for acting spontaneously."
+let description "Ensures the correct use of `on the spur of the moment`, avoiding nonstandard variations."
+let kind "Eggcorn"
+let becomes "on the spur of the moment"
+
+test "Quite often in the spurt of the moment, someone will say something which they think is witty." "Quite often on the spur of the moment, someone will say something which they think is witty."
+test "but at the spur of the moment, I'd say that ansible-lint should work exactly like ansible" "but on the spur of the moment, I'd say that ansible-lint should work exactly like ansible"
+test "an assortment of things I started yesterday in the spur of the moment" "an assortment of things I started yesterday on the spur of the moment"
diff --git a/harper-core/src/linting/weir_rules/OnTopOf.weir b/harper-core/src/linting/weir_rules/OnTopOf.weir
new file mode 100644
index 000000000..72080dfc0
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/OnTopOf.weir
@@ -0,0 +1,8 @@
+expr main (ontop of)
+
+let message "Did you mean `on top of`?"
+let description "Corrects `ontop of` to `on top of`."
+let kind "BoundaryError"
+let becomes "on top of"
+
+test "Initcpio hooks for overlayfs ontop of root." "Initcpio hooks for overlayfs on top of root."
diff --git a/harper-core/src/linting/weir_rules/OnceInAWhile.weir b/harper-core/src/linting/weir_rules/OnceInAWhile.weir
new file mode 100644
index 000000000..b5fdedbe7
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/OnceInAWhile.weir
@@ -0,0 +1,9 @@
+expr main [(once a while), (once and a while)]
+
+let message "The correct idiom is `once in a while`."
+let description "Corrects two common malapropisms of `once in a while`."
+let kind "Usage"
+let becomes "once in a while"
+
+test "For me it is a SMB mount I have on the client device that I sync only once a while for a backup into the cloud." "For me it is a SMB mount I have on the client device that I sync only once in a while for a backup into the cloud."
+test "Every once and a while all the links on my page seem to stop working." "Every once in a while all the links on my page seem to stop working."
diff --git a/harper-core/src/linting/weir_rules/PartsOfSpeech.weir b/harper-core/src/linting/weir_rules/PartsOfSpeech.weir
new file mode 100644
index 000000000..5390d4c06
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/PartsOfSpeech.weir
@@ -0,0 +1,9 @@
+expr main [(part of speeches), (parts of speeches)]
+
+let message "The correct plural is `parts of speech`."
+let description "Corrects pluralizing the wrong noun in `part of speech`."
+let kind "Grammar"
+let becomes "parts of speech"
+
+test "Learning the part of speeches is important." "Learning the parts of speech is important."
+test "We studied parts of speeches yesterday." "We studied parts of speech yesterday."
diff --git a/harper-core/src/linting/weir_rules/PeaceOfMind.weir b/harper-core/src/linting/weir_rules/PeaceOfMind.weir
new file mode 100644
index 000000000..bc8f01edd
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/PeaceOfMind.weir
@@ -0,0 +1,8 @@
+expr main (piece of mind)
+
+let message "The phrase is `peace of mind`, meaning `calm`. A `piece` is a `part` of something."
+let description "Corrects `piece of mind` to `peace of mind`."
+let kind "Eggcorn"
+let becomes "peace of mind"
+
+test "A Discord bot that gives you piece of mind knowing you are free from obnoxious intrusions in a Discord Voice Channel" "A Discord bot that gives you peace of mind knowing you are free from obnoxious intrusions in a Discord Voice Channel"
diff --git a/harper-core/src/linting/weir_rules/PerSe.weir b/harper-core/src/linting/weir_rules/PerSe.weir
new file mode 100644
index 000000000..f6871fe05
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/PerSe.weir
@@ -0,0 +1,10 @@
+expr main [(per say), (per-se), (per-say)]
+
+let message "The correct spelling is `per se` (with no hyphen)"
+let description "Corrects common misspellings of `per se`."
+let kind "Spelling"
+let becomes "per se"
+
+test "It's not a problem per-se, but it would make the desktop more consistent when using QT and KDE apps." "It's not a problem per se, but it would make the desktop more consistent when using QT and KDE apps."
+test "Hi all - not really an issue per say, but more of a request for some suggestions and guidance." "Hi all - not really an issue per se, but more of a request for some suggestions and guidance."
+test "Whilst I don't think this is wrong per-say, I'm not confident it is necessary." "Whilst I don't think this is wrong per se, I'm not confident it is necessary."
diff --git a/harper-core/src/linting/weir_rules/PointsOfView.weir b/harper-core/src/linting/weir_rules/PointsOfView.weir
new file mode 100644
index 000000000..b7ccda4ec
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/PointsOfView.weir
@@ -0,0 +1,8 @@
+expr main (point of views)
+
+let message "The correct plural is `points of view`."
+let description "Corrects pluralizing the wrong noun in `point of view`."
+let kind "Grammar"
+let becomes "points of view"
+
+test "This will produce a huge amount of raw data, representing the region in multiple point of views." "This will produce a huge amount of raw data, representing the region in multiple points of view."
diff --git a/harper-core/src/linting/weir_rules/PortAuPrince.weir b/harper-core/src/linting/weir_rules/PortAuPrince.weir
new file mode 100644
index 000000000..fb9fe8150
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/PortAuPrince.weir
@@ -0,0 +1,7 @@
+expr main (Port au Prince)
+
+let message "The official spelling is hyphenated."
+let description "Checks for the correct official name of the capital of Haiti."
+let kind "Punctuation"
+let becomes "Port-au-Prince"
+
diff --git a/harper-core/src/linting/weir_rules/PortoNovo.weir b/harper-core/src/linting/weir_rules/PortoNovo.weir
new file mode 100644
index 000000000..cc4488855
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/PortoNovo.weir
@@ -0,0 +1,7 @@
+expr main (Porto Novo)
+
+let message "The official spelling is hyphenated."
+let description "Checks for the correct official name of the capital of Benin."
+let kind "Punctuation"
+let becomes "Porto-Novo"
+
diff --git a/harper-core/src/linting/weir_rules/PrayingMantis.weir b/harper-core/src/linting/weir_rules/PrayingMantis.weir
new file mode 100644
index 000000000..f198ddaab
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/PrayingMantis.weir
@@ -0,0 +1,7 @@
+expr main (preying mantis)
+
+let message "Use the insect's correct name."
+let description "Corrects `preying mantis` to `praying mantis`, ensuring accurate reference to the insect’s characteristic pose."
+let kind "Eggcorn"
+let becomes "praying mantis"
+
diff --git a/harper-core/src/linting/weir_rules/QuiteMany.weir b/harper-core/src/linting/weir_rules/QuiteMany.weir
new file mode 100644
index 000000000..f28f83b66
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/QuiteMany.weir
@@ -0,0 +1,8 @@
+expr main (quite many)
+
+let message "Use `quite a few` instead of `quite many`."
+let description "Corrects `quite many` to `quite a few`, which is the more natural and idiomatic phrase in standard English. `Quite many` is considered nonstandard usage."
+let kind "Nonstandard"
+let becomes "quite a few"
+
+test "To me it seems it might be caused by a2aaa55 which contains quite many build-related changes." "To me it seems it might be caused by a2aaa55 which contains quite a few build-related changes."
diff --git a/harper-core/src/linting/weir_rules/RapidFire.weir b/harper-core/src/linting/weir_rules/RapidFire.weir
new file mode 100644
index 000000000..127de2c4e
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/RapidFire.weir
@@ -0,0 +1,7 @@
+expr main (rapid fire)
+
+let message "It is more idiomatic to hypenate `rapid-fire`."
+let description "Checks to ensure writers hyphenate `rapid-fire`."
+let kind "Punctuation"
+let becomes "rapid-fire"
+
diff --git a/harper-core/src/linting/weir_rules/RealTrouper.weir b/harper-core/src/linting/weir_rules/RealTrouper.weir
new file mode 100644
index 000000000..27968c4f5
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/RealTrouper.weir
@@ -0,0 +1,7 @@
+expr main (real trooper)
+
+let message "Use the correct phrase for someone who perseveres."
+let description "Ensures the correct use of `real trouper`, distinguishing it from `trooper`, which refers to a soldier or police officer."
+let kind "Eggcorn"
+let becomes "real trouper"
+
diff --git a/harper-core/src/linting/weir_rules/RedundantIIRC.weir b/harper-core/src/linting/weir_rules/RedundantIIRC.weir
new file mode 100644
index 000000000..08324bbd3
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/RedundantIIRC.weir
@@ -0,0 +1,11 @@
+expr main [(if IIRC), (IIRC correctly)]
+
+let message "`IIRC` already means 'if I recall correctly', so adding 'if' or 'correctly' is redundant."
+let description "Flags redundant use of 'if' or 'correctly' with `IIRC`, since `IIRC` already stands for 'if I recall correctly'."
+let kind "Redundancy"
+let becomes "IIRC"
+let strategy "Exact"
+
+test "This is due to the fact that if IIRC up to 2 processes mpirun will bind to core and then it will be socket." "This is due to the fact that IIRC up to 2 processes mpirun will bind to core and then it will be socket."
+test "if iirc getting it to work with the SQLite storage engine was turning into a whole project and we decided to punt it" "IIRC getting it to work with the SQLite storage engine was turning into a whole project and we decided to punt it"
+test "IIRC correctly, someone on the Home Assistant forums went as far as discovering that RS-485 was being used." "IIRC, someone on the Home Assistant forums went as far as discovering that RS-485 was being used."
diff --git a/harper-core/src/linting/weir_rules/RedundantPretty.weir b/harper-core/src/linting/weir_rules/RedundantPretty.weir
new file mode 100644
index 000000000..ad6bfd2f6
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/RedundantPretty.weir
@@ -0,0 +1,20 @@
+expr main (pretty decent)
+
+let message "Avoid redundancy."
+let description "`Pretty` is redundant when modifying `decent`. Use `decent` alone."
+let kind "Style"
+let becomes "decent"
+
+test "The movie was pretty decent." "The movie was decent."
+test "It is pretty decent work." "It is decent work."
+test "She did a pretty decent job." "She did a decent job."
+test "That sounds pretty decent to me." "That sounds decent to me."
+test "We had a pretty decent time." "We had a decent time."
+
+test "The movie was Pretty Decent." "The movie was Decent."
+test "The movie was PRETTY DECENT." "The movie was DECENT."
+
+test "The movie was pretty good." "The movie was pretty good."
+test "The movie was decent." "The movie was decent."
+test "It was quite decent." "It was quite decent."
+test "Pretty much anything works." "Pretty much anything works."
diff --git a/harper-core/src/linting/weir_rules/RedundantThat.weir b/harper-core/src/linting/weir_rules/RedundantThat.weir
new file mode 100644
index 000000000..9d4d63ca7
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/RedundantThat.weir
@@ -0,0 +1,8 @@
+expr main (that that)
+
+let message "Consider whether the second `that` adds meaning in this context."
+let description "There is rarely a situation where `that that` cannot be condensed into a single token."
+let kind "Repetition"
+let becomes "that"
+
+test "I know that that answer is correct" "I know that answer is correct"
diff --git a/harper-core/src/linting/weir_rules/RifeWith.weir b/harper-core/src/linting/weir_rules/RifeWith.weir
new file mode 100644
index 000000000..da2345279
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/RifeWith.weir
@@ -0,0 +1,7 @@
+expr main (ripe with)
+
+let message "Use the correct phrase for something abundant."
+let description "Corrects `ripe with` to `rife with`, preserving the phrase’s meaning of being filled with something, often undesirable."
+let kind "Eggcorn"
+let becomes "rife with"
+
diff --git a/harper-core/src/linting/weir_rules/RoadMap.weir b/harper-core/src/linting/weir_rules/RoadMap.weir
new file mode 100644
index 000000000..65eb3e757
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/RoadMap.weir
@@ -0,0 +1,7 @@
+expr main (roadmap)
+
+let message "Did you mean `road map`?"
+let description "Detects when `roadmap` is used instead of `road map`, prompting the correct spacing."
+let kind "WordChoice"
+let becomes "road map"
+
diff --git a/harper-core/src/linting/weir_rules/RulesOfThumb.weir b/harper-core/src/linting/weir_rules/RulesOfThumb.weir
new file mode 100644
index 000000000..fc81c4fca
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/RulesOfThumb.weir
@@ -0,0 +1,9 @@
+expr main [(rule of thumbs), (rule-of-thumbs)]
+
+let message "The correct plural is `rules of thumb`."
+let description "Corrects pluralizing the wrong noun in `rule of thumb`."
+let kind "Grammar"
+let becomes "rules of thumb"
+
+test "Thanks. 0.2 is just from my rule of thumbs." "Thanks. 0.2 is just from my rules of thumb."
+test "Add rule-of-thumbs for basic metrics, like \"Spill more than 1GB is a red flag\"." "Add rules of thumb for basic metrics, like \"Spill more than 1GB is a red flag\"."
diff --git a/harper-core/src/linting/weir_rules/SameAs.weir b/harper-core/src/linting/weir_rules/SameAs.weir
new file mode 100644
index 000000000..5aab1f382
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/SameAs.weir
@@ -0,0 +1,7 @@
+expr main (same then)
+
+let message "Did you mean `same as`?"
+let description "Corrects the incorrect phrase `same then` to the standard `same as`."
+let kind "Grammar"
+let becomes "same as"
+
diff --git a/harper-core/src/linting/weir_rules/ScantilyClad.weir b/harper-core/src/linting/weir_rules/ScantilyClad.weir
new file mode 100644
index 000000000..e63e2e105
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ScantilyClad.weir
@@ -0,0 +1,7 @@
+expr main (scandally clad)
+
+let message "Use the correct phrase for minimal attire."
+let description "Fixes `scandally clad` to `scantily clad`, ensuring clarity in describing minimal attire."
+let kind "Eggcorn"
+let becomes "scantily clad"
+
diff --git a/harper-core/src/linting/weir_rules/SendAnEmailTo.weir b/harper-core/src/linting/weir_rules/SendAnEmailTo.weir
new file mode 100644
index 000000000..6932aedaa
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/SendAnEmailTo.weir
@@ -0,0 +1,18 @@
+expr main (send an email to)
+
+let message "Use the shorter verb form."
+let description "Replaces the verbose phrase `send an email to` with the concise verb `email`."
+let kind "Style"
+let becomes "email"
+let strategy "Exact"
+
+test "Please send an email to John." "Please email John."
+test "I will send an email to the team later." "I will email the team later."
+test "SEND AN EMAIL TO support." "email support."
+test "Send An Email To HR." "email HR."
+test "Can you send an email to her?" "Can you email her?"
+test "They decided to send an email to all users." "They decided to email all users."
+test "Send an email to John, please." "email John, please."
+test "Before noon, send an email to marketing." "Before noon, email marketing."
+test "Please write an email to John." "Please write an email to John."
+test "She sent a message to John." "She sent a message to John."
diff --git a/harper-core/src/linting/weir_rules/SimpleGrammatical.weir b/harper-core/src/linting/weir_rules/SimpleGrammatical.weir
new file mode 100644
index 000000000..e8d06d350
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/SimpleGrammatical.weir
@@ -0,0 +1,7 @@
+expr main (simply grammatical)
+
+let message "Use `simple grammatical` for correct adjective usage."
+let description "Corrects `simply grammatical` to `simple grammatical` for proper adjective usage."
+let kind "Usage"
+let becomes "simple grammatical"
+
diff --git a/harper-core/src/linting/weir_rules/SneakingSuspicion.weir b/harper-core/src/linting/weir_rules/SneakingSuspicion.weir
new file mode 100644
index 000000000..9457c9fe2
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/SneakingSuspicion.weir
@@ -0,0 +1,8 @@
+expr main (sneaky suspicion)
+
+let message "Did you mean `sneaking suspicion`?"
+let description "Changes `sneaky suspicion` to `sneaking suspicion`."
+let kind "Eggcorn"
+let becomes "sneaking suspicion"
+
+test "sneaky suspicion" "sneaking suspicion"
diff --git a/harper-core/src/linting/weir_rules/SomeOfThe.weir b/harper-core/src/linting/weir_rules/SomeOfThe.weir
new file mode 100644
index 000000000..5142ba576
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/SomeOfThe.weir
@@ -0,0 +1,9 @@
+expr main (some the)
+
+let message "Add `of` to form the partitive phrase: `some of the`."
+let description "Quantity words such as `some` normally take `of` before a definite article. Including `of` signals that you mean a subset of a larger set, preventing a momentary stumble in comprehension."
+let kind "Typo"
+let becomes "some of the"
+
+test "Some the trees are too thick to climb." "Some of the trees are too thick to climb."
+test "You have misplaced some the config files." "You have misplaced some of the config files."
diff --git a/harper-core/src/linting/weir_rules/SomebodyElses.weir b/harper-core/src/linting/weir_rules/SomebodyElses.weir
new file mode 100644
index 000000000..5d1e63ba9
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/SomebodyElses.weir
@@ -0,0 +1,9 @@
+expr main [(somebody's else), (somebody's else's)]
+
+let message "This should be `somebody else's`?"
+let description "Corrects `somebody else's` when the `'s` is in the wrong place."
+let kind "Grammar"
+let becomes "somebody else's"
+
+test "I really like your component and change to somebody's else would be really bad for now." "I really like your component and change to somebody else's would be really bad for now."
+test "Nice to know it's somebody's else's problem for a change." "Nice to know it's somebody else's problem for a change."
diff --git a/harper-core/src/linting/weir_rules/SoonerOrLater.weir b/harper-core/src/linting/weir_rules/SoonerOrLater.weir
new file mode 100644
index 000000000..38c5be507
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/SoonerOrLater.weir
@@ -0,0 +1,7 @@
+expr main (sooner than later)
+
+let message "Did you mean `sooner rather than later` or `sooner or later`?"
+let description "Fixes the improper phrase `sooner than later` by suggesting standard alternatives."
+let kind "Usage"
+let becomes ["sooner rather than later", "sooner or later"]
+
diff --git a/harper-core/src/linting/weir_rules/SpecialAttention.weir b/harper-core/src/linting/weir_rules/SpecialAttention.weir
new file mode 100644
index 000000000..1cc440031
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/SpecialAttention.weir
@@ -0,0 +1,8 @@
+expr main (spacial attention)
+
+let message "Did you mean `special attention`?"
+let description "Changes `spacial attention` to `special attention`."
+let kind "Typo"
+let becomes "special attention"
+
+test "spacial attention" "special attention"
diff --git a/harper-core/src/linting/weir_rules/Starving.weir b/harper-core/src/linting/weir_rules/Starving.weir
new file mode 100644
index 000000000..546348f41
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/Starving.weir
@@ -0,0 +1,7 @@
+expr main [(very hungry), (really hungry), (extremely hungry)]
+
+let message "A more vivid adjective would better convey intense hunger."
+let description "Encourages vivid writing by suggesting `starving` instead of weaker expressions like `very hungry.`"
+let kind "Enhancement"
+let becomes "starving"
+
diff --git a/harper-core/src/linting/weir_rules/StateOfTheArt.weir b/harper-core/src/linting/weir_rules/StateOfTheArt.weir
new file mode 100644
index 000000000..55ddbabc0
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/StateOfTheArt.weir
@@ -0,0 +1,7 @@
+expr main (state of art)
+
+let message "Did you mean `state of the art`?"
+let description "Detects incorrect usage of `state of art` and suggests `state of the art` as the correct phrase."
+let kind "Usage"
+let becomes "state of the art"
+
diff --git a/harper-core/src/linting/weir_rules/StatuteOfLimitations.weir b/harper-core/src/linting/weir_rules/StatuteOfLimitations.weir
new file mode 100644
index 000000000..49a004025
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/StatuteOfLimitations.weir
@@ -0,0 +1,8 @@
+expr main (statue of limitations)
+
+let message "A `statue` is a sculpture; in legal terms, the correct word is `statute`."
+let description "Corrects `statue of limitations` to `statute of limitations`."
+let kind "Eggcorn"
+let becomes "statute of limitations"
+
+test "Shouldn't there be a grandfathered-in or statue of limitations for posts before the original punishment?" "Shouldn't there be a grandfathered-in or statute of limitations for posts before the original punishment?"
diff --git a/harper-core/src/linting/weir_rules/SufficeItToSay.weir b/harper-core/src/linting/weir_rules/SufficeItToSay.weir
new file mode 100644
index 000000000..6977f798e
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/SufficeItToSay.weir
@@ -0,0 +1,8 @@
+expr main (suffice to say)
+
+let message "`Suffice it to say` is the more standard and more common variant."
+let description "Corrects `suffice to say` to `suffice it to say`."
+let kind "Usage"
+let becomes "suffice it to say"
+
+test "I don't fully grok the bug, but suffice to say it is not an RCD issue." "I don't fully grok the bug, but suffice it to say it is not an RCD issue."
diff --git a/harper-core/src/linting/weir_rules/SupposedTo.weir b/harper-core/src/linting/weir_rules/SupposedTo.weir
new file mode 100644
index 000000000..c92953537
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/SupposedTo.weir
@@ -0,0 +1,8 @@
+expr main (suppose to)
+
+let message "Did you mean `supposed to`?"
+let description "Fixes `suppose to` to the correct `supposed to`."
+let kind "Usage"
+let becomes "supposed to"
+
+test "suppose to" "supposed to"
diff --git a/harper-core/src/linting/weir_rules/TakeItPersonally.weir b/harper-core/src/linting/weir_rules/TakeItPersonally.weir
new file mode 100644
index 000000000..64e0598a6
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/TakeItPersonally.weir
@@ -0,0 +1,8 @@
+expr main (take it personal)
+
+let message "The more standard, less colloquial form is `take it personally`."
+let description "Corrects `take it personal` to `take it personally`."
+let kind "Usage"
+let becomes "take it personally"
+
+test "This is not personal, do not take it personal, we also think Thingsboard is a extraordinary tool (we are using in several scenarios in fact)" "This is not personal, do not take it personally, we also think Thingsboard is a extraordinary tool (we are using in several scenarios in fact)"
diff --git a/harper-core/src/linting/weir_rules/ThanksALot.weir b/harper-core/src/linting/weir_rules/ThanksALot.weir
new file mode 100644
index 000000000..fa6673462
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ThanksALot.weir
@@ -0,0 +1,9 @@
+expr main (thanks lot)
+
+let message "The indefinite article `a` is required in `thanks a lot`."
+let description "Corrects the missing article in `thanks lot`, forming `thanks a lot`."
+let kind "Grammar"
+let becomes "thanks a lot"
+
+test "thanks lot" "thanks a lot"
+test "thanks a lot" "thanks a lot"
diff --git a/harper-core/src/linting/weir_rules/ThatChallenged.weir b/harper-core/src/linting/weir_rules/ThatChallenged.weir
new file mode 100644
index 000000000..61b8acbdf
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ThatChallenged.weir
@@ -0,0 +1,6 @@
+expr main (the challenged)
+
+let message "Use `that challenged` for correct relative clause."
+let description "Corrects `the challenged` to `that challenged` for proper relative clause usage."
+let becomes "that challenged"
+
diff --git a/harper-core/src/linting/weir_rules/ThatThis.weir b/harper-core/src/linting/weir_rules/ThatThis.weir
new file mode 100644
index 000000000..861ff9f60
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ThatThis.weir
@@ -0,0 +1,7 @@
+expr main (the this)
+
+let message "Did you mean `that this`?"
+let description "Fixes `the this` to the correct phrase `that this`."
+let kind "Typo"
+let becomes "that this"
+
diff --git a/harper-core/src/linting/weir_rules/The.weir b/harper-core/src/linting/weir_rules/The.weir
new file mode 100644
index 000000000..6356a1d7c
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/The.weir
@@ -0,0 +1,8 @@
+expr main [(teh), (te)]
+
+let message "Did you mean the definite article?"
+let description "Fixes especially common misspellings of the word `the`"
+let kind "Typo"
+let becomes "the"
+
+test "I adore teh light of the moon." "I adore the light of the moon."
diff --git a/harper-core/src/linting/weir_rules/TheAnother.weir b/harper-core/src/linting/weir_rules/TheAnother.weir
new file mode 100644
index 000000000..66a1d2e86
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/TheAnother.weir
@@ -0,0 +1,8 @@
+expr main (the another)
+
+let message "Use `the other` or `another`, not both."
+let description "Corrects `the another`."
+let kind "Grammar"
+let becomes ["the other", "another"]
+
+test "Another possible cause is simply that the application does not have file creation permissions on the another machine." "Another possible cause is simply that the application does not have file creation permissions on the other machine."
diff --git a/harper-core/src/linting/weir_rules/TheirToThere.weir b/harper-core/src/linting/weir_rules/TheirToThere.weir
new file mode 100644
index 000000000..08c0bcfe8
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/TheirToThere.weir
@@ -0,0 +1,62 @@
+expr main [<(their [is, are, was, were, isn't, aren't, wasn't, weren't, (will be), (can be), (could be), (should be), (would be), (may be), (might be), (must be), (has been), (have been)]), their>, <(their [on, after, beside, in, by, until, again, to, and, right]), their>, <(their,), their>, their's]
+
+let message "Did you mean `there`?"
+let description "Corrects `their` when the intended meaning is `there`."
+let kind "Grammar"
+let becomes ["there", "there's", "there's"]
+
+test "Their is a problem with the build." "There is a problem with the build."
+test "Their are several options to consider." "There are several options to consider."
+test "Their was a delay in the rollout." "There was a delay in the rollout."
+test "Their were no updates last week." "There were no updates last week."
+test "Their isn't any time left." "There isn't any time left."
+test "Their aren't enough chairs." "There aren't enough chairs."
+test "Their wasn't a clear answer." "There wasn't a clear answer."
+test "Their weren't any tickets left." "There weren't any tickets left."
+test "Their will be more questions." "There will be more questions."
+test "Their can be a conflict of interest." "There can be a conflict of interest."
+test "Their could be a better approach." "There could be a better approach."
+test "Their should be a warning." "There should be a warning."
+test "Their would be a delay if we waited." "There would be a delay if we waited."
+test "Their may be changes later." "There may be changes later."
+test "Their might be issues later." "There might be issues later."
+test "Their must be a simpler way." "There must be a simpler way."
+test "Their has been a change in scope." "There has been a change in scope."
+test "Their have been delays all week." "There have been delays all week."
+
+test "Their car is in the driveway." "Their car is in the driveway."
+test "We used their tools for the repair." "We used their tools for the repair."
+test "Their team was excited." "Their team was excited."
+test "I appreciate their help." "I appreciate their help."
+test "Their willpower is strong." "Their willpower is strong."
+
+test "Their is a cat sleeping on the radiator." "There is a cat sleeping on the radiator."
+test "I left the keys their on the counter." "I left the keys there on the counter."
+test "Their are three clean mugs in the cupboard." "There are three clean mugs in the cupboard."
+test "We should meet their after work, near the fountain." "We should meet there after work, near the fountain."
+test "Their was a strange echo in the stairwell." "There was a strange echo in the stairwell."
+test "Put the blue folder their, beside the printer." "Put the blue folder there, beside the printer."
+test "Their will be a storm tonight, so bring the plants in." "There will be a storm tonight, so bring the plants in."
+test "I've never been their, but I've read about it." "I've never been there, but I've read about it."
+test "Their isn't enough coffee for everyone." "There isn't enough coffee for everyone."
+test "She paused their, mid-sentence, as if listening." "She paused there, mid-sentence, as if listening."
+test "Their were fingerprints on the glass." "There were fingerprints on the glass."
+test "We can stop their and refuel before the mountains." "We can stop there and refuel before the mountains."
+test "Their's a tiny crack in the screen." "There's a tiny crack in the screen."
+test "I saw him standing their, perfectly still." "I saw him standing there, perfectly still."
+test "Their are more questions than answers." "There are more questions than answers."
+test "Leave the umbrella their by the door." "Leave the umbrella there by the door."
+test "Their must be a simpler explanation." "There must be a simpler explanation."
+test "I wish I could go their again in summer." "I wish I could go there again in summer."
+test "Their is no shortcut through this part of the forest." "There is no shortcut through this part of the forest."
+test "He moved the chair their to catch the sunlight." "He moved the chair there to catch the sunlight."
+test "Their were candles on every windowsill." "There were candles on every windowsill."
+test "You can park their, but only after 6 p.m." "You can park there, but only after 6 p.m."
+test "Their's a note taped under the table." "There's a note taped under the table."
+test "She felt safer their, among familiar faces." "She felt safer there, among familiar faces."
+test "Their were no footprints their in the fresh snow." "There were no footprints there in the fresh snow."
+test "I'll wait their until you arrive." "I'll wait there until you arrive."
+test "Their is a quiet confidence in her voice." "There is a quiet confidence in her voice."
+test "The answer is right their in the first paragraph." "The answer is right there in the first paragraph."
+test "Their are deadlines, and then their are consequences." "There are deadlines, and then there are consequences."
+test "I can't believe you're still standing their, smiling." "I can't believe you're still standing there, smiling."
diff --git a/harper-core/src/linting/weir_rules/TheirToTheyre.weir b/harper-core/src/linting/weir_rules/TheirToTheyre.weir
new file mode 100644
index 000000000..4acf45479
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/TheirToTheyre.weir
@@ -0,0 +1,78 @@
+expr main [<(their [AUX, (supposed to), (allowed to), (invited to), (going to), (trying to), (coming over), (leaving in), (moving to), (planning a), (waiting for), (answering any), (wondering where), (running behind), (far too), even, (already here), (in the), (on the), (at the), (a lot), an, two, offline, (ADV [PROG, AUX]), (ADV VERB), (PART [PROG, VERB, ADJ, AUX]), (ready to), the]), their>]
+
+let message "Did you mean `they're`?"
+let description "Corrects `their` when the intended meaning is `they're`."
+let kind "Grammar"
+let becomes ["they're", "they're "]
+
+test "Their going to be late." "They're going to be late."
+test "I think their already here." "I think they're already here."
+test "Their not sure what to do next." "They're not sure what to do next."
+test "Their coming over after work." "They're coming over after work."
+test "Tell them their invited to the meeting." "Tell them they're invited to the meeting."
+test "Their trying to fix the bug right now." "They're trying to fix the bug right now."
+test "Their going to love this movie." "They're going to love this movie."
+test "Their the fastest team in the league." "They're the fastest team in the league."
+test "Their supposed to call you back today." "They're supposed to call you back today."
+test "Their leaving in five minutes." "They're leaving in five minutes."
+test "I heard their moving to Denver." "I heard they're moving to Denver."
+test "Their just kidding--don't worry." "They're just kidding--don't worry."
+test "Their going to email the final draft tonight." "They're going to email the final draft tonight."
+test "Their not available until Tuesday." "They're not available until Tuesday."
+test "Their planning a surprise party." "They're planning a surprise party."
+test "Looks like their running behind schedule." "Looks like they're running behind schedule."
+test "Their the ones who approved it." "They're the ones who approved it."
+test "Their going to miss the train." "They're going to miss the train."
+test "Their still waiting for the test results." "They're still waiting for the test results."
+test "Their not allowed to park here." "They're not allowed to park here."
+test "Their going to change the policy." "They're going to change the policy."
+test "Their ready to start whenever you are." "They're ready to start whenever you are."
+test "Their not answering any messages." "They're not answering any messages."
+test "Their going to be a problem if we don't hurry." "They're going to be a problem if we don't hurry."
+test "Their probably wondering where we went." "They're probably wondering where we went."
+
+test "Their backpacks were stacked neatly by the door." "Their backpacks were stacked neatly by the door."
+test "I admired their patience during the long, glitchy delay." "I admired their patience during the long, glitchy delay."
+test "Their dog sprinted across the yard like a furry comet." "Their dog sprinted across the yard like a furry comet."
+test "The committee revised their proposal after the budget changed." "The committee revised their proposal after the budget changed."
+test "Their laughter drifted down the hallway, bright and unguarded." "Their laughter drifted down the hallway, bright and unguarded."
+test "We borrowed their ladder to reach the stubborn light fixture." "We borrowed their ladder to reach the stubborn light fixture."
+test "Their apartment smells like coffee, citrus, and old paperbacks." "Their apartment smells like coffee, citrus, and old paperbacks."
+test "The kids lost their mittens somewhere between the car and the rink." "The kids lost their mittens somewhere between the car and the rink."
+test "Their answer was careful, precise, and unexpectedly kind." "Their answer was careful, precise, and unexpectedly kind."
+test "The artists framed their sketches before the gallery opened." "The artists framed their sketches before the gallery opened."
+test "Their server crashed, but their backup plan worked flawlessly." "Their server crashed, but their backup plan worked flawlessly."
+test "I couldn't ignore their evidence; it was meticulously documented." "I couldn't ignore their evidence; it was meticulously documented."
+test "Their garden is a riot of basil, tomatoes, and bee traffic." "Their garden is a riot of basil, tomatoes, and bee traffic."
+test "The hikers checked their maps twice before leaving the trailhead." "The hikers checked their maps twice before leaving the trailhead."
+test "Their team celebrated quietly--relieved more than triumphant." "Their team celebrated quietly--relieved more than triumphant."
+test "Users should be able to visualize their connected notes as a knowledge graph, allowing them to explore relationships and identify patterns." "Users should be able to visualize their connected notes as a knowledge graph, allowing them to explore relationships and identify patterns."
+test "The frustration was palpable; the team felt they were fighting a constant uphill battle against their own data infrastructure." "The frustration was palpable; the team felt they were fighting a constant uphill battle against their own data infrastructure."
+test "Historians and sociologists have long examined how societies construct and maintain narratives about their past." "Historians and sociologists have long examined how societies construct and maintain narratives about their past."
+test "Traditional maps, often produced by the colonizers, replaced native nomenclature with European equivalents, effectively severing a vital link between people and their ancestral lands." "Traditional maps, often produced by the colonizers, replaced native nomenclature with European equivalents, effectively severing a vital link between people and their ancestral lands."
+test "She believes I should prioritize their needs above my own." "She believes I should prioritize their needs above my own."
+test "Each player places their pawn on GRI Headquarters (designated space on the board)." "Each player places their pawn on GRI Headquarters (designated space on the board)."
+test "This fragmented view hindered their ability to make timely adjustments, ultimately impacting their return on investment." "This fragmented view hindered their ability to make timely adjustments, ultimately impacting their return on investment."
+test "My shift was nearing its end, and I was conducting my final rounds, ensuring each patient was comfortable and their needs were met." "My shift was nearing its end, and I was conducting my final rounds, ensuring each patient was comfortable and their needs were met."
+test "Upon opening the application, users see a prioritized list of information cards related to their most recently accessed projects or tasks in connected applications." "Upon opening the application, users see a prioritized list of information cards related to their most recently accessed projects or tasks in connected applications."
+test "For instance, a musician who has lost their hearing might collaborate with a visual artist to create a series of abstract paintings that attempt to translate the emotional impact of music into a visual form." "For instance, a musician who has lost their hearing might collaborate with a visual artist to create a series of abstract paintings that attempt to translate the emotional impact of music into a visual form."
+test "Their relatively low density facilitates handling and transportation." "Their relatively low density facilitates handling and transportation."
+test "The growing interest in mycelium-based construction materials stems from their potential to offer a sustainable alternative to conventional building materials." "The growing interest in mycelium-based construction materials stems from their potential to offer a sustainable alternative to conventional building materials."
+test "Similarly, the individual experiencing sensory loss must actively reconstruct their understanding of the world, mapping the contours of their new, altered reality." "Similarly, the individual experiencing sensory loss must actively reconstruct their understanding of the world, mapping the contours of their new, altered reality."
+
+test "Their far too warm for that." "They're far too warm for that."
+test "Their far too cold for that." "They're far too cold for that."
+test "Their even, just as I said!" "They're even, just as I said!"
+
+test "Their in the kitchen already." "They're in the kitchen already."
+test "Their on the way to the airport." "They're on the way to the airport."
+test "Their at the wrong address." "They're at the wrong address."
+
+test "Their a lot of people waiting outside." "They're a lot of people waiting outside."
+test "Their an example of how not to do it." "They're an example of how not to do it."
+test "Their two options left." "They're two options left."
+
+test "Their to blame for the mistake." "They're to blame for the mistake."
+test "Their to meet us after work." "They're to meet us after work."
+
+test "Their offline right now, try again later." "They're offline right now, try again later."
diff --git a/harper-core/src/linting/weir_rules/ThereToTheir.weir b/harper-core/src/linting/weir_rules/ThereToTheir.weir
new file mode 100644
index 000000000..7781b96fd
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ThereToTheir.weir
@@ -0,0 +1,49 @@
+expr main [<(there [NOUN, (NOUN NOUN), mittens, sketches, past, needs, pawn, ability, return]), there>, <(there connected notes), there>, <(there own data infrastructure), there>, <(there ancestral lands), there>, <(there relatively low density), there>, <(there potential to), there>, <(there backup plan), there>, <(there most recently accessed projects), there>, <(there new), there>]
+
+let message "Did you mean `their`?"
+let description "Corrects `there` when the intended meaning is `their`."
+let kind "Grammar"
+let becomes "their"
+
+test "There backpacks were stacked neatly by the door." "Their backpacks were stacked neatly by the door."
+test "I admired there patience during the long, glitchy delay." "I admired their patience during the long, glitchy delay."
+test "There dog sprinted across the yard like a furry comet." "Their dog sprinted across the yard like a furry comet."
+test "The committee revised there proposal after the budget changed." "The committee revised their proposal after the budget changed."
+test "There laughter drifted down the hallway, bright and unguarded." "Their laughter drifted down the hallway, bright and unguarded."
+test "We borrowed there ladder to reach the stubborn light fixture." "We borrowed their ladder to reach the stubborn light fixture."
+test "There apartment smells like coffee, citrus, and old paperbacks." "Their apartment smells like coffee, citrus, and old paperbacks."
+test "The kids lost there mittens somewhere between the car and the rink." "The kids lost their mittens somewhere between the car and the rink."
+test "There answer was careful, precise, and unexpectedly kind." "Their answer was careful, precise, and unexpectedly kind."
+test "The artists framed there sketches before the gallery opened." "The artists framed their sketches before the gallery opened."
+test "There server crashed, but there backup plan worked flawlessly." "Their server crashed, but their backup plan worked flawlessly."
+test "I couldn't ignore there evidence; it was meticulously documented." "I couldn't ignore their evidence; it was meticulously documented."
+test "There garden is a riot of basil, tomatoes, and bee traffic." "Their garden is a riot of basil, tomatoes, and bee traffic."
+test "The hikers checked there maps twice before leaving the trailhead." "The hikers checked their maps twice before leaving the trailhead."
+test "There team celebrated quietly--relieved more than triumphant." "Their team celebrated quietly--relieved more than triumphant."
+test "Users should be able to visualize there connected notes as a knowledge graph, allowing them to explore relationships and identify patterns." "Users should be able to visualize their connected notes as a knowledge graph, allowing them to explore relationships and identify patterns."
+test "The frustration was palpable; the team felt they were fighting a constant uphill battle against there own data infrastructure." "The frustration was palpable; the team felt they were fighting a constant uphill battle against their own data infrastructure."
+test "Historians and sociologists have long examined how societies construct and maintain narratives about there past." "Historians and sociologists have long examined how societies construct and maintain narratives about their past."
+test "Traditional maps, often produced by the colonizers, replaced native nomenclature with European equivalents, effectively severing a vital link between people and there ancestral lands." "Traditional maps, often produced by the colonizers, replaced native nomenclature with European equivalents, effectively severing a vital link between people and their ancestral lands."
+test "She believes I should prioritize there needs above my own." "She believes I should prioritize their needs above my own."
+test "Each player places there pawn on GRI Headquarters (designated space on the board)." "Each player places their pawn on GRI Headquarters (designated space on the board)."
+test "This fragmented view hindered there ability to make timely adjustments, ultimately impacting there return on investment." "This fragmented view hindered their ability to make timely adjustments, ultimately impacting their return on investment."
+test "My shift was nearing its end, and I was conducting my final rounds, ensuring each patient was comfortable and there needs were met." "My shift was nearing its end, and I was conducting my final rounds, ensuring each patient was comfortable and their needs were met."
+test "Upon opening the application, users see a prioritized list of information cards related to there most recently accessed projects or tasks in connected applications." "Upon opening the application, users see a prioritized list of information cards related to their most recently accessed projects or tasks in connected applications."
+test "For instance, a musician who has lost there hearing might collaborate with a visual artist to create a series of abstract paintings that attempt to translate the emotional impact of music into a visual form." "For instance, a musician who has lost their hearing might collaborate with a visual artist to create a series of abstract paintings that attempt to translate the emotional impact of music into a visual form."
+test "There relatively low density facilitates handling and transportation." "Their relatively low density facilitates handling and transportation."
+test "The growing interest in mycelium-based construction materials stems from there potential to offer a sustainable alternative to conventional building materials." "The growing interest in mycelium-based construction materials stems from their potential to offer a sustainable alternative to conventional building materials."
+test "Similarly, the individual experiencing sensory loss must actively reconstruct there understanding of the world, mapping the contours of there new, altered reality." "Similarly, the individual experiencing sensory loss must actively reconstruct their understanding of the world, mapping the contours of their new, altered reality."
+
+test "There are several options to consider." "There are several options to consider."
+test "I left the keys there on the counter." "I left the keys there on the counter."
+test "We should meet there after work, near the fountain." "We should meet there after work, near the fountain."
+test "There will be more questions." "There will be more questions."
+test "There isn't any time left." "There isn't any time left."
+test "There's a note taped under the table." "There's a note taped under the table."
+test "I saw him standing there, perfectly still." "I saw him standing there, perfectly still."
+test "Leave the umbrella there by the door." "Leave the umbrella there by the door."
+test "The answer is right there in the first paragraph." "The answer is right there in the first paragraph."
+test "Are there known issues between these specific versions of Elementor and ACF that I’m unaware of?" "Are there known issues between these specific versions of Elementor and ACF that I’m unaware of?"
+test "There are lots of different phases." "There are lots of different phases."
+test "Yet, there are pockets of silence, moments where the urban soundscape recedes." "Yet, there are pockets of silence, moments where the urban soundscape recedes."
+test "While there are areas for improvement, the plugin is already a valuable tool for developers who want a modern and efficient debugging experience." "While there are areas for improvement, the plugin is already a valuable tool for developers who want a modern and efficient debugging experience."
diff --git a/harper-core/src/linting/weir_rules/TheyreToTheir.weir b/harper-core/src/linting/weir_rules/TheyreToTheir.weir
new file mode 100644
index 000000000..65b07c406
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/TheyreToTheir.weir
@@ -0,0 +1,61 @@
+expr main [<(they're [NOUN, (NOUN NOUN), (ADJ NOUN), (ADV ADJ NOUN), (VERB NOUN), (ADV VERB NOUN), (ADV ADV VERB NOUN), (ADJ PUNCT ADJ NOUN), (mittens), (sketches), (past), (needs), (pawn), (ability), (return), (potential to), (understanding), (new)]), they're>]
+
+let message "Did you mean `their`?"
+let description "Corrects `they're` when the intended meaning is `their`."
+let kind "Grammar"
+let becomes "their"
+
+test "They're going to be late." "They're going to be late."
+test "I think they're already here." "I think they're already here."
+test "They're not sure what to do next." "They're not sure what to do next."
+test "They're coming over after work." "They're coming over after work."
+test "Tell them they're invited to the meeting." "Tell them they're invited to the meeting."
+test "They're trying to fix the bug right now." "They're trying to fix the bug right now."
+test "They're going to love this movie." "They're going to love this movie."
+test "They're the fastest team in the league." "They're the fastest team in the league."
+test "They're supposed to call you back today." "They're supposed to call you back today."
+test "They're leaving in five minutes." "They're leaving in five minutes."
+test "I heard they're moving to Denver." "I heard they're moving to Denver."
+test "They're just kidding--don't worry." "They're just kidding--don't worry."
+test "They're going to email the final draft tonight." "They're going to email the final draft tonight."
+test "They're not available until Tuesday." "They're not available until Tuesday."
+test "They're planning a surprise party." "They're planning a surprise party."
+test "Looks like they're running behind schedule." "Looks like they're running behind schedule."
+test "They're the ones who approved it." "They're the ones who approved it."
+test "They're going to miss the train." "They're going to miss the train."
+test "They're still waiting for the test results." "They're still waiting for the test results."
+test "They're not allowed to park here." "They're not allowed to park here."
+test "They're going to change the policy." "They're going to change the policy."
+test "They're ready to start whenever you are." "They're ready to start whenever you are."
+test "They're not answering any messages." "They're not answering any messages."
+test "They're going to be a problem if we don't hurry." "They're going to be a problem if we don't hurry."
+test "They're probably wondering where we went." "They're probably wondering where we went."
+
+test "They're backpacks were stacked neatly by the door." "Their backpacks were stacked neatly by the door."
+test "I admired they're patience during the long, glitchy delay." "I admired their patience during the long, glitchy delay."
+test "They're dog sprinted across the yard like a furry comet." "Their dog sprinted across the yard like a furry comet."
+test "The committee revised they're proposal after the budget changed." "The committee revised their proposal after the budget changed."
+test "They're laughter drifted down the hallway, bright and unguarded." "Their laughter drifted down the hallway, bright and unguarded."
+test "We borrowed they're ladder to reach the stubborn light fixture." "We borrowed their ladder to reach the stubborn light fixture."
+test "They're apartment smells like coffee, citrus, and old paperbacks." "Their apartment smells like coffee, citrus, and old paperbacks."
+test "The kids lost they're mittens somewhere between the car and the rink." "The kids lost their mittens somewhere between the car and the rink."
+test "They're answer was careful, precise, and unexpectedly kind." "Their answer was careful, precise, and unexpectedly kind."
+test "The artists framed they're sketches before the gallery opened." "The artists framed their sketches before the gallery opened."
+test "They're server crashed, but they're backup plan worked flawlessly." "Their server crashed, but their backup plan worked flawlessly."
+test "I couldn't ignore they're evidence; it was meticulously documented." "I couldn't ignore their evidence; it was meticulously documented."
+test "They're garden is a riot of basil, tomatoes, and bee traffic." "Their garden is a riot of basil, tomatoes, and bee traffic."
+test "The hikers checked they're maps twice before leaving the trailhead." "The hikers checked their maps twice before leaving the trailhead."
+test "They're team celebrated quietly--relieved more than triumphant." "Their team celebrated quietly--relieved more than triumphant."
+test "Users should be able to visualize they're connected notes as a knowledge graph, allowing them to explore relationships and identify patterns." "Users should be able to visualize their connected notes as a knowledge graph, allowing them to explore relationships and identify patterns."
+test "The frustration was palpable; the team felt they were fighting a constant uphill battle against they're own data infrastructure." "The frustration was palpable; the team felt they were fighting a constant uphill battle against their own data infrastructure."
+test "Historians and sociologists have long examined how societies construct and maintain narratives about they're past." "Historians and sociologists have long examined how societies construct and maintain narratives about their past."
+test "Traditional maps, often produced by the colonizers, replaced native nomenclature with European equivalents, effectively severing a vital link between people and they're ancestral lands." "Traditional maps, often produced by the colonizers, replaced native nomenclature with European equivalents, effectively severing a vital link between people and their ancestral lands."
+test "She believes I should prioritize they're needs above my own." "She believes I should prioritize their needs above my own."
+test "Each player places they're pawn on GRI Headquarters (designated space on the board)." "Each player places their pawn on GRI Headquarters (designated space on the board)."
+test "This fragmented view hindered they're ability to make timely adjustments, ultimately impacting they're return on investment." "This fragmented view hindered their ability to make timely adjustments, ultimately impacting their return on investment."
+test "My shift was nearing its end, and I was conducting my final rounds, ensuring each patient was comfortable and they're needs were met." "My shift was nearing its end, and I was conducting my final rounds, ensuring each patient was comfortable and their needs were met."
+test "Upon opening the application, users see a prioritized list of information cards related to they're most recently accessed projects or tasks in connected applications." "Upon opening the application, users see a prioritized list of information cards related to their most recently accessed projects or tasks in connected applications."
+test "For instance, a musician who has lost they're hearing might collaborate with a visual artist to create a series of abstract paintings that attempt to translate the emotional impact of music into a visual form." "For instance, a musician who has lost their hearing might collaborate with a visual artist to create a series of abstract paintings that attempt to translate the emotional impact of music into a visual form."
+test "They're relatively low density facilitates handling and transportation." "Their relatively low density facilitates handling and transportation."
+test "The growing interest in mycelium-based construction materials stems from they're potential to offer a sustainable alternative to conventional building materials." "The growing interest in mycelium-based construction materials stems from their potential to offer a sustainable alternative to conventional building materials."
+test "Similarly, the individual experiencing sensory loss must actively reconstruct they're understanding of the world, mapping the contours of they're new, altered reality." "Similarly, the individual experiencing sensory loss must actively reconstruct their understanding of the world, mapping the contours of their new, altered reality."
diff --git a/harper-core/src/linting/weir_rules/ThoughtProcess.weir b/harper-core/src/linting/weir_rules/ThoughtProcess.weir
new file mode 100644
index 000000000..307f379aa
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ThoughtProcess.weir
@@ -0,0 +1,7 @@
+expr main (though process)
+
+let message "Did you mean `thought process`?"
+let description "Changes `though process` to `thought process`."
+let kind "Typo"
+let becomes "thought process"
+
diff --git a/harper-core/src/linting/weir_rules/TickingTimeClock.weir b/harper-core/src/linting/weir_rules/TickingTimeClock.weir
new file mode 100644
index 000000000..c81fc2774
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/TickingTimeClock.weir
@@ -0,0 +1,9 @@
+expr main (ticking time clock)
+
+let message "Use `ticking time bomb` for disastrous consequences, otherwise avoid redundancy with just `ticking clock`."
+let description "Corrects `ticking time clock` to `ticking time bomb` for idiomatic urgency or `ticking clock` otherwise."
+let kind "Usage"
+let becomes ["ticking time bomb", "ticking clock"]
+
+test "One element that can help up the stakes (and tension!) is a \“ticking time clock.\”" "One element that can help up the stakes (and tension!) is a \“ticking time bomb.\”"
+test "The opportunity itself has a ticking time clock as all great opportunities do." "The opportunity itself has a ticking clock as all great opportunities do."
diff --git a/harper-core/src/linting/weir_rules/ToDoHyphen.weir b/harper-core/src/linting/weir_rules/ToDoHyphen.weir
new file mode 100644
index 000000000..1bbc39437
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ToDoHyphen.weir
@@ -0,0 +1,6 @@
+expr main (todo)
+
+let message "Hyphenate `to-do`."
+let description "Ensures `to-do` is correctly hyphenated."
+let becomes "to-do"
+
diff --git a/harper-core/src/linting/weir_rules/ToGreatLengths.weir b/harper-core/src/linting/weir_rules/ToGreatLengths.weir
new file mode 100644
index 000000000..59decea3e
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ToGreatLengths.weir
@@ -0,0 +1,8 @@
+expr main [(through great lengths), (to a great length)]
+
+let message "The idiom is to go `to great lengths`."
+let description "Corrects `through great lengths` to `to great lengths`."
+let becomes "to great lengths"
+
+test "Bloomberg's sponsored paid for content goes through great lengths to market Nvidia's products and in particular its AI products that we've frequently criticized." "Bloomberg's sponsored paid for content goes to great lengths to market Nvidia's products and in particular its AI products that we've frequently criticized."
+test "While ratatui-image goes to a great length to detect a rendered image's pixel size in terms of \"character cells that will be covered\", via font pixel size detection, ultimately it's up to the terminal emulator to decide what exactly a pixel is." "While ratatui-image goes to great lengths to detect a rendered image's pixel size in terms of \"character cells that will be covered\", via font pixel size detection, ultimately it's up to the terminal emulator to decide what exactly a pixel is."
diff --git a/harper-core/src/linting/weir_rules/ToTheMannerBorn.weir b/harper-core/src/linting/weir_rules/ToTheMannerBorn.weir
new file mode 100644
index 000000000..6be7771a8
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ToTheMannerBorn.weir
@@ -0,0 +1,7 @@
+expr main (to the manor born)
+
+let message "Use the correct phrase for being naturally suited to something."
+let description "Corrects `to the manor born` to `to the manner born`, ensuring the intended meaning of being naturally suited to a way of life."
+let kind "Eggcorn"
+let becomes "to the manner born"
+
diff --git a/harper-core/src/linting/weir_rules/ToWorryAbout.weir b/harper-core/src/linting/weir_rules/ToWorryAbout.weir
new file mode 100644
index 000000000..87657f3a7
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ToWorryAbout.weir
@@ -0,0 +1,8 @@
+expr main (to worried about)
+
+let message "Did you mean the progressive form?"
+let description "Fixes incorrect use of `to worried about`."
+let becomes ["to worry about", "too worried about"]
+
+test "I don't want you to worried about it." "I don't want you to worry about it."
+test "I don't want you to worried about it." "I don't want you too worried about it."
diff --git a/harper-core/src/linting/weir_rules/TongueInCheek.weir b/harper-core/src/linting/weir_rules/TongueInCheek.weir
new file mode 100644
index 000000000..262943bc9
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/TongueInCheek.weir
@@ -0,0 +1,17 @@
+expr main (tongue and cheek)
+
+let message "Use `tongue in cheek` for the idiom."
+let description "Corrects the idiom when `and` replaces the needed preposition."
+let kind "WordChoice"
+let becomes "tongue in cheek"
+
+test "The remark was entirely tongue and cheek." "The remark was entirely tongue in cheek."
+test "It was a tongue and cheek response." "It was a tongue in cheek response."
+test "He delivered it tongue and cheek, expecting a laugh." "He delivered it tongue in cheek, expecting a laugh."
+test "\"tongue and cheek\" jokes are tough to read." "\"tongue in cheek\" jokes are tough to read."
+test "Their tone was TONGUE AND CHEEK all night." "Their tone was TONGUE IN CHEEK all night."
+test "Tongue and cheek banter kept the meeting light." "Tongue in cheek banter kept the meeting light."
+test "Her note (totally tongue and cheek) made us smile." "Her note (totally tongue in cheek) made us smile."
+test "Was that tongue and cheek or sincere?" "Was that tongue in cheek or sincere?"
+test "Their comments were deliberately tongue in cheek." "Their comments were deliberately tongue in cheek."
+test "That was a tongue-in-cheek reply." "That was a tongue-in-cheek reply."
diff --git a/harper-core/src/linting/weir_rules/Towards.weir b/harper-core/src/linting/weir_rules/Towards.weir
new file mode 100644
index 000000000..8c367216c
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/Towards.weir
@@ -0,0 +1,7 @@
+expr main (to towards)
+
+let message "Use `towards` without the preceding `to`."
+let description "Removes redundant `to` before `towards`."
+let kind "Redundancy"
+let becomes "towards"
+
diff --git a/harper-core/src/linting/weir_rules/TrialAndError.weir b/harper-core/src/linting/weir_rules/TrialAndError.weir
new file mode 100644
index 000000000..405022c79
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/TrialAndError.weir
@@ -0,0 +1,8 @@
+expr main (trail and error)
+
+let message "You misspelled `trial`."
+let description "Corrects `trail` to `trial` in `trial and error`."
+let kind "Typo"
+let becomes "trial and error"
+
+test "It was produced through trail and error." "It was produced through trial and error."
diff --git a/harper-core/src/linting/weir_rules/TurnItOff.weir b/harper-core/src/linting/weir_rules/TurnItOff.weir
new file mode 100644
index 000000000..4c586c5f6
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/TurnItOff.weir
@@ -0,0 +1,12 @@
+expr main [(turn it of), (turn i of)]
+
+let message "Did you mean `turn it off`?"
+let description "Fixes the mistake in the phrase `turn it off`."
+let kind "Typo"
+let becomes "turn it off"
+
+test "Turn it of" "Turn it off"
+test "Turn i of" "Turn it off"
+test "turn it off" "turn it off"
+test "Turn it off" "Turn it off"
+test "run by one" "run by one"
diff --git a/harper-core/src/linting/weir_rules/Unless.weir b/harper-core/src/linting/weir_rules/Unless.weir
new file mode 100644
index 000000000..6c818314e
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/Unless.weir
@@ -0,0 +1,8 @@
+expr main (unless if)
+
+let message "`Unless if` is not idiomatic English. `Unless`, `except if`, and `except when` express a condition that is true in all cases except one."
+let description "Corrects `unless if`."
+let kind "Usage"
+let becomes ["unless", "except if", "except when"]
+
+test "Simplex does not interpret the following invite link as an invite link unless if it has https:// in front of it." "Simplex does not interpret the following invite link as an invite link unless it has https:// in front of it."
diff --git a/harper-core/src/linting/weir_rules/WantBe.weir b/harper-core/src/linting/weir_rules/WantBe.weir
new file mode 100644
index 000000000..6ff575f71
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/WantBe.weir
@@ -0,0 +1,6 @@
+expr main (want be)
+
+let message "Did you mean `won't be` or `want to be`?"
+let description "Detects incorrect usage of `want be` and suggests `won't be` or `want to be` based on context."
+let becomes ["won't be", "want to be"]
+
diff --git a/harper-core/src/linting/weir_rules/WaveFunction.weir b/harper-core/src/linting/weir_rules/WaveFunction.weir
new file mode 100644
index 000000000..94e7cb9f4
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/WaveFunction.weir
@@ -0,0 +1,7 @@
+expr main (wavefunction)
+
+let message "Did you mean `wave function`?"
+let description "Identifies the mistake of merging `wave` and `function` into one word. In quantum mechanics, a `wave function` (written as two words) describes the mathematical function that represents the quantum state of a particle or system. Correct usage is crucial for clear and accurate scientific communication."
+let kind "WordChoice"
+let becomes "wave function"
+
diff --git a/harper-core/src/linting/weir_rules/WellBeing.weir b/harper-core/src/linting/weir_rules/WellBeing.weir
new file mode 100644
index 000000000..78d199c31
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/WellBeing.weir
@@ -0,0 +1,7 @@
+expr main (wellbeing)
+
+let message "Use the hyphenated form for `well-being`."
+let description "Ensures `well-being` is correctly hyphenated."
+let kind "Punctuation"
+let becomes "well-being"
+
diff --git a/harper-core/src/linting/weir_rules/WellKept.weir b/harper-core/src/linting/weir_rules/WellKept.weir
new file mode 100644
index 000000000..ef04f10c2
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/WellKept.weir
@@ -0,0 +1,9 @@
+expr main [(highly-kept), (highly kept)]
+
+let message "`Highly-kept` is not standard. To describe secrets, `well-kept` is the most used phrase."
+let description "Flags `highly-kept` and recommends `well-kept` as an alternative."
+let kind "Usage"
+let becomes "well-kept"
+
+test "I assure you that frequency/angle dependence is a highly kept secret." "I assure you that frequency/angle dependence is a well-kept secret."
+test "Well, Kushina's giving birth was already a highly-kept secret so it makes sense to operate with only the completely necessary personnel." "Well, Kushina's giving birth was already a well-kept secret so it makes sense to operate with only the completely necessary personnel."
diff --git a/harper-core/src/linting/weir_rules/WhetYourAppetite.weir b/harper-core/src/linting/weir_rules/WhetYourAppetite.weir
new file mode 100644
index 000000000..375d0381c
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/WhetYourAppetite.weir
@@ -0,0 +1,7 @@
+expr main (wet your appetite)
+
+let message "Use the correct phrase for stimulating desire."
+let description "Ensures `whet your appetite` is used correctly, distinguishing it from the incorrect `wet` variation."
+let kind "Eggcorn"
+let becomes "whet your appetite"
+
diff --git a/harper-core/src/linting/weir_rules/WillContain.weir b/harper-core/src/linting/weir_rules/WillContain.weir
new file mode 100644
index 000000000..e8dcb1e47
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/WillContain.weir
@@ -0,0 +1,7 @@
+expr main (will contains)
+
+let message "Did you mean `will contain`?"
+let description "Incorrect verb form: `will` should be followed by the base form `contain`."
+let kind "Agreement"
+let becomes "will contain"
+
diff --git a/harper-core/src/linting/weir_rules/WorstCaseScenario.weir b/harper-core/src/linting/weir_rules/WorstCaseScenario.weir
new file mode 100644
index 000000000..47bc3d1a1
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/WorstCaseScenario.weir
@@ -0,0 +1,10 @@
+expr main [(worst case scenario), (worst-case-scenario)]
+
+let message "Hyphenate `worst-case`."
+let description "Corrects `worst-case scenario` when the hyphen is missing or `worse` is used instead of `worst`."
+let kind "Punctuation"
+let becomes "worst-case scenario"
+
+test "The worst case scenario can be calculated without looking at streams of data." "The worst-case scenario can be calculated without looking at streams of data."
+test "CAPD worst-case-scenario cloud simulator for naughty clouds." "CAPD worst-case scenario cloud simulator for naughty clouds."
+test "Those are now on hold for month." "Those are now on hold for month."
diff --git a/harper-core/src/linting/weir_rules/WroughtIron.weir b/harper-core/src/linting/weir_rules/WroughtIron.weir
new file mode 100644
index 000000000..805bfb6c0
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/WroughtIron.weir
@@ -0,0 +1,10 @@
+expr main [(rod iron), (rot iron), (rod-iron), (rot-iron)]
+
+let message "Prefer the standard term `wrought iron`."
+let description "`Wrought iron` is low-carbon, malleable iron used for decorative work; variants like `rod iron` or `rot iron` are phonetic misspellings that may confuse readers."
+let kind "Eggcorn"
+let becomes "wrought iron"
+
+test "The gate was crafted from rod iron." "The gate was crafted from wrought iron."
+test "The artisan works in rot iron." "The artisan works in wrought iron."
+test "She specialized in wrought iron artwork." "She specialized in wrought iron artwork."
diff --git a/harper-core/src/linting/weir_rules/mod.rs b/harper-core/src/linting/weir_rules/mod.rs
new file mode 100644
index 000000000..b2ae0f02f
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/mod.rs
@@ -0,0 +1,39 @@
+use super::LintGroup;
+use crate::weir::WeirLinter;
+
+macro_rules! generate_boilerplate {
+ ([$($name:ident),+ $(,)?]) => {
+ pub fn lint_group() -> LintGroup {
+ let mut group = LintGroup::default();
+
+ {
+ $(
+ group.add_chunk_expr_linter(stringify!($name), WeirLinter::new(include_str!(concat!(env!("WEIR_RULE_DIR"), "/", stringify!($name), ".weir"))).unwrap());
+ )+
+ }
+
+ group.set_all_rules_to(Some(true));
+
+ group
+ }
+
+ #[cfg(test)]
+ mod tests {
+ use paste::paste;
+ use crate::weir::tests::assert_passes_all;
+ use crate::weir::WeirLinter;
+
+ $(
+ paste! {
+ #[test]
+ fn [<run_tests_for_ $name:snake>](){
+ let mut linter = WeirLinter::new(include_str!(concat!(env!("WEIR_RULE_DIR"), "/", stringify!($name), ".weir"))).unwrap();
+ assert_passes_all(&mut linter);
+ }
+ }
+ )+
+ }
+ };
+}
+
+include!(env!("WEIR_RULE_LIST"));
diff --git a/harper-core/src/parsers/plain_english.rs b/harper-core/src/parsers/plain_english.rs
index 8f6acd0f5..f36f15b59 100644
--- a/harper-core/src/parsers/plain_english.rs
+++ b/harper-core/src/parsers/plain_english.rs
@@ -1,5 +1,5 @@
use super::Parser;
-use crate::lexing::{FoundToken, lex_token};
+use crate::lexing::{FoundToken, lex_english_token};
use crate::{Span, Token};
/// A parser that will attempt to lex as many tokens as possible,
@@ -19,7 +19,7 @@ impl Parser for PlainEnglish {
return tokens;
}
- if let Some(FoundToken { token, next_index }) = lex_token(&source[cursor..]) {
+ if let Some(FoundToken { token, next_index }) = lex_english_token(&source[cursor..]) {
tokens.push(Token {
span: Span::new(cursor, cursor + next_index),
kind: token,
diff --git a/harper-core/src/token_kind.rs b/harper-core/src/token_kind.rs
index aa7298a03..125644141 100644
--- a/harper-core/src/token_kind.rs
+++ b/harper-core/src/token_kind.rs
@@ -198,6 +198,14 @@ impl TokenKind {
matches!(self, TokenKind::Punctuation(Punctuation::CloseSquare))
}
+ pub fn is_less_than(&self) -> bool {
+ matches!(self, TokenKind::Punctuation(Punctuation::LessThan))
+ }
+
+ pub fn is_greater_than(&self) -> bool {
+ matches!(self, TokenKind::Punctuation(Punctuation::GreaterThan))
+ }
+
pub fn is_open_round(&self) -> bool {
matches!(self, TokenKind::Punctuation(Punctuation::OpenRound))
}
diff --git a/harper-core/src/weir/ast.rs b/harper-core/src/weir/ast.rs
new file mode 100644
index 000000000..2f74bd8cc
--- /dev/null
+++ b/harper-core/src/weir/ast.rs
@@ -0,0 +1,177 @@
+use harper_brill::UPOS;
+use is_macro::Is;
+use itertools::Itertools;
+
+use crate::expr::{Expr, Filter, FirstMatchOf, SequenceExpr, UnlessStep};
+use crate::patterns::{AnyPattern, DerivedFrom, UPOSSet, WhitespacePattern, Word};
+use crate::{CharString, Punctuation, Token};
+
+#[derive(Debug, Clone, Eq, PartialEq)]
+pub struct Ast {
+ pub stmts: Vec<AstStmtNode>,
+}
+
+impl Ast {
+ /// Construct a new abstract syntax tree from individual statements.
+ pub fn new(stmts: Vec<AstStmtNode>) -> Self {
+ Self { stmts }
+ }
+
+ /// Get the value of a variable from the last time it was set.
+ pub fn get_variable_value(&self, var_name: &str) -> Option<&'_ AstVariable> {
+ for stmt in self.stmts.iter().rev() {
+ if let AstStmtNode::DeclareVariable { name, value } = stmt
+ && name == var_name
+ {
+ return Some(value);
+ }
+ }
+ None
+ }
+
+ /// Get the value of an expression from the last time it was set.
+ pub fn get_expr(&self, expr_name: &str) -> Option<&'_ AstExprNode> {
+ for stmt in self.stmts.iter().rev() {
+ if let AstStmtNode::SetExpr { name, value } = stmt
+ && name == expr_name
+ {
+ return Some(value);
+ }
+ }
+ None
+ }
+
+ /// Iterate through all unique variable values, from the last time they were set.
+ pub fn iter_variable_values(&self) -> impl Iterator<Item = (&str, &AstVariable)> {
+ self.stmts
+ .iter()
+ .rev()
+ .filter_map(|n| match n {
+ AstStmtNode::DeclareVariable { name, value } => Some((name.as_str(), value)),
+ _ => None,
+ })
+ .unique_by(|(n, _)| *n)
+ }
+
+ /// Iterate through all the tests in the tree, starting with the one first declared in the
+ /// tree.
+ pub fn iter_tests(&self) -> impl Iterator<Item = (&str, &str)> {
+ self.stmts.iter().filter_map(|stmt| {
+ if let AstStmtNode::Test { expect, to_be } = stmt {
+ Some((expect.as_str(), to_be.as_str()))
+ } else {
+ None
+ }
+ })
+ }
+}
+
+/// A node that represents an expression that can be used to search through natural language.
+#[derive(Debug, Clone, Is, Eq, PartialEq)]
+pub enum AstExprNode {
+ Whitespace,
+ /// A progressive verb.
+ Progressive,
+ UPOSSet(Vec<UPOS>),
+ Word(CharString),
+ DerivativeOf(CharString),
+ Punctuation(Punctuation),
+ Not(Box<AstExprNode>),
+ Seq(Vec<AstExprNode>),
+ Arr(Vec<AstExprNode>),
+ Filter(Vec<AstExprNode>),
+ Anything,
+}
+
+impl AstExprNode {
+ /// Create an actual expression that fulfills the pattern matching contract defined by this tree.
+ pub fn to_expr(&self) -> Box<dyn Expr> {
+ match self {
+ AstExprNode::Anything => Box::new(AnyPattern),
+ AstExprNode::Progressive => {
+ Box::new(|tok: &Token, _: &[char]| tok.kind.is_verb_progressive_form())
+ }
+ AstExprNode::UPOSSet(upos) => Box::new(UPOSSet::new(upos)),
+ AstExprNode::Whitespace => Box::new(WhitespacePattern),
+ AstExprNode::Word(word) => Box::new(Word::from_chars(word)),
+ AstExprNode::DerivativeOf(word) => Box::new(DerivedFrom::new_from_chars(word)),
+ AstExprNode::Not(ast_node) => Box::new(UnlessStep::new(
+ ast_node.to_expr(),
+ |_tok: &Token, _: &[char]| true,
+ )),
+ AstExprNode::Seq(children) => {
+ let mut expr = SequenceExpr::default();
+
+ for node in children {
+ expr = expr.then_boxed(node.to_expr());
+ }
+
+ Box::new(expr)
+ }
+ AstExprNode::Arr(children) => {
+ let mut expr = FirstMatchOf::default();
+
+ for node in children {
+ expr.add_boxed(node.to_expr());
+ }
+
+ Box::new(expr)
+ }
+ AstExprNode::Filter(children) => {
+ Box::new(Filter::new(children.iter().map(|n| n.to_expr()).collect()))
+ }
+ AstExprNode::Punctuation(punct) => {
+ let punct = *punct;
+
+ Box::new(move |tok: &Token, _: &[char]| {
+ tok.kind.as_punctuation().is_some_and(|p| *p == punct)
+ })
+ }
+ }
+ }
+}
+
+/// A variable defined by the `let` keyword.
+#[derive(Debug, Clone, Is, Eq, PartialEq)]
+pub enum AstVariable {
+ String(String),
+ Array(Vec<AstVariable>),
+}
+
+impl AstVariable {
+ pub fn create_string(val: impl ToString) -> Self {
+ Self::String(val.to_string())
+ }
+}
+
+/// An AST node that represents a top-level statement.
+#[derive(Debug, Clone, Is, Eq, PartialEq)]
+pub enum AstStmtNode {
+ DeclareVariable { name: String, value: AstVariable },
+ SetExpr { name: String, value: AstExprNode },
+ Comment(String),
+ Test { expect: String, to_be: String },
+}
+
+impl AstStmtNode {
+ pub fn create_declare_variable(name: impl ToString, value: AstVariable) -> Self {
+ Self::DeclareVariable {
+ name: name.to_string(),
+ value,
+ }
+ }
+
+ pub fn create_set_expr(name: impl ToString, value: AstExprNode) -> Self {
+ Self::SetExpr {
+ name: name.to_string(),
+ value,
+ }
+ }
+
+ pub fn create_test(expect: impl ToString, to_be: impl ToString) -> Self {
+ Self::Test {
+ expect: expect.to_string(),
+ to_be: to_be.to_string(),
+ }
+ }
+}
diff --git a/harper-core/src/weir/error.rs b/harper-core/src/weir/error.rs
new file mode 100644
index 000000000..014119d31
--- /dev/null
+++ b/harper-core/src/weir/error.rs
@@ -0,0 +1,23 @@
+use thiserror::Error;
+
+#[derive(Debug, Error)]
+pub enum Error {
+ #[error("Encountered a token that is unsupported by the parser.")]
+ UnsupportedToken(String),
+ #[error("Reached the end of the input token stream prematurely.")]
+ EndOfInput,
+ #[error("Unmatched brace")]
+ UnmatchedBrace,
+ #[error("Expected a comma here.")]
+ ExpectedComma,
+ #[error("Expected a valid keyword.")]
+ UnexpectedToken(String),
+ #[error("Expected a value to be defined.")]
+ ExpectedVariableUndefined,
+ #[error("Invalid LintKind")]
+ InvalidLintKind,
+ #[error("Invalid Replacement Strategy")]
+ InvalidReplacementStrategy,
+ #[error("Expected a variable type other than the one provided.")]
+ ExpectedDifferentVariableType,
+}
diff --git a/harper-core/src/weir/mod.rs b/harper-core/src/weir/mod.rs
new file mode 100644
index 000000000..0b03fcae4
--- /dev/null
+++ b/harper-core/src/weir/mod.rs
@@ -0,0 +1,356 @@
+mod ast;
+mod error;
+mod optimize;
+mod parsing;
+
+use std::str::FromStr;
+
+pub use error::Error;
+use is_macro::Is;
+use parsing::{parse_expr_str, parse_str};
+use strum_macros::{AsRefStr, EnumString};
+
+use crate::expr::Expr;
+use crate::linting::{Chunk, ExprLinter, Lint, LintKind, Linter, Suggestion};
+use crate::parsers::Markdown;
+use crate::spell::FstDictionary;
+use crate::{Document, Token, TokenStringExt};
+
+use self::ast::{Ast, AstVariable};
+
+pub fn weir_expr_to_expr(weir_code: &str) -> Result<Box<dyn Expr>, Error> {
+ let ast = parse_expr_str(weir_code, true)?;
+ Ok(ast.to_expr())
+}
+
+#[derive(Debug, Is, EnumString, AsRefStr)]
+enum ReplacementStrategy {
+ MatchCase,
+ Exact,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub struct TestResult {
+ expected: String,
+ got: String,
+}
+
+pub struct WeirLinter {
+ expr: Box<dyn Expr>,
+ description: String,
+ message: String,
+ strategy: ReplacementStrategy,
+ replacements: Vec<String>,
+ lint_kind: LintKind,
+ ast: Ast,
+}
+
+impl WeirLinter {
+ pub fn new(weir_code: &str) -> Result<WeirLinter, Error> {
+ let ast = parse_str(weir_code, true)?;
+
+ let main_expr_name = "main";
+ let description_name = "description";
+ let message_name = "message";
+ let lint_kind_name = "kind";
+ let replacement_name = "becomes";
+ let replacement_strat_name = "strategy";
+
+ let expr = ast
+ .get_expr(main_expr_name)
+ .ok_or(Error::ExpectedVariableUndefined)?
+ .to_expr();
+
+ let description = ast
+ .get_variable_value(description_name)
+ .ok_or(Error::ExpectedVariableUndefined)?
+ .as_string()
+ .ok_or(Error::ExpectedDifferentVariableType)?
+ .to_owned();
+
+ let message = ast
+ .get_variable_value(message_name)
+ .ok_or(Error::ExpectedVariableUndefined)?
+ .as_string()
+ .ok_or(Error::ExpectedDifferentVariableType)?
+ .to_owned();
+
+ let replacement_val = ast
+ .get_variable_value(replacement_name)
+ .ok_or(Error::ExpectedVariableUndefined)?;
+
+ let replacements = match replacement_val {
+ AstVariable::String(s) => vec![s.to_owned()],
+ AstVariable::Array(arr) => {
+ let mut out = Vec::with_capacity(arr.len());
+ for item in arr.iter().map(|v| {
+ v.as_string()
+ .cloned()
+ .ok_or(Error::ExpectedDifferentVariableType)
+ }) {
+ let item = item?;
+ out.push(item);
+ }
+ out
+ }
+ };
+
+ let replacement_strat_var = ast.get_variable_value(replacement_strat_name);
+ let replacement_strat = if let Some(replacement_strat) = replacement_strat_var {
+ let str = replacement_strat
+ .as_string()
+ .ok_or(Error::ExpectedDifferentVariableType)?;
+ ReplacementStrategy::from_str(str)
+ .ok()
+ .ok_or(Error::InvalidReplacementStrategy)?
+ } else {
+ ReplacementStrategy::MatchCase
+ };
+
+ let lint_kind_var = ast.get_variable_value(lint_kind_name);
+ let lint_kind = if let Some(lint_kind) = lint_kind_var {
+ let str = lint_kind
+ .as_string()
+ .ok_or(Error::ExpectedDifferentVariableType)?;
+ LintKind::from_string_key(str).ok_or(Error::InvalidLintKind)?
+ } else {
+ LintKind::Miscellaneous
+ };
+
+ let linter = WeirLinter {
+ strategy: replacement_strat,
+ ast,
+ expr,
+ lint_kind,
+ description,
+ message,
+ replacements,
+ };
+
+ Ok(linter)
+ }
+
+ /// Counts the total number of tests defined.
+ pub fn count_tests(&self) -> usize {
+ self.ast.iter_tests().count()
+ }
+
+ /// Runs the tests defined in the source code, returning any failing results.
+ pub fn run_tests(&mut self) -> Vec<TestResult> {
+ fn transform_nth_str(text: &str, linter: &mut impl Linter, n: usize) -> String {
+ let mut text_chars: Vec<char> = text.chars().collect();
+ let mut iter_count = 0;
+
+ loop {
+ let test = Document::new_from_vec(
+ text_chars.clone().into(),
+ &Markdown::default(),
+ &FstDictionary::curated(),
+ );
+ let lints = linter.lint(&test);
+
+ if let Some(lint) = lints.first() {
+ if let Some(suggestion) = lint.suggestions.get(n) {
+ suggestion.apply(lint.span, &mut text_chars);
+ } else {
+ break;
+ }
+ } else {
+ break;
+ }
+
+ iter_count += 1;
+ if iter_count == 100 {
+ break;
+ }
+ }
+
+ text_chars.iter().collect()
+ }
+
+ fn lint_count(text: &str, linter: &mut impl Linter) -> usize {
+ let document = Document::new_from_vec(
+ text.chars().collect::<Vec<_>>().into(),
+ &Markdown::default(),
+ &FstDictionary::curated(),
+ );
+
+ linter.lint(&document).len()
+ }
+
+ let mut results = Vec::new();
+ let tests: Vec<(String, String)> = self
+ .ast
+ .iter_tests()
+ .map(|(text, expected)| (text.to_string(), expected.to_string()))
+ .collect();
+
+ for (text, expected) in tests {
+ let zeroth = transform_nth_str(&text, self, 0);
+ let first = transform_nth_str(&text, self, 1);
+ let second = transform_nth_str(&text, self, 2);
+
+ let matched = if zeroth == expected {
+ Some(zeroth.clone())
+ } else if first == expected {
+ Some(first.clone())
+ } else if second == expected {
+ Some(second.clone())
+ } else {
+ None
+ };
+
+ match matched {
+ Some(result) => {
+ let remaining_lints = lint_count(&result, self);
+
+ if remaining_lints != 0 {
+ results.push(TestResult {
+ expected: expected.to_string(),
+ got: result,
+ });
+ }
+ }
+ None => results.push(TestResult {
+ expected: expected.to_string(),
+ got: zeroth,
+ }),
+ }
+ }
+
+ results
+ }
+}
+
+impl ExprLinter for WeirLinter {
+ type Unit = Chunk;
+
+ fn expr(&self) -> &dyn Expr {
+ &self.expr
+ }
+
+ fn match_to_lint(&self, matched_tokens: &[Token], source: &[char]) -> Option<Lint> {
+ let span = matched_tokens.span()?;
+ let orig = span.get_content(source);
+
+ let suggestions = match self.strategy {
+ ReplacementStrategy::MatchCase => self
+ .replacements
+ .iter()
+ .map(|s| Suggestion::replace_with_match_case(s.chars().collect(), orig))
+ .collect(),
+ ReplacementStrategy::Exact => self
+ .replacements
+ .iter()
+ .map(|r| Suggestion::ReplaceWith(r.chars().collect()))
+ .collect(),
+ };
+
+ Some(Lint {
+ span,
+ lint_kind: self.lint_kind,
+ suggestions,
+ message: self.message.to_owned(),
+ priority: 31,
+ })
+ }
+
+ fn description(&self) -> &str {
+ &self.description
+ }
+}
+
+#[cfg(test)]
+pub mod tests {
+ use super::{TestResult, WeirLinter};
+
+ #[track_caller]
+ pub fn assert_passes_all(linter: &mut WeirLinter) {
+ assert_eq!(Vec::<TestResult>::new(), linter.run_tests());
+ }
+
+ #[test]
+ fn simple_right_click_linter() {
+ let source = r#"
+ expr main <([right, middle, left] $click), ( )>
+ let message "Hyphenate this mouse command"
+ let description "Hyphenates right-click style mouse commands."
+ let kind "Punctuation"
+ let becomes "-"
+
+ test "Right click the icon." "Right-click the icon."
+ test "Please right click on the link." "Please right-click on the link."
+ test "They right clicked the submit button." "They right-clicked the submit button."
+ test "Right clicking the item highlights it." "Right-clicking the item highlights it."
+ test "Right clicks are tracked in the log." "Right-clicks are tracked in the log."
+ test "He RIGHT CLICKED the file." "He RIGHT-CLICKED the file."
+ test "Left click the checkbox." "Left-click the checkbox."
+ test "Middle click to open in a new tab." "Middle-click to open in a new tab."
+ "#;
+
+ let mut linter = WeirLinter::new(source).unwrap();
+ assert_passes_all(&mut linter);
+ assert_eq!(8, linter.count_tests());
+ }
+
+ #[test]
+ fn g_suite() {
+ let source = r#"
+ expr main [(G [Suite, Suit]), (Google Apps for Work)]
+ let message "Use the updated brand."
+ let description "`G Suite` or `Google Apps for Work` is now called `Google Workspace`"
+ let kind "Miscellaneous"
+ let becomes "Google Workspace"
+ let strategy "Exact"
+
+ test "We migrated from G Suite last year." "We migrated from Google Workspace last year."
+ test "This account is still labeled as Google Apps for Work." "This account is still labeled as Google Workspace."
+ test "The pricing page mentions G Suit for legacy plans." "The pricing page mentions Google Workspace for legacy plans."
+ test "New customers sign up for Google Workspace." "New customers sign up for Google Workspace."
+ "#;
+
+ let mut linter = WeirLinter::new(source).unwrap();
+
+ assert_passes_all(&mut linter);
+ assert_eq!(4, linter.count_tests());
+ }
+
+ #[test]
+ fn wildcard() {
+ let source = r#"
+ expr main <(NOUN * NOUN), (* NOUN), *>
+ let message ""
+ let description ""
+ let kind "Miscellaneous"
+ let becomes ""
+ let strategy "Exact"
+
+ test "I like trees and plants of all kinds" "I like trees plants of all kinds"
+ test "homework tempts teachers" "homework teachers"
+ "#;
+
+ let mut linter = WeirLinter::new(source).unwrap();
+
+ assert_passes_all(&mut linter);
+ assert_eq!(2, linter.count_tests());
+ }
+
+ #[test]
+ fn dashes() {
+ let source = r#"
+ expr main --
+ let message ""
+ let description ""
+ let kind "Miscellaneous"
+ let becomes "-"
+ let strategy "Exact"
+
+ test "This--and--that" "This-and-that"
+ "#;
+
+ let mut linter = WeirLinter::new(source).unwrap();
+
+ assert_passes_all(&mut linter);
+ assert_eq!(1, linter.count_tests());
+ }
+}
diff --git a/harper-core/src/weir/optimize.rs b/harper-core/src/weir/optimize.rs
new file mode 100644
index 000000000..a382d9660
--- /dev/null
+++ b/harper-core/src/weir/optimize.rs
@@ -0,0 +1,61 @@
+use super::ast::{AstExprNode, AstStmtNode};
+
+/// Optimizes the AST to use fewer nodes.
+/// Returns whether an edit was made.
+pub fn optimize(stmts: &mut Vec<AstStmtNode>) -> bool {
+ let mut edit = false;
+
+ for stmt in stmts {
+ if let AstStmtNode::SetExpr { value, .. } = stmt
+ && optimize_expr(value)
+ {
+ edit = true;
+ }
+ }
+
+ edit
+}
+
+/// Optimizes the AST of the expression to use fewer nodes.
+/// Returns whether an edit was made.
+pub fn optimize_expr(ast: &mut AstExprNode) -> bool {
+ let mut edit = false;
+ match ast {
+ AstExprNode::Not(child) => return optimize_expr(child),
+ AstExprNode::Seq(children) => {
+ if children.len() == 1 {
+ *ast = children.pop().unwrap();
+ edit = true;
+ } else {
+ children.iter_mut().for_each(|child| {
+ if optimize_expr(child) {
+ edit = true;
+ }
+ });
+ }
+ }
+ AstExprNode::Arr(children) => {
+ if children.len() == 1 {
+ *ast = children.pop().unwrap();
+ edit = true;
+ } else if !children.is_empty() && children.iter().all(|n| n.is_upos_set()) {
+ *ast = AstExprNode::UPOSSet(
+ children
+ .iter_mut()
+ .flat_map(|n| n.as_upos_set().unwrap())
+ .copied()
+ .collect(),
+ )
+ } else {
+ children.iter_mut().for_each(|child| {
+ if optimize_expr(child) {
+ edit = true;
+ }
+ });
+ }
+ }
+ _ => (),
+ }
+
+ edit
+}
diff --git a/harper-core/src/weir/parsing/expr.rs b/harper-core/src/weir/parsing/expr.rs
new file mode 100644
index 000000000..e12727290
--- /dev/null
+++ b/harper-core/src/weir/parsing/expr.rs
@@ -0,0 +1,479 @@
+use std::str::FromStr;
+
+use harper_brill::UPOS;
+
+use crate::{CharString, Currency, Punctuation, Token, TokenKind};
+
+use super::{
+ AstExprNode, Error, FoundNode, lex, locate_matching_brace, optimize_expr, parse_collection,
+};
+
+/// Parse a raw expression string.
+pub fn parse_expr_str(weir_code: &str, use_optimizer: bool) -> Result<AstExprNode, Error> {
+ let chars: CharString = weir_code.chars().collect();
+ let tokens = lex(&chars);
+
+ let seq = parse_seq(&tokens, &chars)?;
+ let mut root = AstExprNode::Seq(seq);
+
+ if use_optimizer {
+ while optimize_expr(&mut root) {}
+ }
+
+ Ok(root)
+}
+
+/// Parse a sequence of expressions, one after the other.
+pub fn parse_seq(tokens: &[Token], source: &[char]) -> Result<Vec<AstExprNode>, Error> {
+ let mut seq = Vec::new();
+
+ let mut cursor = 0;
+ while let Some(remainder) = tokens.get(cursor..)
+ && !remainder.is_empty()
+ {
+ let res = parse_single_expr(remainder, source)?;
+ seq.push(res.node);
+ cursor += res.next_idx;
+ }
+
+ Ok(seq)
+}
+
+/// Parse an individual expression.
+fn parse_single_expr(tokens: &[Token], source: &[char]) -> Result<FoundNode<AstExprNode>, Error> {
+ let cursor = 0;
+
+ let tok = tokens.get(cursor).ok_or(Error::EndOfInput)?;
+
+ match tok.kind {
+ TokenKind::Space(_) => Ok(FoundNode::new(AstExprNode::Whitespace, 1)),
+ // The derivation notation.
+ TokenKind::Punctuation(Punctuation::Currency(Currency::Dollar)) => {
+ let word_tok = tokens.get(1).ok_or(Error::EndOfInput)?;
+
+ let word = word_tok.span.get_content(source);
+ Ok(FoundNode::new(AstExprNode::DerivativeOf(word.into()), 2))
+ }
+ TokenKind::Punctuation(Punctuation::Star) => {
+ Ok(FoundNode::new(AstExprNode::Anything, 1))
+ }
+ TokenKind::Word(_) => {
+ let text = tok.span.get_content_string(source);
+
+ if let Ok(upos) = UPOS::from_str(&text){
+ Ok(FoundNode::new(
+ AstExprNode::UPOSSet(vec![upos]),
+ 1,
+ ))
+ }else{
+ let node = match text.as_str() {
+ "PROG" => AstExprNode::Progressive,
+ _ => AstExprNode::Word(text.chars().collect()),
+ };
+
+ Ok(FoundNode::new(
+ node,
+ 1,
+ ))
+ }
+ }
+ ,
+ // The sequence notation. Useful for representing strings.
+ TokenKind::Punctuation(Punctuation::OpenRound) => {
+ let close_idx =
+ locate_matching_brace(tokens, TokenKind::is_open_round, TokenKind::is_close_round)
+ .ok_or(Error::UnmatchedBrace)?;
+ let child = parse_seq(&tokens[1..close_idx], source)?;
+ Ok(FoundNode::new(AstExprNode::Seq(child), close_idx + 1))
+ }
+ // The _not_ or _unless_ notation
+ TokenKind::Punctuation(Punctuation::Bang) => {
+ let res = parse_single_expr(&tokens[1..], source)?;
+
+ Ok(FoundNode::new(
+ AstExprNode::Not(Box::new(res.node)),
+ res.next_idx + 1,
+ ))
+ }
+ // The array notation
+ TokenKind::Punctuation(Punctuation::OpenSquare) => {
+ let close_idx = locate_matching_brace(
+ tokens,
+ TokenKind::is_open_square,
+ TokenKind::is_close_square,
+ )
+ .ok_or(Error::UnmatchedBrace)?;
+
+ let children = parse_collection(&tokens[1..close_idx], source, parse_single_expr)?;
+
+ Ok(FoundNode::new(AstExprNode::Arr(children), close_idx + 1))
+ }
+ // The filter notation
+ TokenKind::Punctuation(Punctuation::LessThan) => {
+ let close_idx =
+ locate_matching_brace(tokens, TokenKind::is_less_than, TokenKind::is_greater_than)
+ .ok_or(Error::UnmatchedBrace)?;
+
+ let children = parse_collection(&tokens[1..close_idx], source, parse_single_expr)?;
+
+ Ok(FoundNode::new(AstExprNode::Filter(children), close_idx + 1))
+ }
+
+ TokenKind::Punctuation(p) => Ok(FoundNode::new(AstExprNode::Punctuation(p), 1)),
+ _ => Err(Error::UnsupportedToken(tok.span.get_content_string(source))),
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ use harper_brill::UPOS;
+
+ use crate::Punctuation;
+ use crate::char_string::char_string;
+
+ use super::{AstExprNode, parse_expr_str};
+
+ #[test]
+ fn parses_whitespace() {
+ assert_eq!(parse_expr_str(" ", true).unwrap(), AstExprNode::Whitespace)
+ }
+
+ #[test]
+ fn parses_word() {
+ assert_eq!(
+ parse_expr_str("word", true).unwrap(),
+ AstExprNode::Word(char_string!("word"))
+ )
+ }
+
+ #[test]
+ fn parses_word_space() {
+ assert_eq!(
+ parse_expr_str("word ", true).unwrap(),
+ AstExprNode::Seq(vec![
+ AstExprNode::Word(char_string!("word")),
+ AstExprNode::Whitespace
+ ])
+ )
+ }
+
+ #[test]
+ fn parses_word_space_word() {
+ assert_eq!(
+ parse_expr_str("word word", true).unwrap(),
+ AstExprNode::Seq(vec![
+ AstExprNode::Word(char_string!("word")),
+ AstExprNode::Whitespace,
+ AstExprNode::Word(char_string!("word")),
+ ])
+ )
+ }
+
+ #[test]
+ fn parses_simple_seq() {
+ assert_eq!(
+ parse_expr_str("a (b c) d", false).unwrap(),
+ AstExprNode::Seq(vec![
+ AstExprNode::Word(char_string!("a")),
+ AstExprNode::Whitespace,
+ AstExprNode::Seq(vec![
+ AstExprNode::Word(char_string!("b")),
+ AstExprNode::Whitespace,
+ AstExprNode::Word(char_string!("c")),
+ ]),
+ AstExprNode::Whitespace,
+ AstExprNode::Word(char_string!("d")),
+ ])
+ )
+ }
+
+ #[test]
+ fn parses_nested_seqs() {
+ assert_eq!(
+ parse_expr_str("a (b (c)) d", false).unwrap(),
+ AstExprNode::Seq(vec![
+ AstExprNode::Word(char_string!("a")),
+ AstExprNode::Whitespace,
+ AstExprNode::Seq(vec![
+ AstExprNode::Word(char_string!("b")),
+ AstExprNode::Whitespace,
+ AstExprNode::Seq(vec![AstExprNode::Word(char_string!("c")),]),
+ ]),
+ AstExprNode::Whitespace,
+ AstExprNode::Word(char_string!("d")),
+ ])
+ )
+ }
+
+ #[test]
+ fn parses_paired_seqs() {
+ assert_eq!(
+ parse_expr_str("a (b) (c) d", false).unwrap(),
+ AstExprNode::Seq(vec![
+ AstExprNode::Word(char_string!("a")),
+ AstExprNode::Whitespace,
+ AstExprNode::Seq(vec![AstExprNode::Word(char_string!("b")),]),
+ AstExprNode::Whitespace,
+ AstExprNode::Seq(vec![AstExprNode::Word(char_string!("c")),]),
+ AstExprNode::Whitespace,
+ AstExprNode::Word(char_string!("d")),
+ ])
+ )
+ }
+
+ #[test]
+ fn parses_not() {
+ assert_eq!(
+ parse_expr_str("a !b c", false).unwrap(),
+ AstExprNode::Seq(vec![
+ AstExprNode::Word(char_string!("a")),
+ AstExprNode::Whitespace,
+ AstExprNode::Not(Box::new(AstExprNode::Word(char_string!("b")))),
+ AstExprNode::Whitespace,
+ AstExprNode::Word(char_string!("c")),
+ ])
+ )
+ }
+
+ #[test]
+ fn parses_not_seq() {
+ assert_eq!(
+ parse_expr_str("a !(b c) d", false).unwrap(),
+ AstExprNode::Seq(vec![
+ AstExprNode::Word(char_string!("a")),
+ AstExprNode::Whitespace,
+ AstExprNode::Not(Box::new(AstExprNode::Seq(vec![
+ AstExprNode::Word(char_string!("b")),
+ AstExprNode::Whitespace,
+ AstExprNode::Word(char_string!("c")),
+ ]),)),
+ AstExprNode::Whitespace,
+ AstExprNode::Word(char_string!("d")),
+ ])
+ )
+ }
+
+ #[test]
+ fn parses_empty_array() {
+ assert_eq!(
+ parse_expr_str("[]", true).unwrap(),
+ AstExprNode::Arr(vec![])
+ )
+ }
+
+ #[test]
+ fn parses_single_element_array() {
+ assert_eq!(
+ parse_expr_str("[a]", false).unwrap(),
+ AstExprNode::Seq(vec![AstExprNode::Arr(vec![AstExprNode::Word(
+ char_string!("a")
+ )])])
+ )
+ }
+
+ #[test]
+ fn optimizer_deconstructs_single_element_array() {
+ assert_eq!(
+ parse_expr_str("[a]", true).unwrap(),
+ AstExprNode::Word(char_string!("a"))
+ )
+ }
+
+ #[test]
+ fn optimizer_deconstructs_single_element_seq() {
+ assert_eq!(
+ parse_expr_str("(a)", true).unwrap(),
+ AstExprNode::Word(char_string!("a"))
+ )
+ }
+
+ #[test]
+ fn parses_double_element_array() {
+ assert_eq!(
+ parse_expr_str("[a, b]", true).unwrap(),
+ AstExprNode::Arr(vec![
+ AstExprNode::Word(char_string!("a")),
+ AstExprNode::Word(char_string!("b"))
+ ])
+ )
+ }
+
+ #[test]
+ fn parses_triple_element_array() {
+ assert_eq!(
+ parse_expr_str("[a, b, c]", true).unwrap(),
+ AstExprNode::Arr(vec![
+ AstExprNode::Word(char_string!("a")),
+ AstExprNode::Word(char_string!("b")),
+ AstExprNode::Word(char_string!("c"))
+ ])
+ )
+ }
+
+ #[test]
+ fn parses_not_triple_element_array() {
+ assert_eq!(
+ parse_expr_str("![a, b, c]", true).unwrap(),
+ AstExprNode::Not(Box::new(AstExprNode::Arr(vec![
+ AstExprNode::Word(char_string!("a")),
+ AstExprNode::Word(char_string!("b")),
+ AstExprNode::Word(char_string!("c"))
+ ])))
+ )
+ }
+
+ #[test]
+ fn parses_triple_dot() {
+ assert_eq!(
+ parse_expr_str("...", false).unwrap(),
+ AstExprNode::Seq(vec![
+ AstExprNode::Punctuation(Punctuation::Period),
+ AstExprNode::Punctuation(Punctuation::Period),
+ AstExprNode::Punctuation(Punctuation::Period),
+ ])
+ )
+ }
+
+ #[test]
+ fn parses_space_comma() {
+ assert_eq!(
+ parse_expr_str("[( ), (,)]", true).unwrap(),
+ AstExprNode::Arr(vec![
+ AstExprNode::Whitespace,
+ AstExprNode::Punctuation(Punctuation::Comma),
+ ])
+ )
+ }
+
+ #[test]
+ fn parses_space_dash() {
+ assert_eq!(
+ parse_expr_str("[( ), (-)]", true).unwrap(),
+ AstExprNode::Arr(vec![
+ AstExprNode::Whitespace,
+ AstExprNode::Punctuation(Punctuation::Hyphen),
+ ])
+ )
+ }
+
+ #[test]
+ fn parses_filter() {
+ assert_eq!(
+ parse_expr_str("<a, b, c>", true).unwrap(),
+ AstExprNode::Filter(vec![
+ AstExprNode::Word(char_string!("a")),
+ AstExprNode::Word(char_string!("b")),
+ AstExprNode::Word(char_string!("c")),
+ ])
+ )
+ }
+
+ #[test]
+ fn parses_filter_with_space_prefixing_element() {
+ assert_eq!(
+ parse_expr_str("< a, b, c>", true).unwrap(),
+ AstExprNode::Filter(vec![
+ AstExprNode::Word(char_string!("a")),
+ AstExprNode::Word(char_string!("b")),
+ AstExprNode::Word(char_string!("c")),
+ ])
+ )
+ }
+
+ #[test]
+ fn parses_filter_with_space_postfixing_element() {
+ assert_eq!(
+ parse_expr_str("<a, b, c >", true).unwrap(),
+ AstExprNode::Filter(vec![
+ AstExprNode::Word(char_string!("a")),
+ AstExprNode::Word(char_string!("b")),
+ AstExprNode::Word(char_string!("c")),
+ ])
+ )
+ }
+
+ #[test]
+ fn parses_derivative() {
+ assert_eq!(
+ parse_expr_str("$word", true).unwrap(),
+ AstExprNode::DerivativeOf(char_string!("word"))
+ )
+ }
+
+ #[test]
+ fn parses_derivative_seq() {
+ assert_eq!(
+ parse_expr_str("$a $b $c", true).unwrap(),
+ AstExprNode::Seq(vec![
+ AstExprNode::DerivativeOf(char_string!("a")),
+ AstExprNode::Whitespace,
+ AstExprNode::DerivativeOf(char_string!("b")),
+ AstExprNode::Whitespace,
+ AstExprNode::DerivativeOf(char_string!("c")),
+ ])
+ )
+ }
+
+ #[test]
+ fn parses_contraction() {
+ assert_eq!(
+ parse_expr_str("don't do this", true).unwrap(),
+ AstExprNode::Seq(vec![
+ AstExprNode::Word(char_string!("don't")),
+ AstExprNode::Whitespace,
+ AstExprNode::Word(char_string!("do")),
+ AstExprNode::Whitespace,
+ AstExprNode::Word(char_string!("this")),
+ ])
+ )
+ }
+
+ #[test]
+ fn parses_upos() {
+ assert_eq!(
+ parse_expr_str("PROPN NOUN VERB", false).unwrap(),
+ AstExprNode::Seq(vec![
+ AstExprNode::UPOSSet(vec![UPOS::PROPN]),
+ AstExprNode::Whitespace,
+ AstExprNode::UPOSSet(vec![UPOS::NOUN]),
+ AstExprNode::Whitespace,
+ AstExprNode::UPOSSet(vec![UPOS::VERB]),
+ ])
+ )
+ }
+
+ #[test]
+ fn optimizes_upos_set() {
+ assert_eq!(
+ parse_expr_str("[PROPN, NOUN, VERB]", true).unwrap(),
+ AstExprNode::UPOSSet(vec![UPOS::PROPN, UPOS::NOUN, UPOS::VERB]),
+ )
+ }
+
+ #[test]
+ fn parses_prog() {
+ assert_eq!(
+ parse_expr_str("PROG", true).unwrap(),
+ AstExprNode::Progressive
+ )
+ }
+
+ #[test]
+ fn parses_anything() {
+ assert_eq!(parse_expr_str("*", true).unwrap(), AstExprNode::Anything)
+ }
+
+ #[test]
+ fn parses_anything_seq() {
+ assert_eq!(
+ parse_expr_str("* * *", true).unwrap(),
+ AstExprNode::Seq(vec![
+ AstExprNode::Anything,
+ AstExprNode::Whitespace,
+ AstExprNode::Anything,
+ AstExprNode::Whitespace,
+ AstExprNode::Anything,
+ ])
+ )
+ }
+}
diff --git a/harper-core/src/weir/parsing/mod.rs b/harper-core/src/weir/parsing/mod.rs
new file mode 100644
index 000000000..fb63b0a06
--- /dev/null
+++ b/harper-core/src/weir/parsing/mod.rs
@@ -0,0 +1,158 @@
+mod expr;
+mod stmt;
+
+use super::Error;
+use ast::{Ast, AstExprNode, AstStmtNode};
+
+pub use expr::parse_expr_str;
+pub use stmt::parse_str;
+
+use crate::lexing::{FoundToken, lex_weir_token};
+use crate::{Span, Token, TokenKind};
+
+use super::{
+ ast,
+ optimize::{optimize, optimize_expr},
+};
+
+/// Lex the entirety of a Weir document.
+fn lex(source: &[char]) -> Vec<Token> {
+ let mut cursor = 0;
+
+ let mut tokens = Vec::new();
+
+ loop {
+ if cursor >= source.len() {
+ return tokens;
+ }
+
+ if let Some(FoundToken { token, next_index }) = lex_weir_token(&source[cursor..]) {
+ tokens.push(Token {
+ span: Span::new(cursor, cursor + next_index),
+ kind: token,
+ });
+ cursor += next_index;
+ } else {
+ panic!()
+ }
+ }
+}
+
+#[derive(Debug)]
+struct FoundNode<T> {
+ /// The parsed node found.
+ node: T,
+ /// The next token to be read.
+ next_idx: usize,
+}
+
+impl<T> FoundNode<T> {
+ pub fn new(node: T, next_idx: usize) -> Self {
+ Self { node, next_idx }
+ }
+}
+
+/// A utility for parsing a collection of items, separated by commas.
+/// Requires a parser used for parsing individual elements.
+fn parse_collection<T>(
+ tokens: &[Token],
+ source: &[char],
+ el_parser: impl Fn(&[Token], &[char]) -> Result<FoundNode<T>, Error>,
+) -> Result<Vec<T>, Error> {
+ let mut children = Vec::new();
+
+ let mut cursor = 0;
+
+ while cursor < tokens.len() {
+ while tokens[cursor].kind.is_space() {
+ cursor += 1;
+ }
+
+ let new_child = el_parser(&tokens[cursor..], source)?;
+ children.push(new_child.node);
+
+ cursor += new_child.next_idx;
+
+ while cursor != tokens.len() && tokens[cursor].kind.is_space() {
+ cursor += 1;
+ }
+
+ if cursor != tokens.len() && !tokens[cursor].kind.is_comma() {
+ return Err(Error::ExpectedComma);
+ }
+
+ cursor += 1;
+
+ if cursor < tokens.len() && tokens[cursor].kind.is_space() {
+ cursor += 1;
+ }
+ }
+
+ Ok(children)
+}
+
+/// Locates the closing brace for the token at index zero.
+fn locate_matching_brace(
+ tokens: &[Token],
+ is_open: impl Fn(&TokenKind) -> bool,
+ is_close: impl Fn(&TokenKind) -> bool,
+) -> Option<usize> {
+ // Locate closing brace
+ let mut visited_opens = 0;
+ let mut cursor = 1;
+
+ inc_by_spaces(&mut cursor, tokens);
+
+ loop {
+ let cur = tokens.get(cursor)?;
+
+ if is_open(&cur.kind) {
+ visited_opens += 1;
+ } else if is_close(&cur.kind) {
+ if visited_opens == 0 {
+ return Some(cursor);
+ } else {
+ visited_opens -= 1;
+ }
+ }
+
+ cursor += 1;
+ }
+}
+
+/// Increments the cursor until it is no longer over a space.
+fn inc_by_spaces(cursor: &mut usize, tokens: &[Token]) {
+ // Skip whitespace at the beginning.
+ while matches!(
+ tokens.get(*cursor).map(|t| &t.kind),
+ Some(&TokenKind::Space(..))
+ ) {
+ *cursor += 1;
+ }
+}
+
+/// Increments the cursor until it is no longer over whitespace.
+fn inc_by_whitespace(cursor: &mut usize, tokens: &[Token]) {
+ // Skip whitespace at the beginning.
+ while tokens
+ .get(*cursor)
+ .map(|t| &t.kind)
+ .is_some_and(|t| t.is_whitespace())
+ {
+ *cursor += 1;
+ }
+}
+
+/// Asserts that a space is expected in the location of the cursor.
+/// Returns the proper arrow type that can be handled with the `?` syntax.
+fn expected_space(cursor: usize, tokens: &[Token], source: &[char]) -> Result<(), Error> {
+ let expected_space = &tokens[cursor];
+
+ if !expected_space.kind.is_space() {
+ return Err(Error::UnexpectedToken(
+ expected_space.span.get_content_string(source),
+ ));
+ }
+
+ Ok(())
+}
diff --git a/harper-core/src/weir/parsing/stmt.rs b/harper-core/src/weir/parsing/stmt.rs
new file mode 100644
index 000000000..b8ec10994
--- /dev/null
+++ b/harper-core/src/weir/parsing/stmt.rs
@@ -0,0 +1,401 @@
+use super::ast::AstVariable;
+use super::inc_by_spaces;
+use crate::{CharString, CharStringExt, Punctuation, Token, TokenKind, TokenStringExt};
+
+use super::expr::parse_seq;
+use super::{
+ Ast, AstExprNode, AstStmtNode, Error, FoundNode, expected_space, inc_by_whitespace, lex,
+ locate_matching_brace, optimize, parse_collection,
+};
+
+pub fn parse_str(weir_code: &str, use_optimizer: bool) -> Result<Ast, Error> {
+ let chars: CharString = weir_code.chars().collect();
+ let tokens = lex(&chars);
+
+ let mut stmts = parse_stmt_list(&tokens, &chars)?;
+
+ if use_optimizer {
+ while optimize(&mut stmts) {}
+ }
+
+ Ok(Ast { stmts })
+}
+
+fn parse_stmt_list(tokens: &[Token], source: &[char]) -> Result<Vec<AstStmtNode>, Error> {
+ let mut list = Vec::new();
+
+ let mut cursor = 0;
+ while let Some(remainder) = tokens.get(cursor..)
+ && !remainder.is_empty()
+ {
+ let res = parse_stmt(remainder, source)?;
+ if let Some(node) = res.node {
+ list.push(node);
+ }
+ cursor += res.next_idx;
+ }
+ Ok(list)
+}
+
+fn parse_stmt(tokens: &[Token], source: &[char]) -> Result<FoundNode<Option<AstStmtNode>>, Error> {
+ let mut cursor = 0;
+ inc_by_whitespace(&mut cursor, tokens);
+
+ let end = tokens
+ .iter()
+ .enumerate()
+ .skip(cursor)
+ .find_map(|(i, t)| t.kind.is_newline().then_some(i))
+ .unwrap_or(tokens.len());
+
+ let Some(key_token) = tokens.get(cursor) else {
+ return Ok(FoundNode {
+ node: None,
+ next_idx: cursor + 1,
+ });
+ };
+
+ match key_token.kind {
+ TokenKind::Punctuation(Punctuation::Hash) => {
+ let comment = tokens[cursor..end]
+ .span()
+ .unwrap()
+ .get_content_string(source);
+ Ok(FoundNode::new(Some(AstStmtNode::Comment(comment)), end + 2))
+ }
+ TokenKind::Word(_) => {
+ let word_literal = key_token.span.get_content(source);
+
+ match word_literal {
+ ['l', 'e', 't'] => {
+ expected_space(cursor + 1, tokens, source)?;
+ let name = tokens[cursor + 2].span.get_content_string(source);
+ expected_space(cursor + 3, tokens, source)?;
+
+ let str_res = parse_quoted_string(&tokens[cursor + 4..end], source);
+
+ if let Ok(str_contents) = str_res {
+ if tokens[str_contents.next_idx + cursor + 4..end]
+ .iter()
+ .any(|t| !t.kind.is_space())
+ {
+ return Err(Error::UnexpectedToken(
+ tokens[str_contents.next_idx + cursor + 4]
+ .span
+ .get_content_string(source),
+ ));
+ }
+
+ Ok(FoundNode::new(
+ Some(AstStmtNode::create_declare_variable(
+ name,
+ AstVariable::String(str_contents.node),
+ )),
+ end + 1,
+ ))
+ } else {
+ let open_brac_tok = &tokens[cursor + 4];
+ if !open_brac_tok.kind.is_open_square() {
+ return Err(Error::UnexpectedToken(
+ open_brac_tok.span.get_content_string(source),
+ ));
+ }
+
+ let matching = locate_matching_brace(
+ &tokens[cursor + 4..end],
+ TokenKind::is_open_square,
+ TokenKind::is_close_square,
+ )
+ .ok_or(Error::UnmatchedBrace)?
+ + cursor
+ + 4;
+
+ let elements = parse_collection(
+ &tokens[cursor + 5..matching],
+ source,
+ parse_quoted_string,
+ )?;
+
+ Ok(FoundNode::new(
+ Some(AstStmtNode::create_declare_variable(
+ name,
+ AstVariable::Array(
+ elements.into_iter().map(AstVariable::String).collect(),
+ ),
+ )),
+ end + 1,
+ ))
+ }
+ }
+ ['e', 'x', 'p', 'r'] => {
+ expected_space(cursor + 1, tokens, source)?;
+
+ Ok(FoundNode::new(
+ Some(AstStmtNode::create_set_expr(
+ tokens[cursor + 2].span.get_content_string(source),
+ AstExprNode::Seq(parse_seq(&tokens[cursor + 4..end], source)?),
+ )),
+ end + 1,
+ ))
+ }
+ ['t', 'e', 's', 't'] => {
+ let case = parse_quoted_string(&tokens[cursor + 1..], source)?;
+ cursor += 1 + case.next_idx;
+
+ expected_space(cursor, tokens, source)?;
+
+ let sol = parse_quoted_string(&tokens[cursor + 1..], source)?;
+ cursor += 1 + sol.next_idx;
+
+ if cursor != end {
+ return Err(Error::UnexpectedToken(
+ tokens[cursor].span.get_content_string(source),
+ ));
+ }
+
+ Ok(FoundNode::new(
+ Some(AstStmtNode::create_test(case.node, sol.node)),
+ end + 1,
+ ))
+ }
+ _ => Err(Error::UnexpectedToken(word_literal.to_string())),
+ }
+ }
+ _ => Err(Error::UnsupportedToken(
+ key_token.span.get_content_string(source),
+ )),
+ }
+}
+
+fn parse_quoted_string(tokens: &[Token], source: &[char]) -> Result<FoundNode<String>, Error> {
+ fn is_escaped(pos: usize, source: &[char]) -> bool {
+ if pos == 0 {
+ return false;
+ }
+ let mut i = pos;
+ let mut n = 0;
+ while i > 0 && source[i - 1] == '\\' {
+ n += 1;
+ i -= 1;
+ }
+ n % 2 == 1
+ }
+
+ let mut cursor = 0;
+
+ inc_by_spaces(&mut cursor, tokens);
+
+ let quote_tok = tokens.get(cursor).ok_or(Error::EndOfInput)?;
+ if !quote_tok.kind.is_quote() {
+ return Err(Error::UnexpectedToken(
+ quote_tok.span.get_content_string(source),
+ ));
+ }
+
+ let mut end = None;
+ for (i, tok) in tokens.iter().enumerate().skip(cursor + 1) {
+ if tok.kind.is_quote() {
+ let qpos = tok.span.start;
+ if !is_escaped(qpos, source) {
+ end = Some(i);
+ break;
+ }
+ }
+ }
+
+ let end = end.ok_or(Error::EndOfInput)?;
+
+ Ok(FoundNode {
+ node: tokens[cursor + 1..end]
+ .span()
+ .unwrap_or_default()
+ .get_content_string(source),
+ next_idx: end + 1,
+ })
+}
+
+#[cfg(test)]
+mod tests {
+ use quickcheck_macros::quickcheck;
+
+ use crate::char_string::char_string;
+
+ use super::{AstExprNode, AstStmtNode, AstVariable, parse_str};
+
+ #[test]
+ fn parses_single_var_stmt() {
+ let ast = parse_str("let test \"to be this\"", true).unwrap();
+
+ assert_eq!(
+ ast.stmts,
+ vec![AstStmtNode::create_declare_variable(
+ "test",
+ AstVariable::create_string("to be this")
+ ),]
+ );
+ assert_eq!(
+ ast.get_variable_value("test"),
+ Some(&AstVariable::create_string("to be this"))
+ );
+ }
+
+ #[test]
+ fn parses_single_var_stmt_with_lots_of_space() {
+ let ast = parse_str("let test \"to be this\"", true).unwrap();
+
+ assert_eq!(
+ ast.stmts,
+ vec![AstStmtNode::create_declare_variable(
+ "test",
+ AstVariable::create_string("to be this")
+ ),]
+ );
+ assert_eq!(
+ ast.get_variable_value("test"),
+ Some(&AstVariable::create_string("to be this"))
+ );
+ }
+
+ #[test]
+ fn parses_single_var_stmt_array() {
+ let ast = parse_str("let test [\"to be this\", \"and this\"]", true).unwrap();
+
+ let correct_var_val = AstVariable::Array(vec![
+ AstVariable::create_string("to be this"),
+ AstVariable::create_string("and this"),
+ ]);
+
+ assert_eq!(ast.get_variable_value("test"), Some(&correct_var_val));
+ assert_eq!(
+ ast.stmts,
+ vec![AstStmtNode::create_declare_variable(
+ "test",
+ correct_var_val
+ ),]
+ );
+ }
+
+ #[test]
+ fn parses_single_expr_stmt() {
+ assert_eq!(
+ parse_str("expr main word", true).unwrap().stmts,
+ vec![AstStmtNode::create_set_expr(
+ "main",
+ AstExprNode::Word(char_string!("word"))
+ )]
+ )
+ }
+
+ #[test]
+ fn parses_single_comment_stmt() {
+ assert_eq!(
+ parse_str("# this is a comment", true).unwrap().stmts,
+ vec![AstStmtNode::Comment("# this is a comment".to_string())]
+ )
+ }
+
+ #[test]
+ fn parses_single_comment_stmt_with_space_prefix() {
+ assert_eq!(
+ parse_str(" # this is a comment", true).unwrap().stmts,
+ vec![AstStmtNode::Comment("# this is a comment".to_string())]
+ )
+ }
+
+ #[test]
+ fn parses_tests() {
+ assert_eq!(
+ parse_str("test \"this is the case\" \"this is the solution\"", true)
+ .unwrap()
+ .stmts,
+ vec![AstStmtNode::create_test(
+ "this is the case",
+ "this is the solution"
+ )]
+ )
+ }
+
+ #[test]
+ fn parses_multiple_spaces_in_tests() {
+ assert_eq!(
+ parse_str(
+ "test \"this is the case\" \"this is the solution\"",
+ true
+ )
+ .unwrap()
+ .stmts,
+ vec![AstStmtNode::create_test(
+ "this is the case",
+ "this is the solution"
+ )]
+ )
+ }
+
+ #[test]
+ fn parses_comment_expr_var_together() {
+ let ast = parse_str(
+ "let test \"to be this\"\nexpr main word\n# this is a comment",
+ true,
+ )
+ .unwrap();
+
+ assert_eq!(
+ ast.stmts,
+ vec![
+ AstStmtNode::create_declare_variable(
+ "test",
+ AstVariable::create_string("to be this")
+ ),
+ AstStmtNode::create_set_expr("main", AstExprNode::Word(char_string!("word"))),
+ AstStmtNode::Comment("# this is a comment".to_string())
+ ]
+ );
+
+ assert_eq!(
+ ast.get_variable_value("test"),
+ Some(&AstVariable::create_string("to be this"))
+ );
+ assert_eq!(
+ ast.get_expr("main"),
+ Some(&AstExprNode::Word(char_string!("word")))
+ );
+ }
+
+ #[test]
+ #[should_panic]
+ fn catches_non_whitespace_after_expr() {
+ parse_str("expr+this is a test", false).unwrap();
+ }
+
+ #[test]
+ #[should_panic]
+ fn catches_non_whitespace_after_test() {
+ parse_str("test+\"\" \"\"", false).unwrap();
+ }
+
+ #[test]
+ #[should_panic]
+ fn catches_non_whitespace_between_test() {
+ parse_str("test \"\"+\"\"", false).unwrap();
+ }
+
+ #[test]
+ #[should_panic]
+ fn catches_non_whitespace_after_let() {
+ parse_str("let+var \"\"", false).unwrap();
+ }
+
+ #[test]
+ #[should_panic]
+ fn catches_non_whitespace_after_let_var() {
+ parse_str("let var+\"\"", false).unwrap();
+ }
+
+ #[quickcheck]
+ fn catches_anything_after_test(a: String) {
+ if !a.is_empty() && !a.starts_with('\n') {
+ let code = format!("test \"\" \"\"{a}");
+ assert!(parse_str(code.as_str(), false).is_err())
+ }
+ }
+}
diff --git a/harper-core/tests/text/linters/The Great Gatsby.snap.yml b/harper-core/tests/text/linters/The Great Gatsby.snap.yml
index a0e7b03d5..6e8125abe 100644
--- a/harper-core/tests/text/linters/The Great Gatsby.snap.yml
+++ b/harper-core/tests/text/linters/The Great Gatsby.snap.yml
@@ -2201,6 +2201,15 @@ Suggest:
+Lint: Grammar (31 priority)
+Message: |
+ 1839 | honey, and pour me a last drop into that there crystal glass.”
+ | ^~~~~ Did you mean `their`?
+Suggest:
+ - Replace with: “their”
+
+
+
Lint: Spelling (63 priority)
Message: |
1848 | From East Egg, then, came the Chester Beckers and the Leeches, and a man named
diff --git a/harper-pos-utils/src/upos.rs b/harper-pos-utils/src/upos.rs
index 2d5f43a2d..3c87067d4 100644
--- a/harper-pos-utils/src/upos.rs
+++ b/harper-pos-utils/src/upos.rs
@@ -2,10 +2,11 @@ use std::fmt::Display;
use is_macro::Is;
use serde::{Deserialize, Serialize};
-use strum_macros::{AsRefStr, EnumIter};
+use strum_macros::{AsRefStr, EnumIter, EnumString};
/// Represents the universal parts of speech as outlined by [universaldependencies.org](https://universaldependencies.org/u/pos/index.html).
#[derive(
+ EnumString,
Debug,
Default,
Hash,
diff --git a/packages/web/src/routes/docs/weir/+page.md b/packages/web/src/routes/docs/weir/+page.md
new file mode 100644
index 000000000..ce89b67ae
--- /dev/null
+++ b/packages/web/src/routes/docs/weir/+page.md
@@ -0,0 +1,272 @@
+# The Weir Language
+
+Most large organizations have a style guide.
+A document that decides which versions of a linguistic rule to use.
+That could be whether to use the Oxford comma, or if contractions are allowed.
+It could declare that a certain word should be capitalized in a specific context.
+
+Harper can cover *most* of the rules in *most* style guides, but there will always be outliers that we can't support (or simply don't know about).
+That is why it is critical that Harper allow individuals and organizations to define rules and conventions for Harper to enforce.
+
+## Introducing Weir
+
+The heart of Weir is an expression language that mimics the pseudocode Harper contributors tend to use when describing the Rust code they intend to write.
+
+Imagine you work at Google. You've just rebranded the "G Suite" collection of apps and services to the new name "Google Workspace".
+Before that, they were collectively named "Google Apps for Work".
+Moving forward, you don't want you or your coworkers to accidentally write "G Suite" on public documentation, because doing so might confuse users.
+To solve this, you use the following Weir rule:
+
+```plaintext
+expr main [(G [Suite, Suit]), (Google Apps for Work)]
+
+let message "Use the updated brand."
+let description "`G Suite` or `Google Apps for Work` is now called `Google Workspace`"
+let kind "Miscellaneous"
+let becomes "Google Workspace"
+```
+
+The first line describes the pattern of the problematic text.
+There are two cases here:
+
+1. The letter "G" followed by "Suite" or its misspelling "Suit"
+1. The literal phrase "Google Apps for Work"
+
+Here is a semantically equivalent example that you may find a bit easier to read:
+
+```plaintext
+ [(G Suite), (G Suit), (Google Apps for Work)]
+```
+
+The remaining lines describe:
+
+1. The message to be shown to the user when the error in encountered.
+1. A description of the rule itself, explaining why it exists.
+1. What kind of rule it is.
+1. What corrections to provide to the user.
+
+## Comments
+
+Comments are written using a single hashtag (`#`) like so:
+
+```plaintext
+# This is a comment and has no effect on the rest of the file.
+ [(G Suite), (G Suit), (Google Apps for Work)]
+```
+
+## The Various Kinds of Expressions
+
+As previously stated, Weir's expression language is the heart of the system.
+There are a few key bits of notation you should know when writing a rule.
+
+### Words
+
+A word is the simplest kind of expression.
+It is exactly what it sounds like: if a document contains a specific word, it will match.
+Note that these matches are case-insensitive.
+
+Here's an example:
+
+```plaintext
+expr main teh
+
+let message "Did you mean the definite article?"
+let description "Fixes especially common misspellings of the word `the`"
+let kind "Typo"
+let becomes "the"
+
+test "I adore teh light of the moon." "I adore the light of the moon."
+test "I adore TEH LIGHT OF THE MOON." "I adore THE LIGHT OF THE MOON."
+```
+
+When Harper encounters the literal word "teh", it will correct it directly to "the".
+We'll get to the test notation later in this document.
+
+### Sequences
+
+A sequence, notated with round braces `()`, is exactly what it sounds like.
+It is a sequence of other expressions.
+In order for a portion of a document to match against a sequence, all child expressions must match, in the sequence they are declared.
+
+It's common to see expressions that string words together in a sequence to match against specific phrases.
+
+```plaintext
+expr main (gong to)
+
+let message "Did you mean `going to`?"
+let description "Corrects `gong to` to the intended phrase `going to`."
+let kind "Typo"
+let becomes "going to"
+```
+
+If the above rule is enabled, when Harper encounters the words `gong` and `to`, separated by whitespace, Harper will replace them with "going to".
+The top-level expression assumed to be a sequence, so the first line can be replaced with this without changing the rule's behavior:
+
+```plaintext
+expr main gong to
+```
+
+### Arrays
+
+Arrays in Weir, notated with `[]`, allow Harper to search for multiple potential options at a time.
+For a document to match, it only needs to fulfill one of the options in the array.
+
+This syntax should look familiar from the first example we looked at in the introduction.
+We have multiple specific phrases we want to look for, and change all of them, should they exist, to the same thing.
+
+```plaintext
+expr main [(low hanging fruit), (low hanging fruits), (low-hanging fruits)]
+
+let message "The standard form is `low-hanging fruit` with a hyphen and singular form."
+let description "Corrects nonstandard variants of `low-hanging fruit`."
+let kind "Usage"
+let becomes "low-hanging fruit"
+```
+
+Importantly, we can refactor this into just two sequences, by moving the arrays further into the expression.
+
+```plaintext
+expr main [(low[-, ( )]hanging fruits), (low hanging fruit)]
+```
+
+### Filters
+
+Filters in Weir allow you to locate an expression, then narrow down the search to a shorter segment of that same expression.
+This can be done as many times as you like.
+The example below uses the filter syntax (the `<>`) to first select the broader phrase, then another to select the whitespace in between (that's the `( )` part).
+
+```plaintext
+expr main <([right, middle, left] $click), ( )>
+let message "Hyphenate this mouse command"
+let description "Hyphenates right-click style mouse commands."
+let kind "Punctuation"
+let becomes "-"
+
+test "Right click the icon." "Right-click the icon."
+test "Please right click on the link." "Please right-click on the link."
+test "They right clicked the submit button." "They right-clicked the submit button."
+test "Right clicking the item highlights it." "Right-clicking the item highlights it."
+test "Right clicks are tracked in the log." "Right-clicks are tracked in the log."
+test "He RIGHT CLICKED the file." "He RIGHT-CLICKED the file."
+test "Left click the checkbox." "Left-click the checkbox."
+test "Middle click to open in a new tab." "Middle-click to open in a new tab."
+```
+
+This is extremely useful for identifying exceptions to a rule, since you can include the exceptions in the first layer of the filter, then slowly become more specific.
+
+See the testing section of this document for a more detailed description of the `test` syntax.
+
+### UPOS
+
+Weir allows you to require that certain words assume a specific role in the sentence by writing the [Universal Part-Of-Speech tag](https://universaldependencies.org/u/pos/index.html), literally, in the position you wish to require it..
+For example, if you wanted to locate phrases that start with a determiner and are succeeded by a noun, you can write:
+
+```plaintext
+expr main DET NOUN
+```
+
+This will match against "the word", "a banana", "an apple", among others.
+
+### Progressive Verbs
+
+You can require that a token be a progressive word with the keyword PROG.
+For example:
+
+```plaintext
+expr main PROG
+```
+
+### Exceptions
+
+You can add exceptions to expressions by throwing an exclamation mark in front of any other expression.
+This is useful for excluding certain contexts from a match.
+For example, if we wanted to locate all determiners when they are not followed by a noun, we can do this:
+
+```
+expr main DET !NOUN
+```
+
+Similarly, we can do the same with arrays or sequences of words:
+
+```
+expr main DET ![break, braking]
+```
+
+### Wildcards
+
+If you need to allow a token between two others, or otherwise want to include an unknown and unrestricted token in the expression, you can use a wildcard.
+Although they look like the single-character wildcard from regex (Weir borrows the `*` syntax), Weir wildcards match over entire tokens, including words, punctuation, and whitespace.
+
+Example:
+
+```weir
+# To match any token that is preceded by a noun and succeeded by a noun.
+expr main NOUN * NOUN
+```
+
+### Punctuation
+
+Any punctuation that does not otherwise hold semantic meaning in Weir (like wildcards, etc.) is an expression that matches itself.
+That means you can match a period with `.` or a question mark with `?`.
+
+```
+# Looks for all doubled hyphens.
+expr main --
+
+let message "The second mark is redundant."
+let description "Looks for redundant doubling of hyphens."
+let kind "Punctuation"
+let becomes "-"
+```
+
+## Adding Tests
+
+The Weir language supports the inclusion of tests directly in the file.
+You can imagine these to be a lot like assertions.
+It is a way of saying, "I expect this rule to transform this text into this other text."
+
+It is pretty much always a good idea to include tests, just to make sure your rule does what you expect.
+
+The syntax is pretty simple:
+
+```plaintext
+# I expect A to become B
+test "A" "B"
+```
+
+You can also assert that the rule _will not_ change anything.
+
+```plaintext
+# I don't expect the rule to change anything
+test "A" "A"
+```
+
+In the future, expect new types of tests to become available.
+
+If you have `harper-cli` available, you can run the tests in a given Weir file by running `harper-cli test <path to the Weir file>`.
+
+## See Also:
+
+- [Building the Weir Language](https://elijahpotter.dev/articles/building-the-weir-language)
+- [Updates on the Weir Language](https://elijahpotter.dev/articles/updates-on-the-weir-language)
+
+## Additional Examples
+
+```plaintext
+expr main (like as if)
+
+let message "Avoid redundancy. Use either `like` or `as if`."
+let description "Corrects redundant `like as if` to `like` or `as if`."
+let becomes ["like", "as if"]
+
+test "And looks like as if linux-personality hasn't got any changes for 8 years." "And looks as if linux-personality hasn't got any changes for 8 years."
+```
+
+```plaintext
+expr main (w/o)
+
+let message "Use `without` instead of `w/o`"
+let description "Expands the abbreviation `w/o` to the full word `without` for clarity."
+let kind "Style"
+let becomes "without"
+```
diff --git a/packages/web/vite.config.ts b/packages/web/vite.config.ts
index 22d8ca974..82e2062a2 100644
--- a/packages/web/vite.config.ts
+++ b/packages/web/vite.config.ts
@@ -64,6 +64,14 @@ export default defineConfig(async () => {
},
],
},
+ {
+ items: [
+ {
+ title: 'Weir',
+ to: '/docs/weir',
+ },
+ ],
+ },
{
title: 'Integrations',
items: [
diff --git a/test.md b/test.md
deleted file mode 100644
index d4f2d8bc8..000000000
--- a/test.md
+++ /dev/null
@@ -1 +0,0 @@
-Flags sentences that begin with a discourse marker but omit the required following comma.