Skip to content

Commit d77d1d2

Browse files
Merge pull request #1029 from hippietrail/adj-of-a-curation-2025-04-5
chore: "side of a" false positive
2 parents 8c215c5 + ec42c91 commit d77d1d2

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

harper-core/src/linting/adjective_of_a.rs

+32
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const FALSE_POSITIVES: &[&str] = &[
99
// Different valid constructions.
1010
"all",
1111
"emblematic",
12+
"equivalent",
1213
"full",
1314
"inside",
1415
// "more" is tricky but it often seems correct and idiomatic.
@@ -21,6 +22,7 @@ const FALSE_POSITIVES: &[&str] = &[
2122
"bit",
2223
"bottom",
2324
"chance",
25+
"derivative",
2426
"dream",
2527
"front",
2628
"half",
@@ -35,6 +37,7 @@ const FALSE_POSITIVES: &[&str] = &[
3537
"precision",
3638
// for "rid" I removed the `5` flag in `dictionary.dict``
3739
"shadow",
40+
"side",
3841
"short",
3942
"something",
4043
"sound",
@@ -416,4 +419,33 @@ mod tests {
416419
// Present participles have properties of adjectives, nouns, and verbs
417420
assert_lint_count("That's the beginning of a conversation.", AdjectiveOfA, 0);
418421
}
422+
423+
#[test]
424+
fn dont_flag_side() {
425+
// Can be an adjective in e.g. "via a side door"
426+
assert_lint_count(
427+
"it hit the barrier on the side of a highway",
428+
AdjectiveOfA,
429+
0,
430+
);
431+
}
432+
433+
#[test]
434+
fn dont_flag_derivative() {
435+
// Adj: "a derivative story", Noun: "stocks and derivatives"
436+
assert_lint_count(
437+
"Techniques for evaluating the *partial derivative of a function",
438+
AdjectiveOfA,
439+
0,
440+
)
441+
}
442+
443+
#[test]
444+
fn dont_flag_equivalent() {
445+
assert_lint_count(
446+
"Rust's equivalent of a switch statement is a match expression",
447+
AdjectiveOfA,
448+
0,
449+
);
450+
}
419451
}

0 commit comments

Comments
 (0)