mirror of
https://github.com/Automattic/harper.git
synced 2025-12-05 19:26:55 -06:00
fix: don't flag 'every day free' (#2260)
This commit is contained in:
@@ -420,6 +420,7 @@ impl SequenceExpr {
|
||||
|
||||
gen_then_from_is!(noun);
|
||||
gen_then_from_is!(proper_noun);
|
||||
gen_then_from_is!(plural_noun);
|
||||
gen_then_from_is!(mass_noun_only);
|
||||
|
||||
// Pronouns
|
||||
|
||||
@@ -12,7 +12,7 @@ pub struct Everyday {
|
||||
impl Default for Everyday {
|
||||
fn default() -> Self {
|
||||
let everyday = Word::new("everyday");
|
||||
let every_day = Lrc::new(SequenceExpr::default().t_aco("every").t_ws().t_aco("day"));
|
||||
let every_day = Lrc::new(SequenceExpr::aco("every").t_ws().t_aco("day"));
|
||||
|
||||
let everyday_bad_after =
|
||||
All::new(vec![
|
||||
@@ -91,7 +91,7 @@ impl Default for Everyday {
|
||||
SequenceExpr::default()
|
||||
.then(every_day.clone())
|
||||
.t_ws()
|
||||
.then_noun()
|
||||
.then_plural_noun()
|
||||
.then_punctuation(),
|
||||
),
|
||||
Box::new(
|
||||
@@ -215,7 +215,7 @@ impl ExprLinter for Everyday {
|
||||
mod tests {
|
||||
use super::Everyday;
|
||||
use crate::linting::tests::{
|
||||
assert_lint_count, assert_suggestion_result, assert_top3_suggestion_result,
|
||||
assert_lint_count, assert_no_lints, assert_suggestion_result, assert_top3_suggestion_result,
|
||||
};
|
||||
|
||||
#[test]
|
||||
@@ -506,4 +506,9 @@ mod tests {
|
||||
"MEET SOMEONE NEW EVERY DAY.",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dont_flag_every_day_singular_noun_2020() {
|
||||
assert_no_lints("50 requests per day, every day free.", Everyday::default());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user