Skip to content

Commit

Permalink
feat(rule): abbreviation periods
Browse files Browse the repository at this point in the history
  • Loading branch information
naiyerasif committed Mar 17, 2024
1 parent 7a2341f commit b537584
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Crystal/AbbreviationPeriods.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends: existence
message: "Don't use periods with abbreviations such as '%s'."
level: error
nonword: true
tokens:
- '\b(?:[A-Z]\.){3,}'
6 changes: 6 additions & 0 deletions fixtures/AbbreviationPeriods/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
StylesPath = ../../

MinAlertLevel = suggestion

[*.md]
Crystal.AbbreviationPeriods = YES
4 changes: 4 additions & 0 deletions fixtures/AbbreviationPeriods/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Abbreviation Periods

It is a good practice to serve your site on H.T.T.P.S.
The Mayan civilization had its origins around 2000 B.C.
6 changes: 6 additions & 0 deletions test/parameters/AbbreviationPeriods/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default [
"AbbreviationPeriods",
`
test.md:3:45:Crystal.AbbreviationPeriods:Don't use periods with abbreviations such as 'H.T.T.P.S.'.
`
];
2 changes: 2 additions & 0 deletions test/parameters/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import AbbreviationPeriods from "./AbbreviationPeriods/index.js";
import AMPM from "./AMPM/index.js";
import Contractions from "./Contractions/index.js";
import Ellipsis from "./Ellipsis/index.js";
Expand All @@ -12,6 +13,7 @@ import SentenceLength from "./SentenceLength/index.js";
import Space from "./Space/index.js";

export default [
AbbreviationPeriods,
AMPM,
Contractions,
Ellipsis,
Expand Down

0 comments on commit b537584

Please sign in to comment.