harper icon indicating copy to clipboard operation
harper copied to clipboard

False positive: "built in" flagged to be hyphenated when the words should remain separate

Open hippietrail opened this issue 7 months ago • 3 comments

Image

Also known as the 'New Jetty', the Mixed Clan Jetty was built in 1962.

The hyphenated form "built-in" is an adjective meaning something that is an integral or permanent part of something else (e.g., a built-in feature), which does not apply here.

But in this context, "built in" is a verb phrase indicating the year the jetty was constructed, and the two words should remain separate.

The BuiltIn rule is a Weir rule. It needs to be enhanced to try to determine from the words' context whether they are used properly as a verb phrase or need to be flagged to correct to an adjective. This may or may not require upgrading the rule from Weir to Rust.

hippietrail avatar May 02 '26 08:05 hippietrail

I can work on this.

I checked BuiltIn.weir; it currently matches built in unconditionally. I’ll add a regression for verb-phrase usage like was built in 1962, then keep the fix in Weir if the context check is clean. If not, I’ll move the rule to Rust with tests.

jmolz avatar May 21 '26 17:05 jmolz

I can work on this.

I checked BuiltIn.weir; it currently matches built in unconditionally. I’ll add a regression for verb-phrase usage like was built in 1962, then keep the fix in Weir if the context check is clean. If not, I’ll move the rule to Rust with tests.

I've actually looked at this a few times and keep putting it on the back burner due to the variants and potential dialect factors. Have fun!

hippietrail avatar May 22 '26 05:05 hippietrail

Thanks. I opened #3460 with a narrow Weir fix and regression cases. Happy to adjust if there are variant or dialect cases you want covered.

jmolz avatar May 22 '26 10:05 jmolz