Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
feat: constitute as→constitute (#3398)
Andrew Dunbare34bec1e7271
diff --git a/harper-core/default_config.json b/harper-core/default_config.jsonindex da81013a2..06df3ef50 100644--- a/harper-core/default_config.json+++ b/harper-core/default_config.json@@ -1316,6 +1316,13 @@"state": true,"label": "Expand Vulnerability"}+ },+ {+ "Bool": {+ "name": "ConstituteAs",+ "state": true,+ "label": "Constitute As"+ }}]}diff --git a/harper-core/src/linting/phrase_set_corrections/mod.rs b/harper-core/src/linting/phrase_set_corrections/mod.rsindex 05a2ac57c..c3e005256 100644--- a/harper-core/src/linting/phrase_set_corrections/mod.rs+++ b/harper-core/src/linting/phrase_set_corrections/mod.rs@@ -134,6 +134,17 @@ pub fn lint_group() -> LintGroup {"Corrects `conform` typos to `confirm`.",LintKind::Typo),+ "ConstituteAs" => (+ &[+ ("constitute as", "constitute"),+ ("constituted as", "constituted"),+ ("constitutes as", "constitutes"),+ ("constituting as", "constituting"),+ ],+ "`As` is extraneous after forms of `constitute`.",+ "Removes extraneous `as` after the verb `constitute`.",+ LintKind::Usage+ ),"DefiniteArticle" => (&[("definitive article", "definite article"),diff --git a/harper-core/src/linting/phrase_set_corrections/tests.rs b/harper-core/src/linting/phrase_set_corrections/tests.rsindex e5abd77a0..b2bafb9ad 100644--- a/harper-core/src/linting/phrase_set_corrections/tests.rs+++ b/harper-core/src/linting/phrase_set_corrections/tests.rs@@ -318,6 +318,55 @@ fn corrects_conforming_that() {);}+// ConstituteAs++#[test]+fn corrects_constitute_as() {+ assert_suggestion_result(+ "This doesn't really constitute as an implicit cast in the eyes of the system.",+ lint_group(),+ "This doesn't really constitute an implicit cast in the eyes of the system.",+ );+}++#[test]+fn corrects_constituted_as() {+ assert_suggestion_result(+ "We do not recommend setting the number of threads to more than 20, as that can be constituted as a denial of service attack which we are not responsible for.",+ lint_group(),+ "We do not recommend setting the number of threads to more than 20, as that can be constituted a denial of service attack which we are not responsible for.",+ );+}++#[test]+fn corrects_constitutes_as() {+ assert_suggestion_result(+ "Hello! I was just wondering what constitutes as a prompt in GitHub CoPilot that consumes premium request tokens.",+ lint_group(),+ "Hello! I was just wondering what constitutes a prompt in GitHub CoPilot that consumes premium request tokens.",+ );+}++#[test]+fn corrects_constituting_as_example() {+ assert_suggestion_result(+ "This is the example constituting as hull-demo 's values.yaml",+ lint_group(),+ "This is the example constituting hull-demo 's values.yaml",+ );+}++#[test]+#[ignore = "Not sure if this would be a false positive or a true positive"]+fn ambiguous_constituting_as() {+ assert_suggestion_result(+ "Note that spinning up a Client is a non-trivial operation, constituting as much as a millisecond of overhead.",+ lint_group(),+ // Maybe this one was supposed to be "contributing"?+ "Note that spinning up a Client is a non-trivial operation, constituting as much as a millisecond of overhead.",+ );+}+// DefiniteArticle#[test]