Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Plurals to reject the undesired (s) or (es). #56

Merged
merged 2 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Microsoft/Plurals.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends: existence
message: "Don't add '%s' to a singular noun. Use plural instead."
ignorecase: true
level: error
link: https://learn.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/s/s-es
raw:
- '\(s\)|\(es\)'
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ See [Packages](https://vale.sh/hub/microsoft/) for more information.

## Extension Points

| Check | Implementation(s) |
|:------------:|:---------------------------------------------------:|
| Check | Implementations |
|:------------:|:-------------------------------------------------:|
| [`existence`](https://errata-ai.github.io/vale/styles/#existence) | [`Accessibility.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/Accessibility.yml), [`Adverbs.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/Adverbs.yml), [`AMPM.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/AMPM.yml), [`Auto.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/Auto.yml), [`Avoid.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/Avoid.yml), [`Dashes.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/Dashes.yml), [`DateFormat.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/DateFormat.yml), [`Ellipses.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/Ellipses.yml), [`FirstPerson.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/FirstPerson.yml), [`HeadingColons.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/HeadingColons.yml), [`HeadingPunctuation.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/HeadingPunctuation.yml), [`Hyphens.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/Hyphens.yml), [`OxfordComma.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/OxfordComma.yml), [`Passive.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/Passive.yml), [`Quotes.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/Quotes.yml) |
| [`substitution`](https://errata-ai.github.io/vale/styles/#substitution) | [`Backend.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/Backend.yml) (POS tags), [`ComplexWords.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/ComplexWords.yml), [`Contractions.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/Contractions.yml), [`Foreign.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/Foreign.yml), [`Terms.yml`](https://github.com/errata-ai/Microsoft/blob/master/Microsoft/Terms.yml) |
| [`occurrence`](https://errata-ai.github.io/vale/styles/#occurrence) | N/A |
Expand Down
8 changes: 8 additions & 0 deletions features/rules.feature
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,14 @@ Feature: Rules
test.md:5:6:Microsoft.Passive:'are related' looks like passive voice.
"""

Scenario: Plurals
When I test "Plurals"
Then the output should contain exactly:
"""
test.md:3:130:Microsoft.Plurals:Don't add '(s)' to a singular noun. Use plural instead.
test.md:5:13:Microsoft.Plurals:Don't add '(es)' to a singular noun. Use plural instead.
"""

Scenario: Sentences
When I test "Sentences"
Then the output should contain exactly:
Expand Down
6 changes: 6 additions & 0 deletions fixtures/Plurals/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
StylesPath = ../../

MinAlertLevel = suggestion

[*.md]
Microsoft.Plurals = YES
5 changes: 5 additions & 0 deletions fixtures/Plurals/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Plurals

This app will use the add-on registry to extend the basic CMS capabilities, so an external add-on can supplement their own add-on(s) to the basic CMS ones.

Use checkbox(es) as needed in your form.