Repository navigation
feat(core): flag "tenant" where "tenet" is meant - #4425
Merged
Merged
Conversation
`tenant` (a renter) is often written where `tenet` (a principle) is meant: "the core tenants of our design". The renter reading is common in real writing, so the rule only fires after an adjective that reads as a principle and before `of` or `is`, and it leaves `of the building` style phrases alone. Run over 2,086 sentences with `tenant`/`tenants` gathered from GitHub issues and Wikipedia: 30 hits, 29 of them the mistake. Adjective plus a following non-noun, as in the earlier attempt, would have flagged about 20 real uses in the same sample (`its core tenant was a hotel`, `central tenants are in scope`). `main` and `key` are left out on purpose: 19 of their 23 `of`/`is` uses are stadiums, malls and buildings. Closes Automattic#1070
elijah-potter
approved these changes
Sep 24, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Written with LLM assistance: the Weir rules and their tests were drafted with an LLM. The approach, the corpus validation and the final wording are mine, and I've reviewed every line.
Issues
Closes #1070.
Description
tenant(a renter) gets written wheretenet(a principle) is meant: "the core tenants of our design".This adds a grouped
TenantTenetrule (singular and plural children) that fires only whentenant/tenantsfollows a principle-sense adjective —core,central,fundamental,basic,guiding,cardinal,underlying,foundational,defining— and is followed byoforis. Phrases likeof the buildingare excluded through a word list of places.The narrow shape is the point, and it comes from data rather than taste. I pulled 2,086 real sentences containing
tenant/tenantsfrom GitHub issues and Wikipedia and ran the rule over them: 30 hits, 29 of them the actual mistake. The one false positive is a Japanese shopping centre ("the core tenant of Tamagawa Takashimaya Shopping Center").The obvious wider rule does much worse on the same sample. Gating on "adjective + non-noun", which is where #3822 ended up, would have flagged around 20 legitimate uses: "its core tenant was a hotel", "Central tenants are in scope", "with two core tenants, Armstrong Marine and Winter Custom Yachts".
mainandkeyare deliberately left out. In that corpus, 19 of their 23of/isuses are stadiums, malls and office buildings — "The main tenants of the stadium are…". That does cost the rule the "main tenants of many religions" example from the issue; I'd rather miss it than flag every arena in Wikipedia.Known misses, all on purpose: sentence-final "a core tenant." (nothing follows to disambiguate) and "core tenants from day 1".
Demo
How Has This Been Tested?
42 tests across the two
.weirfiles, covering true positives, the multi-tenancy false positives, real-estate uses, casing and sentence-final forms.cargo test -p harper-corepasses, 6,559 tests, includingcurated_default_config_lists_every_registered_ruleafter adding the entry todefault_config.json.