Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
feat: Expand `conf`, `config`, `perf`, and `pref` (#3535)
Andrew Dunbar0b89f1e8893c
diff --git a/harper-core/default_config.json b/harper-core/default_config.jsonindex d09ef6de0..7afb53bfc 100644--- a/harper-core/default_config.json+++ b/harper-core/default_config.json@@ -892,9 +892,9 @@},{"Bool": {- "name": "ExpandDeref",+ "name": "ExpandDereference","state": true,- "label": "Expand Deref"+ "label": "Expand Dereference"}},{@@ -1345,6 +1345,27 @@"label": "Expand Vulnerability"}},+ {+ "Bool": {+ "name": "ExpandConfiguration",+ "state": true,+ "label": "Expand Configuration"+ }+ },+ {+ "Bool": {+ "name": "ExpandPerformance",+ "state": true,+ "label": "Expand Performance"+ }+ },+ {+ "Bool": {+ "name": "ExpandPreference",+ "state": true,+ "label": "Expand Preference"+ }+ },{"Bool": {"name": "Nowadays",diff --git a/harper-core/src/linting/phrase_set_corrections/mod.rs b/harper-core/src/linting/phrase_set_corrections/mod.rsindex c5edff1dc..f90d3813d 100644--- a/harper-core/src/linting/phrase_set_corrections/mod.rs+++ b/harper-core/src/linting/phrase_set_corrections/mod.rs@@ -223,7 +223,7 @@ pub fn lint_group() -> LintGroup {"Expands the abbreviation `deps` to the full word `dependencies` for clarity.",LintKind::Style),- "ExpandDeref" => (+ "ExpandDereference" => (&[("deref", "dereference"),("derefs", "dereferences"),diff --git a/harper-core/src/linting/weir_rules/ExpandConfiguration/Plural.weir b/harper-core/src/linting/weir_rules/ExpandConfiguration/Plural.weirnew file mode 100644index 000000000..7bbe5a3aa--- /dev/null+++ b/harper-core/src/linting/weir_rules/ExpandConfiguration/Plural.weir@@ -0,0 +1,8 @@+expr main [confs, configs]++let message "Use `configurations` instead of `configs`"+let description "Expands the abbreviation `configs` to the full word `configurations` for clarity."+let kind "Style"+let becomes "configurations"++test "Community-maintained repository offering free V2ray configs to help you browse securely and privately." "Community-maintained repository offering free V2ray configurations to help you browse securely and privately."diff --git a/harper-core/src/linting/weir_rules/ExpandConfiguration/Singular.weir b/harper-core/src/linting/weir_rules/ExpandConfiguration/Singular.weirnew file mode 100644index 000000000..6fbaadd4f--- /dev/null+++ b/harper-core/src/linting/weir_rules/ExpandConfiguration/Singular.weir@@ -0,0 +1,8 @@+expr main [config, conf]++let message "Use `configuration` instead of `config` or `conf`"+let description "Expands the abbreviation `config` or `conf` to the full word `configuration` for clarity."+let kind "Style"+let becomes "configuration"++test "If you want to load config from a database or something, you would need to write some custom code." "If you want to load configuration from a database or something, you would need to write some custom code."diff --git a/harper-core/src/linting/weir_rules/ExpandPerformance.weir b/harper-core/src/linting/weir_rules/ExpandPerformance.weirnew file mode 100644index 000000000..41ea5fe3b--- /dev/null+++ b/harper-core/src/linting/weir_rules/ExpandPerformance.weir@@ -0,0 +1,8 @@+expr main perf++let message "Use `performance` instead of `perf`"+let description "Expands the abbreviation `perf` to the full word `performance` for clarity."+let kind "Style"+let becomes "performance"++test "I have macos locally and i want to do some perf analysis." "I have macos locally and i want to do some performance analysis."\ No newline at end of filediff --git a/harper-core/src/linting/weir_rules/ExpandPreference/Plural.weir b/harper-core/src/linting/weir_rules/ExpandPreference/Plural.weirnew file mode 100644index 000000000..26e22ddd1--- /dev/null+++ b/harper-core/src/linting/weir_rules/ExpandPreference/Plural.weir@@ -0,0 +1,8 @@+expr main prefs++let message "Use `preferences` instead of `prefs`"+let description "Expands the abbreviation `prefs` to the full word `preferences` for clarity."+let kind "Style"+let becomes "preferences"++test "This tool is intended to simplify the use and tracking of prefs used by our fuzzing tools." "This tool is intended to simplify the use and tracking of preferences used by our fuzzing tools."diff --git a/harper-core/src/linting/weir_rules/ExpandPreference/Singular.weir b/harper-core/src/linting/weir_rules/ExpandPreference/Singular.weirnew file mode 100644index 000000000..c818ff99a--- /dev/null+++ b/harper-core/src/linting/weir_rules/ExpandPreference/Singular.weir@@ -0,0 +1,8 @@+expr main pref++let message "Use `preference` instead of `pref`"+let description "Expands the abbreviation `pref` to the full word `preference` for clarity."+let kind "Style"+let becomes "preference"++test "Android: Asynchronous shared pref commit race condition" "Android: Asynchronous shared preference commit race condition"diff --git a/packages/vscode-plugin/package.json b/packages/vscode-plugin/package.jsonindex 0e91c4266..fc4e0fe72 100644--- a/packages/vscode-plugin/package.json+++ b/packages/vscode-plugin/package.json@@ -1530,7 +1530,7 @@"default": true,"description": "Expands the abbreviation `deps` to the full word `dependencies` for clarity."},- "harper.linters.ExpandDeref": {+ "harper.linters.ExpandDereference": {"scope": "resource","type": "boolean","default": true,