From e4b3b7370df500a19152b4624e3d48a72c7418e5 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Wed, 27 Dec 2023 22:28:02 +0530 Subject: [PATCH] vale: Update configuration --- .../vale/styles/Google/Contractions.yml | 2 +- .../vale/styles/Google/Exclamation.yml | 4 ++- .../.config/vale/styles/Google/GenderBias.yml | 2 ++ vale/.config/vale/styles/Google/Headings.yml | 5 ++-- vale/.config/vale/styles/Google/Latin.yml | 4 +-- vale/.config/vale/styles/Google/Spacing.yml | 2 ++ vale/.config/vale/styles/Google/Spelling.yml | 4 ++- vale/.config/vale/styles/Google/Units.yml | 6 ++--- vale/.config/vale/styles/Google/WordList.yml | 27 ++++++++++--------- .../vale/styles/Microsoft/Contractions.yml | 2 +- .../.config/vale/styles/Microsoft/Foreign.yml | 3 ++- vale/.config/vale/styles/Microsoft/Terms.yml | 10 +++---- 12 files changed, 39 insertions(+), 32 deletions(-) diff --git a/vale/.config/vale/styles/Google/Contractions.yml b/vale/.config/vale/styles/Google/Contractions.yml index 9523498..4f6fd5d 100644 --- a/vale/.config/vale/styles/Google/Contractions.yml +++ b/vale/.config/vale/styles/Google/Contractions.yml @@ -1,5 +1,5 @@ extends: substitution -message: "Feel free to use '%s' instead of '%s'." +message: "Use '%s' instead of '%s'." link: 'https://developers.google.com/style/contractions' level: suggestion ignorecase: true diff --git a/vale/.config/vale/styles/Google/Exclamation.yml b/vale/.config/vale/styles/Google/Exclamation.yml index 3e15181..eea5fd2 100644 --- a/vale/.config/vale/styles/Google/Exclamation.yml +++ b/vale/.config/vale/styles/Google/Exclamation.yml @@ -3,5 +3,7 @@ message: "Don't use exclamation points in text." link: 'https://developers.google.com/style/exclamation-points' nonword: true level: error +action: + name: remove tokens: - - '\w!(?:\s|$)' + - '\w+!(?:\s|$)' diff --git a/vale/.config/vale/styles/Google/GenderBias.yml b/vale/.config/vale/styles/Google/GenderBias.yml index 261cfb6..9e70190 100644 --- a/vale/.config/vale/styles/Google/GenderBias.yml +++ b/vale/.config/vale/styles/Google/GenderBias.yml @@ -3,6 +3,8 @@ message: "Consider using '%s' instead of '%s'." link: 'https://developers.google.com/style/inclusive-documentation' ignorecase: true level: error +action: + name: replace swap: (?:alumna|alumnus): graduate (?:alumnae|alumni): graduates diff --git a/vale/.config/vale/styles/Google/Headings.yml b/vale/.config/vale/styles/Google/Headings.yml index a533013..e34d001 100644 --- a/vale/.config/vale/styles/Google/Headings.yml +++ b/vale/.config/vale/styles/Google/Headings.yml @@ -1,15 +1,14 @@ extends: capitalization message: "'%s' should use sentence-style capitalization." -link: 'https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings' +link: "https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings" level: warning scope: heading match: $sentence indicators: - - ':' + - ":" exceptions: - Azure - CLI - - Code - Cosmos - Docker - Emmet diff --git a/vale/.config/vale/styles/Google/Latin.yml b/vale/.config/vale/styles/Google/Latin.yml index d91700d..ca03b91 100644 --- a/vale/.config/vale/styles/Google/Latin.yml +++ b/vale/.config/vale/styles/Google/Latin.yml @@ -7,5 +7,5 @@ nonword: true action: name: replace swap: - '\b(?:eg|e\.g\.)[\s,]': for example - '\b(?:ie|i\.e\.)[\s,]': that is + '\b(?:eg|e\.g\.)(?=[\s,;])': for example + '\b(?:ie|i\.e\.)(?=[\s,;])': that is diff --git a/vale/.config/vale/styles/Google/Spacing.yml b/vale/.config/vale/styles/Google/Spacing.yml index 27f7ca2..66e45a6 100644 --- a/vale/.config/vale/styles/Google/Spacing.yml +++ b/vale/.config/vale/styles/Google/Spacing.yml @@ -3,6 +3,8 @@ message: "'%s' should have one space." link: 'https://developers.google.com/style/sentence-spacing' level: error nonword: true +action: + name: remove tokens: - '[a-z][.?!] {2,}[A-Z]' - '[a-z][.?!][A-Z]' diff --git a/vale/.config/vale/styles/Google/Spelling.yml b/vale/.config/vale/styles/Google/Spelling.yml index 57acb88..527ac07 100644 --- a/vale/.config/vale/styles/Google/Spelling.yml +++ b/vale/.config/vale/styles/Google/Spelling.yml @@ -5,4 +5,6 @@ ignorecase: true level: warning tokens: - '(?:\w+)nised?' - - '(?:\w+)logue' + - 'colour' + - 'labour' + - 'centre' diff --git a/vale/.config/vale/styles/Google/Units.yml b/vale/.config/vale/styles/Google/Units.yml index 379fad6..53522ab 100644 --- a/vale/.config/vale/styles/Google/Units.yml +++ b/vale/.config/vale/styles/Google/Units.yml @@ -1,8 +1,8 @@ extends: existence message: "Put a nonbreaking space between the number and the unit in '%s'." -link: 'https://developers.google.com/style/units-of-measure' +link: "https://developers.google.com/style/units-of-measure" nonword: true level: error tokens: - - \d+(?:B|kB|MB|GB|TB) - - \d+(?:ns|ms|s|min|h|d) + - \b\d+(?:B|kB|MB|GB|TB) + - \b\d+(?:ns|ms|s|min|h|d) diff --git a/vale/.config/vale/styles/Google/WordList.yml b/vale/.config/vale/styles/Google/WordList.yml index bb71151..0d675f2 100644 --- a/vale/.config/vale/styles/Google/WordList.yml +++ b/vale/.config/vale/styles/Google/WordList.yml @@ -1,30 +1,31 @@ extends: substitution message: "Use '%s' instead of '%s'." -link: 'https://developers.google.com/style/word-list' +link: "https://developers.google.com/style/word-list" level: warning ignorecase: false action: name: replace swap: - '(?:API Console|dev|developer) key': API key - '(?:cell ?phone|smart ?phone)': phone|mobile phone - '(?:dev|developer|APIs) console': API console - '(?:e-mail|Email|E-mail)': email - '(?:file ?path|path ?name)': path - '(?:kill|terminate|abort)': stop|exit|cancel|end - '(?:OAuth ?2|Oauth)': OAuth 2.0 - '(?:ok|Okay)': OK|okay - '(?:WiFi|wifi)': Wi-Fi + "(?:API Console|dev|developer) key": API key + "(?:cell ?phone|smart ?phone)": phone|mobile phone + "(?:dev|developer|APIs) console": API console + "(?:e-mail|Email|E-mail)": email + "(?:file ?path|path ?name)": path + "(?:kill|terminate|abort)": stop|exit|cancel|end + "(?:OAuth ?2|Oauth)": OAuth 2.0 + "(?:ok|Okay)": OK|okay + "(?:WiFi|wifi)": Wi-Fi '[\.]+apk': APK '3\-D': 3D 'Google (?:I\-O|IO)': Google I/O - 'tap (?:&|and) hold': touch & hold - 'un(?:check|select)': clear + "tap (?:&|and) hold": touch & hold + "un(?:check|select)": clear above: preceding account name: username action bar: app bar admin: administrator Ajax: AJAX + a\.k\.a|aka: or|also known as Android device: Android-powered device android: Android API explorer: APIs Explorer @@ -75,6 +76,6 @@ swap: tablename: table name tablet: device touch: tap - url: URL + url: URL vs\.: versus World Wide Web: web diff --git a/vale/.config/vale/styles/Microsoft/Contractions.yml b/vale/.config/vale/styles/Microsoft/Contractions.yml index ded330f..8c81dcb 100644 --- a/vale/.config/vale/styles/Microsoft/Contractions.yml +++ b/vale/.config/vale/styles/Microsoft/Contractions.yml @@ -22,7 +22,7 @@ swap: should not: shouldn't - 'that is(?!\.)': that's + "that is(?![.,])": that's 'that''s(?=\.)': that is 'they are(?!\.)': they're diff --git a/vale/.config/vale/styles/Microsoft/Foreign.yml b/vale/.config/vale/styles/Microsoft/Foreign.yml index d37835a..0d3d600 100644 --- a/vale/.config/vale/styles/Microsoft/Foreign.yml +++ b/vale/.config/vale/styles/Microsoft/Foreign.yml @@ -9,4 +9,5 @@ action: swap: '\b(?:eg|e\.g\.)[\s,]': for example '\b(?:ie|i\.e\.)[\s,]': that is - + '\b(?:viz\.)[\s,]': namely + '\b(?:ergo)[\s,]': therefore diff --git a/vale/.config/vale/styles/Microsoft/Terms.yml b/vale/.config/vale/styles/Microsoft/Terms.yml index e41ff74..7708900 100644 --- a/vale/.config/vale/styles/Microsoft/Terms.yml +++ b/vale/.config/vale/styles/Microsoft/Terms.yml @@ -1,5 +1,7 @@ extends: substitution message: "Prefer '%s' over '%s'." +# term preference should be based on microsoft style guide, such as +link: https://learn.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/a/adapter level: warning ignorecase: true action: @@ -24,10 +26,8 @@ swap: anti-spyware: antispyware anti-virus: antivirus appendixes: appendices - artificial intelligence: artificial intelligence - assembler: assembly language - bpp: bpp - bps: bps + artificial intelligence: AI + '(?:assembler|machine language)': assembly language caap: CaaP conversation-as-a-platform: conversation as a platform eb: EB @@ -39,5 +39,3 @@ swap: pb: PB tb: TB zb: ZB - viz: namely - ergo: therefore