Skip to content

Commit

Permalink
Merge pull request #56 from stevepiercy/55-add-plurals
Browse files Browse the repository at this point in the history
Add Plurals to reject the undesired (s) or (es).
  • Loading branch information
jdkato authored Nov 3, 2023
2 parents 679b61f + 6ec71b0 commit 4601d2e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
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.

0 comments on commit 4601d2e

Please sign in to comment.