Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

feat: tenant → tenet after core, basic, fundamental and similar (#4425)

Víctor Jean Pierre Mandujano Gutierrez0c7c26120012
diff --git a/harper-core/default_config.json b/harper-core/default_config.json
index 8ab2d5127..167b2dc8b 100644
--- a/harper-core/default_config.json
+++ b/harper-core/default_config.json
@@ -2973,6 +2973,13 @@
"label": "Summary / Summery"
}
},
+ {
+ "Bool": {
+ "name": "TenantTenet",
+ "state": true,
+ "label": "Tenant / Tenet"
+ }
+ },
{
"Bool": {
"name": "ThatThis",
diff --git a/harper-core/src/linting/weir_rules/TenantTenet/Plural.weir b/harper-core/src/linting/weir_rules/TenantTenet/Plural.weir
new file mode 100644
index 000000000..c7bf3be7f
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/TenantTenet/Plural.weir
@@ -0,0 +1,36 @@
+# `tenet` (a principle) is often written as `tenant` (a renter). The renter
+# reading is common in real writing, so this only fires after an adjective
+# that reads as a principle and before `of` or `is`, which is where the
+# mistake shows up, and it leaves `of the building`-style phrases alone.
+expr principle [core, central, fundamental, basic, guiding, cardinal, underlying, foundational, defining]
+expr place [building, mall, tower, complex, center, centre, property, estate, park, plaza, campus, facility, development, block, house, site, premises, office, floor, space, unit, airport, hotel, stadium, arena, shopping]
+expr main <(@principle tenants [(of !(DET @place)), is]), tenants>
+
+let message "Did you mean `tenets`? A `tenant` rents a place; a `tenet` is a principle."
+let description "Flags `tenants` where `tenets` (principles) is meant, after adjectives such as `core` or `fundamental`."
+let kind "Malapropism"
+let becomes "tenets"
+let strategy "MatchCase"
+
+test "These are the core tenants of our design." "These are the core tenets of our design."
+test "One of my core tenants is honesty." "One of my core tenets is honesty."
+test "Core Tenants of Highly Effective Software Teams" "Core Tenets of Highly Effective Software Teams"
+test "The basic tenants of JSX include jumping into JavaScript at any time." "The basic tenets of JSX include jumping into JavaScript at any time."
+test "We ignored the basic tenants of a Minimum Viable Product." "We ignored the basic tenets of a Minimum Viable Product."
+test "The following are the fundamental tenants of our approach to security." "The following are the fundamental tenets of our approach to security."
+test "This breaks one of the fundamental tenants of layered APIs." "This breaks one of the fundamental tenets of layered APIs."
+test "One of Fedora's core tenants is staying close to upstream." "One of Fedora's core tenets is staying close to upstream."
+test "As one of the language's fundamental tenants is readability, this should be cleaned up." "As one of the language's fundamental tenets is readability, this should be cleaned up."
+test "One of the core tenants of KiCad is having generic symbols." "One of the core tenets of KiCad is having generic symbols."
+test "It is one of the most basic tenants of Wesleyan theology." "It is one of the most basic tenets of Wesleyan theology."
+test "THE CENTRAL TENANTS OF THE FRAMEWORK ARE SIMPLE." "THE CENTRAL TENETS OF THE FRAMEWORK ARE SIMPLE."
+
+allows "The core tenants list is stored per region."
+allows "Basic tenants rights are protected by law."
+allows "Central tenants are in scope; the rest fall back to the parent."
+allows "It anchored the facility with two core tenants, Armstrong Marine and Winter Custom Yachts."
+allows "The two core tenants of the mall moved out last year."
+allows "The main tenants of the stadium are the national football team."
+allows "Key tenants include Pfizer and Novartis."
+allows "Commercial tenants of the building pay rent monthly."
+allows "Multi-tenant deployments keep tenants isolated from each other."
diff --git a/harper-core/src/linting/weir_rules/TenantTenet/Singular.weir b/harper-core/src/linting/weir_rules/TenantTenet/Singular.weir
new file mode 100644
index 000000000..8919c1933
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/TenantTenet/Singular.weir
@@ -0,0 +1,33 @@
+# Singular form of the rule; see the plural file for the reasoning.
+expr principle [core, central, fundamental, basic, guiding, cardinal, underlying, foundational, defining]
+expr place [building, mall, tower, complex, center, centre, property, estate, park, plaza, campus, facility, development, block, house, site, premises, office, floor, space, unit, airport, hotel, stadium, arena, shopping]
+expr main <(@principle tenant of !(DET @place)), tenant>
+
+let message "Did you mean `tenet`? A `tenant` rents a place; a `tenet` is a principle."
+let description "Flags `tenant` where `tenet` (a principle) is meant, after adjectives such as `core` or `fundamental`."
+let kind "Malapropism"
+let becomes "tenet"
+let strategy "MatchCase"
+
+test "This is a core tenant of good design." "This is a core tenet of good design."
+test "Simplicity is a fundamental tenant of the project." "Simplicity is a fundamental tenet of the project."
+test "That is the central tenant of the new security model." "That is the central tenet of the new security model."
+test "The fact that you understood this core tenant of React is great." "The fact that you understood this core tenet of React is great."
+test "Multi-site management is a core tenant of the product." "Multi-site management is a core tenet of the product."
+test "It opposed the basic tenant of classicism." "It opposed the basic tenet of classicism."
+test "Universal restoration was a core tenant of her beliefs." "Universal restoration was a core tenet of her beliefs."
+test "Am I misunderstanding some core tenant of the design?" "Am I misunderstanding some core tenet of the design?"
+test "That's the core tenant of the open source movement!" "That's the core tenet of the open source movement!"
+test "A CORE TENANT OF OUR WORK IS TRUST." "A CORE TENET OF OUR WORK IS TRUST."
+
+allows "The core tenant isolation logic lives here."
+allows "Our fundamental tenant model uses row-level security."
+allows "The basic tenant configuration is in config.yaml."
+allows "The fundamental tenant in this application is a Company."
+allows "For many years its core tenant was a hotel of more than 100 rooms."
+allows "Create the core tenant and membership schema."
+allows "Whether 5 x 16-core tenant nodes fit on one physical node."
+allows "The main tenant of the building left last year."
+allows "The department store entered as core tenant, competing with its neighbours."
+allows "Requests fall back to the core tenant holder."
+allows "The core tenant of the tower is a law firm."