diff --git a/Crystal/AbbreviationPeriods.yml b/Crystal/AbbreviationPeriods.yml new file mode 100644 index 0000000..2ea4188 --- /dev/null +++ b/Crystal/AbbreviationPeriods.yml @@ -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,}' diff --git a/fixtures/AbbreviationPeriods/.vale.ini b/fixtures/AbbreviationPeriods/.vale.ini new file mode 100644 index 0000000..ae43297 --- /dev/null +++ b/fixtures/AbbreviationPeriods/.vale.ini @@ -0,0 +1,6 @@ +StylesPath = ../../ + +MinAlertLevel = suggestion + +[*.md] +Crystal.AbbreviationPeriods = YES diff --git a/fixtures/AbbreviationPeriods/test.md b/fixtures/AbbreviationPeriods/test.md new file mode 100644 index 0000000..e01f93d --- /dev/null +++ b/fixtures/AbbreviationPeriods/test.md @@ -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. diff --git a/test/parameters/AbbreviationPeriods/index.js b/test/parameters/AbbreviationPeriods/index.js new file mode 100644 index 0000000..52839d5 --- /dev/null +++ b/test/parameters/AbbreviationPeriods/index.js @@ -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.'. + ` +]; diff --git a/test/parameters/index.js b/test/parameters/index.js index 8e45acb..d60c5cb 100644 --- a/test/parameters/index.js +++ b/test/parameters/index.js @@ -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"; @@ -12,6 +13,7 @@ import SentenceLength from "./SentenceLength/index.js"; import Space from "./Space/index.js"; export default [ + AbbreviationPeriods, AMPM, Contractions, Ellipsis,