fix: don't flag 'every day free' (#2260)

This commit is contained in:
Andrew Dunbar
2025-11-28 15:37:58 +00:00
committed by GitHub
parent 25f2c371d9
commit 90efaf6430
2 changed files with 9 additions and 3 deletions

View File

@@ -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

View File

@@ -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());
}
}