Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
fix(core): problems found using fuzzing
Elijah Potter1fdd601958e5
diff --git a/harper-cli/src/main.rs b/harper-cli/src/main.rsindex 72332eb5b..2d34b9f10 100644--- a/harper-cli/src/main.rs+++ b/harper-cli/src/main.rs@@ -2,6 +2,7 @@use std::collections::BTreeMap;use std::path::{Path, PathBuf};+use std::process;use anyhow::format_err;use ariadne::{Color, Label, Report, ReportKind, Source};@@ -98,7 +99,7 @@ fn main() -> anyhow::Result<()> {let report = report_builder.finish();report.print((&filename, Source::from(source)))?;- Ok(())+ process::exit(1)}Args::Parse { file } => {let (doc, _) = load_file(&file, markdown_options)?;diff --git a/harper-core/dictionary.dict b/harper-core/dictionary.dictindex fa5e79d0b..2d523e632 100644--- a/harper-core/dictionary.dict+++ b/harper-core/dictionary.dict@@ -8806,7 +8806,7 @@ Schneider/2MSchoenberg/2MSchopenhauer/2MSchrieffer/M-Schrodinger/2M+Schrödinger/2MSchroeder/2MSchubert/2MSchultz/2M@@ -10724,7 +10724,7 @@ Cloudflare/MTLS/12Everdeen/Mpseudorandom/5P-counterintuitively/+counterintuitive/YLeto/2MOuranos/MHecatoncheires/1M@@ -19205,7 +19205,7 @@ cwt/1cyan/15Mcyanide/14Mcyanobacteria/1-cyberbully/14SM+cyberbully/14SMGcybercafe/1Scybernetic/5Scyber/5@@ -35130,7 +35130,7 @@ overstay/41DSGoverstep/41Soverstepped/4overstepping/4-overstimulate/4DSG+overstimulate/4DSGXoverstock/41GSDoverstretch/41GDSoverstrict/5@@ -43714,8 +43714,8 @@ stifling/541Ystigma/1SMstigmata/1stigmatic/51-stigmatization/1M-stigmatize/4GDS+stigmatization/1CM+stigmatize/4GDSCstile/14SMstiletto/14SMstill's@@ -49964,3 +49964,26 @@ N4/2MN5/2MLenovo/2MThinkPad/2SM+interconnectedness/1+transformative/5+Spotify/2M+Waymo/2M+gameplay/1+chatbot/SM+Siri/2M+Alexa/2M+gamify/4D+perceptron/SM+telemedicine/SM+rainforest/SM+reskilling/4+overhyped/45+preloaded/54+NLP/M+overstimulation/1+VR/2M+NPC/SM+hydropower/1+IPCC/2M+AlphaFold/2M+DeepMind/2Mdiff --git a/harper-core/src/linting/phrase_corrections.rs b/harper-core/src/linting/phrase_corrections.rsindex f52ebc35a..830a95442 100644--- a/harper-core/src/linting/phrase_corrections.rs+++ b/harper-core/src/linting/phrase_corrections.rs@@ -25,7 +25,7 @@ pub fn lint_group() -> LintGroup {add_similar_mappings!(group, {"TurnItOff" => ("turn it off", 1),"HumanLife" => ("human life", 1),- "ThatChallenged" => ("that challenged", 2),+ "ThatChallenged" => ("that challenged", 1),"NoLonger" => ("no longer", 1),"NeedHelp" => ("need help", 1),"OfCourse" => ("of course", 1),@@ -228,6 +228,18 @@ pub fn lint_group() -> LintGroup {["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."+ ),+ "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."+ ),+ "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.")});