Skip to content

Commit

Permalink
Make OxfordComma more specific
Browse files Browse the repository at this point in the history
See #20.
  • Loading branch information
jdkato committed Oct 11, 2020
1 parent 1462de3 commit 725b15d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Microsoft/OxfordComma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ extends: existence
message: "Use the Oxford comma in '%s'."
link: https://docs.microsoft.com/en-us/style-guide/punctuation/commas
scope: sentence
level: warning
level: suggestion
nonword: true
tokens:
- '(?:[^,]+,){1,}\s\w+\s(?:and|or)'
- '(?:[^\s,]+,){1,} \w+ (?:and|or) \w+[.?!]'
2 changes: 1 addition & 1 deletion features/rules.feature
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Feature: Rules
"""
test.md:3:10:Microsoft.Ellipses:In general, don't use an ellipsis.
test.md:5:13:Microsoft.Hyphens:' officially-' doesn't need a hyphen.
test.md:7:1:Microsoft.OxfordComma:Use the Oxford comma in 'I like red, blue, green and'.
test.md:7:13:Microsoft.OxfordComma:Use the Oxford comma in 'blue, green and orange.'.
test.md:11:10:Microsoft.Quotes:Punctuation should be inside the quotes.
test.md:15:19:Microsoft.Semicolon:Try to simplify this sentence.
test.md:22:25:Microsoft.Quotes:Punctuation should be inside the quotes.
Expand Down

0 comments on commit 725b15d

Please sign in to comment.