From 68888b591add22edbf8e8854cf161d053d92c7e8 Mon Sep 17 00:00:00 2001 From: Naiyer <19614213+naiyerasif@users.noreply.github.com> Date: Sat, 23 Mar 2024 16:27:35 +0530 Subject: [PATCH 01/10] chore: ignore compris.zip --- .gitignore | 1 + README.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e4116b8..b4f76a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .workspace node_modules .DS_Store +compris.zip diff --git a/README.md b/README.md index 0166d7a..479ef49 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ A [Vale](https://vale.sh)-compatible prose style for non-native English speakers ## Status: alpha -**compris** is still in its early stages. It is usable but expect massive and frequent changes before it becomes stable. +> [!IMPORTANT] +> **compris** is still in its early stages. It is usable but expect massive and frequent changes before it becomes stable. ## Usage From fd2a8ad6a81b189d68ccf9f642f97ce5a18a4354 Mon Sep 17 00:00:00 2001 From: Naiyer <19614213+naiyerasif@users.noreply.github.com> Date: Sat, 23 Mar 2024 17:32:01 +0530 Subject: [PATCH 02/10] chore: add credits [skip actions] --- CREDITS.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 CREDITS.md diff --git a/CREDITS.md b/CREDITS.md new file mode 100644 index 0000000..d1b426b --- /dev/null +++ b/CREDITS.md @@ -0,0 +1,2 @@ +- [Joseph Kato](https://github.com/jdkato) for building [Vale](https://vale.sh/) +- [Oxford 3000](https://www.oxfordlearnersdictionaries.com/us/wordlists/oxford3000-5000) for most commonly used English words From fbdd442d38fc559762f5ad118222469978f05199 Mon Sep 17 00:00:00 2001 From: Naiyer <19614213+naiyerasif@users.noreply.github.com> Date: Sat, 23 Mar 2024 17:38:21 +0530 Subject: [PATCH 03/10] feat(rule): required alternatives - 3-D --- compris/RequiredAlternatives.yml | 1 + fixtures/RequiredAlternatives/test.md | 5 ++++- test/expectations/RequiredAlternatives.log | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/compris/RequiredAlternatives.yml b/compris/RequiredAlternatives.yml index 6a09264..f4a2cd2 100644 --- a/compris/RequiredAlternatives.yml +++ b/compris/RequiredAlternatives.yml @@ -6,4 +6,5 @@ action: name: replace swap: 24/7: 24x7 + 3\-D: 3D synch: sync diff --git a/fixtures/RequiredAlternatives/test.md b/fixtures/RequiredAlternatives/test.md index d7452bd..6ce1b66 100644 --- a/fixtures/RequiredAlternatives/test.md +++ b/fixtures/RequiredAlternatives/test.md @@ -3,5 +3,8 @@ Our emergency hotline is staffed 24/7 for immediate assistance. + +The movie was stunning in 3-D. + -The team needs to synch their schedules for the upcoming meeting.. +The team needs to synch their schedules for the upcoming meeting. diff --git a/test/expectations/RequiredAlternatives.log b/test/expectations/RequiredAlternatives.log index 8f13efe..438ccaa 100644 --- a/test/expectations/RequiredAlternatives.log +++ b/test/expectations/RequiredAlternatives.log @@ -1,2 +1,3 @@ test.md:4:34:compris.RequiredAlternatives:Use '24x7' instead of '24/7'. -test.md:7:19:compris.RequiredAlternatives:Use 'sync' instead of 'synch'. +test.md:7:27:compris.RequiredAlternatives:Use '3D' instead of '3-D'. +test.md:10:19:compris.RequiredAlternatives:Use 'sync' instead of 'synch'. From b268b16f8356f91d697ecdd72a9b0ad17dee6daf Mon Sep 17 00:00:00 2001 From: Naiyer <19614213+naiyerasif@users.noreply.github.com> Date: Sat, 23 Mar 2024 17:44:50 +0530 Subject: [PATCH 04/10] feat(rule): required alternatives - URL --- compris/RequiredAlternatives.yml | 3 +++ fixtures/RequiredAlternatives/test.md | 5 +++++ test/expectations/RequiredAlternatives.log | 3 +++ 3 files changed, 11 insertions(+) diff --git a/compris/RequiredAlternatives.yml b/compris/RequiredAlternatives.yml index f4a2cd2..1d370ae 100644 --- a/compris/RequiredAlternatives.yml +++ b/compris/RequiredAlternatives.yml @@ -8,3 +8,6 @@ swap: 24/7: 24x7 3\-D: 3D synch: sync + url: URL + URL for: URL of + an URL: a URL diff --git a/fixtures/RequiredAlternatives/test.md b/fixtures/RequiredAlternatives/test.md index 6ce1b66..5ab03a6 100644 --- a/fixtures/RequiredAlternatives/test.md +++ b/fixtures/RequiredAlternatives/test.md @@ -8,3 +8,8 @@ The movie was stunning in 3-D. The team needs to synch their schedules for the upcoming meeting. + + +Share the video url to let others view it online. +The URL for the image file is embedded in the HTML code of the webpage. +Hover on an URL to preview the page. diff --git a/test/expectations/RequiredAlternatives.log b/test/expectations/RequiredAlternatives.log index 438ccaa..19a30bb 100644 --- a/test/expectations/RequiredAlternatives.log +++ b/test/expectations/RequiredAlternatives.log @@ -1,3 +1,6 @@ test.md:4:34:compris.RequiredAlternatives:Use '24x7' instead of '24/7'. test.md:7:27:compris.RequiredAlternatives:Use '3D' instead of '3-D'. test.md:10:19:compris.RequiredAlternatives:Use 'sync' instead of 'synch'. +test.md:13:17:compris.RequiredAlternatives:Use 'URL' instead of 'url'. +test.md:14:5:compris.RequiredAlternatives:Use 'URL of' instead of 'URL for'. +test.md:15:10:compris.RequiredAlternatives:Use 'a URL' instead of 'an URL'. From 98e95c48b26147e8dacb78c1bc5998a41bba65b9 Mon Sep 17 00:00:00 2001 From: Naiyer <19614213+naiyerasif@users.noreply.github.com> Date: Sun, 24 Mar 2024 07:02:56 +0530 Subject: [PATCH 05/10] feat: rename to Prim --- .gitignore | 2 +- .vale.ini | 2 +- CONTRIBUTING.md | 4 +- {compris => Prim}/AMPM.yml | 0 {compris => Prim}/AbbreviationPeriods.yml | 0 {compris => Prim}/Ambiguity.yml | 0 {compris => Prim}/Contractions.yml | 0 {compris => Prim}/Ellipsis.yml | 0 {compris => Prim}/EmDash.yml | 0 {compris => Prim}/EnDash.yml | 0 {compris => Prim}/Latin.yml | 0 {compris => Prim}/OptionalPlurals.yml | 0 {compris => Prim}/Ordinal.yml | 0 {compris => Prim}/OxfordComma.yml | 0 {compris => Prim}/Percentages.yml | 0 {compris => Prim}/PreferredAlternatives.yml | 0 {compris => Prim}/RequiredAlternatives.yml | 0 {compris => Prim}/Semicolon.yml | 0 {compris => Prim}/SentenceLength.yml | 0 {compris => Prim}/SimplerAlternatives.yml | 0 {compris => Prim}/Space.yml | 0 {compris => Prim}/WordRepitition.yml | 0 Prim/meta.json | 4 + README.md | 16 +- compris/meta.json | 4 - fixtures/AMPM/.vale.ini | 2 +- fixtures/AbbreviationPeriods/.vale.ini | 2 +- fixtures/Ambiguity/.vale.ini | 2 +- fixtures/Contractions/.vale.ini | 2 +- fixtures/Ellipsis/.vale.ini | 2 +- fixtures/EmDash/.vale.ini | 2 +- fixtures/EnDash/.vale.ini | 2 +- fixtures/Latin/.vale.ini | 2 +- fixtures/OptionalPlurals/.vale.ini | 2 +- fixtures/Ordinal/.vale.ini | 2 +- fixtures/OxfordComma/.vale.ini | 2 +- fixtures/Percentages/.vale.ini | 2 +- fixtures/PreferredAlternatives/.vale.ini | 2 +- fixtures/RequiredAlternatives/.vale.ini | 2 +- fixtures/Semicolon/.vale.ini | 2 +- fixtures/SentenceLength/.vale.ini | 2 +- fixtures/SimplerAlternatives/.vale.ini | 2 +- fixtures/Space/.vale.ini | 2 +- fixtures/WordRepitition/.vale.ini | 2 +- package.json | 6 +- test/expectations/AMPM.log | 10 +- test/expectations/AbbreviationPeriods.log | 2 +- test/expectations/Ambiguity.log | 2 +- test/expectations/Contractions.log | 212 ++++++++++---------- test/expectations/Ellipsis.log | 4 +- test/expectations/EmDash.log | 4 +- test/expectations/EnDash.log | 6 +- test/expectations/Latin.log | 24 +-- test/expectations/OptionalPlurals.log | 4 +- test/expectations/Ordinal.log | 6 +- test/expectations/OxfordComma.log | 4 +- test/expectations/Percentages.log | 2 +- test/expectations/PreferredAlternatives.log | 6 +- test/expectations/RequiredAlternatives.log | 12 +- test/expectations/Semicolon.log | 2 +- test/expectations/SentenceLength.log | 2 +- test/expectations/SimplerAlternatives.log | 2 +- test/expectations/Space.log | 12 +- test/expectations/WordRepitition.log | 2 +- 64 files changed, 197 insertions(+), 197 deletions(-) rename {compris => Prim}/AMPM.yml (100%) rename {compris => Prim}/AbbreviationPeriods.yml (100%) rename {compris => Prim}/Ambiguity.yml (100%) rename {compris => Prim}/Contractions.yml (100%) rename {compris => Prim}/Ellipsis.yml (100%) rename {compris => Prim}/EmDash.yml (100%) rename {compris => Prim}/EnDash.yml (100%) rename {compris => Prim}/Latin.yml (100%) rename {compris => Prim}/OptionalPlurals.yml (100%) rename {compris => Prim}/Ordinal.yml (100%) rename {compris => Prim}/OxfordComma.yml (100%) rename {compris => Prim}/Percentages.yml (100%) rename {compris => Prim}/PreferredAlternatives.yml (100%) rename {compris => Prim}/RequiredAlternatives.yml (100%) rename {compris => Prim}/Semicolon.yml (100%) rename {compris => Prim}/SentenceLength.yml (100%) rename {compris => Prim}/SimplerAlternatives.yml (100%) rename {compris => Prim}/Space.yml (100%) rename {compris => Prim}/WordRepitition.yml (100%) create mode 100644 Prim/meta.json delete mode 100644 compris/meta.json diff --git a/.gitignore b/.gitignore index b4f76a6..3cbcfeb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ .workspace node_modules .DS_Store -compris.zip +Prim.zip diff --git a/.vale.ini b/.vale.ini index c5a6b71..420f950 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,4 +1,4 @@ StylesPath = . [*.md] -BasedOnStyles = compris +BasedOnStyles = Prim diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 34e40db..fecdb64 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,11 +1,11 @@ # Contribution manual -Thank you for your interest in contributing to **compris**. There are many ways to contribute and we appreciate all of them. +Thank you for your interest in contributing to **Prim**. There are many ways to contribute and we appreciate all of them. > [!TIP] > **For new contributors**: Visit for helpful information on contributing to open source projects -- [Create an issue](https://github.com/Microflash/compris/issues/new) to discuss a change before you start working on it. +- [Create an issue](https://github.com/Microflash/Prim/issues/new) to discuss a change before you start working on it. ## Commit messages diff --git a/compris/AMPM.yml b/Prim/AMPM.yml similarity index 100% rename from compris/AMPM.yml rename to Prim/AMPM.yml diff --git a/compris/AbbreviationPeriods.yml b/Prim/AbbreviationPeriods.yml similarity index 100% rename from compris/AbbreviationPeriods.yml rename to Prim/AbbreviationPeriods.yml diff --git a/compris/Ambiguity.yml b/Prim/Ambiguity.yml similarity index 100% rename from compris/Ambiguity.yml rename to Prim/Ambiguity.yml diff --git a/compris/Contractions.yml b/Prim/Contractions.yml similarity index 100% rename from compris/Contractions.yml rename to Prim/Contractions.yml diff --git a/compris/Ellipsis.yml b/Prim/Ellipsis.yml similarity index 100% rename from compris/Ellipsis.yml rename to Prim/Ellipsis.yml diff --git a/compris/EmDash.yml b/Prim/EmDash.yml similarity index 100% rename from compris/EmDash.yml rename to Prim/EmDash.yml diff --git a/compris/EnDash.yml b/Prim/EnDash.yml similarity index 100% rename from compris/EnDash.yml rename to Prim/EnDash.yml diff --git a/compris/Latin.yml b/Prim/Latin.yml similarity index 100% rename from compris/Latin.yml rename to Prim/Latin.yml diff --git a/compris/OptionalPlurals.yml b/Prim/OptionalPlurals.yml similarity index 100% rename from compris/OptionalPlurals.yml rename to Prim/OptionalPlurals.yml diff --git a/compris/Ordinal.yml b/Prim/Ordinal.yml similarity index 100% rename from compris/Ordinal.yml rename to Prim/Ordinal.yml diff --git a/compris/OxfordComma.yml b/Prim/OxfordComma.yml similarity index 100% rename from compris/OxfordComma.yml rename to Prim/OxfordComma.yml diff --git a/compris/Percentages.yml b/Prim/Percentages.yml similarity index 100% rename from compris/Percentages.yml rename to Prim/Percentages.yml diff --git a/compris/PreferredAlternatives.yml b/Prim/PreferredAlternatives.yml similarity index 100% rename from compris/PreferredAlternatives.yml rename to Prim/PreferredAlternatives.yml diff --git a/compris/RequiredAlternatives.yml b/Prim/RequiredAlternatives.yml similarity index 100% rename from compris/RequiredAlternatives.yml rename to Prim/RequiredAlternatives.yml diff --git a/compris/Semicolon.yml b/Prim/Semicolon.yml similarity index 100% rename from compris/Semicolon.yml rename to Prim/Semicolon.yml diff --git a/compris/SentenceLength.yml b/Prim/SentenceLength.yml similarity index 100% rename from compris/SentenceLength.yml rename to Prim/SentenceLength.yml diff --git a/compris/SimplerAlternatives.yml b/Prim/SimplerAlternatives.yml similarity index 100% rename from compris/SimplerAlternatives.yml rename to Prim/SimplerAlternatives.yml diff --git a/compris/Space.yml b/Prim/Space.yml similarity index 100% rename from compris/Space.yml rename to Prim/Space.yml diff --git a/compris/WordRepitition.yml b/Prim/WordRepitition.yml similarity index 100% rename from compris/WordRepitition.yml rename to Prim/WordRepitition.yml diff --git a/Prim/meta.json b/Prim/meta.json new file mode 100644 index 0000000..c994c8d --- /dev/null +++ b/Prim/meta.json @@ -0,0 +1,4 @@ +{ + "feed": "https://github.com/Microflash/Prim/releases.atom", + "vale_version": ">=1.0.0" +} diff --git a/README.md b/README.md index 479ef49..3ba4570 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,27 @@ -# compris +# Prim -[![Regression tests](https://github.com/Microflash/compris/actions/workflows/regression.yml/badge.svg)](https://github.com/Microflash/compris/actions/workflows/regression.yml) +[![Regression tests](https://github.com/Microflash/Prim/actions/workflows/regression.yml/badge.svg)](https://github.com/Microflash/Prim/actions/workflows/regression.yml) A [Vale](https://vale.sh)-compatible prose style for non-native English speakers. Tailored for technical documentation. ## Status: alpha > [!IMPORTANT] -> **compris** is still in its early stages. It is usable but expect massive and frequent changes before it becomes stable. +> **Prim** is still in its early stages. It is usable but expect massive and frequent changes before it becomes stable. ## Usage -Add to the list of `Packages` in the `.vale.ini` file. +Add to the list of `Packages` in the `.vale.ini` file. ```ini StylesPath = .github/styles MinAlertLevel = suggestion Packages = proselint, \ -https://github.com/Microflash/compris/releases/download/latest/compris.zip +https://github.com/Microflash/Prim/releases/download/latest/Prim.zip [README.md] -BasedOnStyles = Vale, compris, proselint +BasedOnStyles = Vale, Prim, proselint ``` To sync the latest updates, run `vale sync`. @@ -36,7 +36,7 @@ To sync the latest updates, run `vale sync`. ## Development -- [Rules](./compris/) are written in `yml` files using the syntax described by [Vale docs](https://vale.sh/docs/). +- [Rules](./Prim/) are written in `yml` files using the syntax described by [Vale docs](https://vale.sh/docs/). - Every rule has a [fixture](./fixtures/) against which you can run tests. - Tests are run against the [log output](./test/expectations/) of Vale. @@ -52,7 +52,7 @@ Run `pnpm i` to download the test dependencies; you would need them to run the t A typical workflow looks like this. -1. Add a new rule by creating a new `compris/.yml` file, or modify an existing rule in the existing `compris/.yml` file. +1. Add a new rule by creating a new `Prim/.yml` file, or modify an existing rule in the existing `Prim/.yml` file. 2. Add or update the fixtures in the `fixtures//test.md` directory. 3. Add the expected logs in the `test/expectations/.log` file. 4. Run `pnpm test` to run the tests. diff --git a/compris/meta.json b/compris/meta.json deleted file mode 100644 index 2ae10d6..0000000 --- a/compris/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "feed": "https://github.com/Microflash/compris/releases.atom", - "vale_version": ">=1.0.0" -} diff --git a/fixtures/AMPM/.vale.ini b/fixtures/AMPM/.vale.ini index cc93155..3f3811d 100644 --- a/fixtures/AMPM/.vale.ini +++ b/fixtures/AMPM/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.AMPM = YES +Prim.AMPM = YES diff --git a/fixtures/AbbreviationPeriods/.vale.ini b/fixtures/AbbreviationPeriods/.vale.ini index 917c075..c5e0015 100644 --- a/fixtures/AbbreviationPeriods/.vale.ini +++ b/fixtures/AbbreviationPeriods/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.AbbreviationPeriods = YES +Prim.AbbreviationPeriods = YES diff --git a/fixtures/Ambiguity/.vale.ini b/fixtures/Ambiguity/.vale.ini index 5b55ff8..c3c4ac5 100644 --- a/fixtures/Ambiguity/.vale.ini +++ b/fixtures/Ambiguity/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.Ambiguity = YES +Prim.Ambiguity = YES diff --git a/fixtures/Contractions/.vale.ini b/fixtures/Contractions/.vale.ini index 987f0c0..b74bac0 100644 --- a/fixtures/Contractions/.vale.ini +++ b/fixtures/Contractions/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.Contractions = YES +Prim.Contractions = YES diff --git a/fixtures/Ellipsis/.vale.ini b/fixtures/Ellipsis/.vale.ini index 253e733..c6a429a 100644 --- a/fixtures/Ellipsis/.vale.ini +++ b/fixtures/Ellipsis/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.Ellipsis = YES +Prim.Ellipsis = YES diff --git a/fixtures/EmDash/.vale.ini b/fixtures/EmDash/.vale.ini index c6bc0fc..5528a87 100644 --- a/fixtures/EmDash/.vale.ini +++ b/fixtures/EmDash/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.EmDash = YES +Prim.EmDash = YES diff --git a/fixtures/EnDash/.vale.ini b/fixtures/EnDash/.vale.ini index e65fa3b..e73a605 100644 --- a/fixtures/EnDash/.vale.ini +++ b/fixtures/EnDash/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.EnDash = YES +Prim.EnDash = YES diff --git a/fixtures/Latin/.vale.ini b/fixtures/Latin/.vale.ini index f2c188e..a792b5c 100644 --- a/fixtures/Latin/.vale.ini +++ b/fixtures/Latin/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.Latin = YES +Prim.Latin = YES diff --git a/fixtures/OptionalPlurals/.vale.ini b/fixtures/OptionalPlurals/.vale.ini index 7af2cb5..16b2b01 100644 --- a/fixtures/OptionalPlurals/.vale.ini +++ b/fixtures/OptionalPlurals/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.OptionalPlurals = YES +Prim.OptionalPlurals = YES diff --git a/fixtures/Ordinal/.vale.ini b/fixtures/Ordinal/.vale.ini index 451624d..43a8416 100644 --- a/fixtures/Ordinal/.vale.ini +++ b/fixtures/Ordinal/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.Ordinal = YES +Prim.Ordinal = YES diff --git a/fixtures/OxfordComma/.vale.ini b/fixtures/OxfordComma/.vale.ini index 5cef5d8..7015824 100644 --- a/fixtures/OxfordComma/.vale.ini +++ b/fixtures/OxfordComma/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.OxfordComma = YES +Prim.OxfordComma = YES diff --git a/fixtures/Percentages/.vale.ini b/fixtures/Percentages/.vale.ini index 8c97c78..0421e64 100644 --- a/fixtures/Percentages/.vale.ini +++ b/fixtures/Percentages/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.Percentages = YES +Prim.Percentages = YES diff --git a/fixtures/PreferredAlternatives/.vale.ini b/fixtures/PreferredAlternatives/.vale.ini index d0f9b8d..627151f 100644 --- a/fixtures/PreferredAlternatives/.vale.ini +++ b/fixtures/PreferredAlternatives/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.PreferredAlternatives = YES +Prim.PreferredAlternatives = YES diff --git a/fixtures/RequiredAlternatives/.vale.ini b/fixtures/RequiredAlternatives/.vale.ini index 3fa1e54..f00ba8e 100644 --- a/fixtures/RequiredAlternatives/.vale.ini +++ b/fixtures/RequiredAlternatives/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.RequiredAlternatives = YES +Prim.RequiredAlternatives = YES diff --git a/fixtures/Semicolon/.vale.ini b/fixtures/Semicolon/.vale.ini index 7f126ef..f893bbd 100644 --- a/fixtures/Semicolon/.vale.ini +++ b/fixtures/Semicolon/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.Semicolon = YES +Prim.Semicolon = YES diff --git a/fixtures/SentenceLength/.vale.ini b/fixtures/SentenceLength/.vale.ini index 1cfbaba..14cd488 100644 --- a/fixtures/SentenceLength/.vale.ini +++ b/fixtures/SentenceLength/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.SentenceLength = YES +Prim.SentenceLength = YES diff --git a/fixtures/SimplerAlternatives/.vale.ini b/fixtures/SimplerAlternatives/.vale.ini index c56f438..e1a2c5c 100644 --- a/fixtures/SimplerAlternatives/.vale.ini +++ b/fixtures/SimplerAlternatives/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.SimplerAlternatives = YES +Prim.SimplerAlternatives = YES diff --git a/fixtures/Space/.vale.ini b/fixtures/Space/.vale.ini index e79a67b..e7313ef 100644 --- a/fixtures/Space/.vale.ini +++ b/fixtures/Space/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.Space = YES +Prim.Space = YES diff --git a/fixtures/WordRepitition/.vale.ini b/fixtures/WordRepitition/.vale.ini index 9a7fec5..37d0be0 100644 --- a/fixtures/WordRepitition/.vale.ini +++ b/fixtures/WordRepitition/.vale.ini @@ -3,4 +3,4 @@ StylesPath = ../../ MinAlertLevel = suggestion [*.md] -compris.WordRepitition = YES +Prim.WordRepitition = YES diff --git a/package.json b/package.json index 324e10a..b09b25c 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { - "name": "compris", - "version": "0.0.2", + "name": "prim", + "version": "0.0.3", "description": "A Vale-compatible prose style for non-native English speaker", "scripts": { "test": "vitest rules", - "dist": "zip -r compris.zip compris -x \"*.DS_Store\"" + "dist": "zip -r Prim.zip Prim -x \"*.DS_Store\"" }, "devDependencies": { "execa": "^8.0.1", diff --git a/test/expectations/AMPM.log b/test/expectations/AMPM.log index a45a78b..fd479e1 100644 --- a/test/expectations/AMPM.log +++ b/test/expectations/AMPM.log @@ -1,5 +1,5 @@ -test.md:3:24:compris.AMPM:Use 'am' or 'pm' else 'a.m.' or 'p.m.' (preceded by a space). -test.md:4:33:compris.AMPM:Use 'am' or 'pm' else 'a.m.' or 'p.m.' (preceded by a space). -test.md:4:41:compris.AMPM:Use 'am' or 'pm' else 'a.m.' or 'p.m.' (preceded by a space). -test.md:5:33:compris.AMPM:Use 'am' or 'pm' else 'a.m.' or 'p.m.' (preceded by a space). -test.md:6:30:compris.AMPM:Use 'am' or 'pm' else 'a.m.' or 'p.m.' (preceded by a space). +test.md:3:24:Prim.AMPM:Use 'am' or 'pm' else 'a.m.' or 'p.m.' (preceded by a space). +test.md:4:33:Prim.AMPM:Use 'am' or 'pm' else 'a.m.' or 'p.m.' (preceded by a space). +test.md:4:41:Prim.AMPM:Use 'am' or 'pm' else 'a.m.' or 'p.m.' (preceded by a space). +test.md:5:33:Prim.AMPM:Use 'am' or 'pm' else 'a.m.' or 'p.m.' (preceded by a space). +test.md:6:30:Prim.AMPM:Use 'am' or 'pm' else 'a.m.' or 'p.m.' (preceded by a space). diff --git a/test/expectations/AbbreviationPeriods.log b/test/expectations/AbbreviationPeriods.log index c3da88d..cbda784 100644 --- a/test/expectations/AbbreviationPeriods.log +++ b/test/expectations/AbbreviationPeriods.log @@ -1 +1 @@ -test.md:3:45:compris.AbbreviationPeriods:Don't use periods with abbreviations such as 'H.T.T.P.S.'. +test.md:3:45:Prim.AbbreviationPeriods:Don't use periods with abbreviations such as 'H.T.T.P.S.'. diff --git a/test/expectations/Ambiguity.log b/test/expectations/Ambiguity.log index e9fa26e..7e64d08 100644 --- a/test/expectations/Ambiguity.log +++ b/test/expectations/Ambiguity.log @@ -1 +1 @@ -test.md:3:49:compris.Ambiguity:Avoid ambiguity. Don't use 'and/or'. +test.md:3:49:Prim.Ambiguity:Avoid ambiguity. Don't use 'and/or'. diff --git a/test/expectations/Contractions.log b/test/expectations/Contractions.log index d2b4bbe..7ee9d4b 100644 --- a/test/expectations/Contractions.log +++ b/test/expectations/Contractions.log @@ -1,106 +1,106 @@ -test.md:4:48:compris.Contractions:Avoid contractions. Use 'accessibility' instead of 'a11y'. -test.md:7:13:compris.Contractions:Avoid contractions. Use 'or' or 'also known as' instead of 'aka'. -test.md:8:28:compris.Contractions:Avoid contractions. Use 'or' or 'also known as' instead of 'a.k.a'. -test.md:11:24:compris.Contractions:Avoid contractions. Use 'are not' instead of 'aren't'. -test.md:14:27:compris.Contractions:Avoid contractions. Use 'authentication' instead of 'authN'. -test.md:17:12:compris.Contractions:Avoid contractions. Use 'authorization' instead of 'authZ'. -test.md:20:3:compris.Contractions:Avoid contractions. Use 'cannot' instead of 'can't'. -test.md:23:3:compris.Contractions:Avoid contractions. Use 'could have' instead of 'could've'. -test.md:26:5:compris.Contractions:Avoid contractions. Use 'could not' instead of 'couldn't'. -test.md:29:4:compris.Contractions:Avoid contractions. Use 'did not' instead of 'didn't'. -test.md:32:3:compris.Contractions:Avoid contractions. Use 'do not' instead of 'don't'. -test.md:35:26:compris.Contractions:Avoid contractions. Use 'does not' instead of 'doesn't'. -test.md:38:11:compris.Contractions:Avoid contractions. Use 'globalization' instead of 'g11n'. -test.md:41:4:compris.Contractions:Avoid contractions. Use 'had not' instead of 'hadn't'. -test.md:44:13:compris.Contractions:Avoid contractions. Use 'has not' instead of 'hasn't'. -test.md:46:6:compris.Contractions:Avoid contractions. Use 'have not' instead of 'haven't'. -test.md:50:1:compris.Contractions:Avoid contractions. Use 'He had' or 'He would' instead of 'He'd'. -test.md:51:1:compris.Contractions:Avoid contractions. Use 'He had' or 'He would' instead of 'He'd'. -test.md:54:1:compris.Contractions:Avoid contractions. Use 'He is' or 'He has' instead of 'He's'. -test.md:55:1:compris.Contractions:Avoid contractions. Use 'He is' or 'He has' instead of 'He's'. -test.md:58:1:compris.Contractions:Avoid contractions. Use 'He will' or 'He shall' instead of 'He'll'. -test.md:61:1:compris.Contractions:Avoid contractions. Use 'Here had' or 'Here would' instead of 'Here'd'. -test.md:62:1:compris.Contractions:Avoid contractions. Use 'Here had' or 'Here would' instead of 'Here'd'. -test.md:65:1:compris.Contractions:Avoid contractions. Use 'Here is' or 'Here has' instead of 'Here's'. -test.md:68:1:compris.Contractions:Avoid contractions. Use 'How did' or 'How would' instead of 'How'd'. -test.md:69:1:compris.Contractions:Avoid contractions. Use 'How did' or 'How would' instead of 'How'd'. -test.md:72:1:compris.Contractions:Avoid contractions. Use 'How is' instead of 'How's'. -test.md:75:1:compris.Contractions:Avoid contractions. Use 'How will' instead of 'How'll'. -test.md:78:1:compris.Contractions:Avoid contractions. Use 'I am' instead of 'I'm'. -test.md:81:1:compris.Contractions:Avoid contractions. Use 'I had' or 'I would' instead of 'I'd'. -test.md:84:1:compris.Contractions:Avoid contractions. Use 'I have' instead of 'I've'. -test.md:87:1:compris.Contractions:Avoid contractions. Use 'I will' instead of 'I'll'. -test.md:90:5:compris.Contractions:Avoid contractions. Use 'internationalization' instead of 'i18n'. -test.md:93:11:compris.Contractions:Avoid contractions. Use 'is not' instead of 'isn't'. -test.md:96:1:compris.Contractions:Avoid contractions. Use 'It had' or 'It would' instead of 'It'd'. -test.md:97:1:compris.Contractions:Avoid contractions. Use 'It had' or 'It would' instead of 'It'd'. -test.md:100:1:compris.Contractions:Avoid contractions. Use 'It is' or 'It has' instead of 'It's'. -test.md:101:1:compris.Contractions:Avoid contractions. Use 'It is' or 'It has' instead of 'It's'. -test.md:104:1:compris.Contractions:Avoid contractions. Use 'It will' or 'It shall' instead of 'It'll'. -test.md:107:8:compris.Contractions:Avoid contractions. Use 'Kubernetes' instead of 'k8s'. -test.md:110:1:compris.Contractions:Avoid contractions. Use 'Let us' instead of 'Let's'. -test.md:113:5:compris.Contractions:Avoid contractions. Use 'localization' instead of 'l10n'. -test.md:116:19:compris.Contractions:Avoid contractions. Use 'personalization' instead of 'p13n'. -test.md:119:1:compris.Contractions:Avoid contractions. Use 'She had' or 'She would' instead of 'She'd'. -test.md:120:1:compris.Contractions:Avoid contractions. Use 'She had' or 'She would' instead of 'She'd'. -test.md:123:1:compris.Contractions:Avoid contractions. Use 'She is' or 'She has' instead of 'She's'. -test.md:124:1:compris.Contractions:Avoid contractions. Use 'She is' or 'She has' instead of 'She's'. -test.md:127:1:compris.Contractions:Avoid contractions. Use 'She will' or 'She shall' instead of 'She'll'. -test.md:130:3:compris.Contractions:Avoid contractions. Use 'should have' instead of 'should've'. -test.md:133:4:compris.Contractions:Avoid contractions. Use 'should not' instead of 'shouldn't'. -test.md:136:1:compris.Contractions:Avoid contractions. Use 'Somebody had' or 'Somebody would' instead of 'Somebody'd'. -test.md:137:1:compris.Contractions:Avoid contractions. Use 'Somebody had' or 'Somebody would' instead of 'Somebody'd'. -test.md:140:1:compris.Contractions:Avoid contractions. Use 'Someone had' or 'Someone would' instead of 'Someone'd'. -test.md:141:1:compris.Contractions:Avoid contractions. Use 'Someone had' or 'Someone would' instead of 'Someone'd'. -test.md:144:12:compris.Contractions:Avoid contractions. Use 'that had' or 'that would' instead of 'that'd'. -test.md:145:1:compris.Contractions:Avoid contractions. Use 'That had' or 'That would' instead of 'That'd'. -test.md:148:1:compris.Contractions:Avoid contractions. Use 'That is' or 'That has' instead of 'That's'. -test.md:149:9:compris.Contractions:Avoid contractions. Use 'that is' or 'that has' instead of 'that's'. -test.md:152:25:compris.Contractions:Avoid contractions. Use 'that will' instead of 'that'll'. -test.md:155:19:compris.Contractions:Avoid contractions. Use 'they are' instead of 'they're'. -test.md:158:1:compris.Contractions:Avoid contractions. Use 'There would' or 'There had' instead of 'There'd'. -test.md:159:1:compris.Contractions:Avoid contractions. Use 'There would' or 'There had' instead of 'There'd'. -test.md:162:1:compris.Contractions:Avoid contractions. Use 'There is' or 'There has' instead of 'There's'. -test.md:163:1:compris.Contractions:Avoid contractions. Use 'There is' or 'There has' instead of 'There's'. -test.md:166:9:compris.Contractions:Avoid contractions. Use 'they had' or 'they would' instead of 'they'd'. -test.md:167:1:compris.Contractions:Avoid contractions. Use 'They had' or 'They would' instead of 'They'd'. -test.md:170:1:compris.Contractions:Avoid contractions. Use 'They have' instead of 'They've'. -test.md:173:34:compris.Contractions:Avoid contractions. Use 'they will' or 'they shall' instead of 'they'll'. -test.md:176:4:compris.Contractions:Avoid contractions. Use 'was not' instead of 'wasn't'. -test.md:179:1:compris.Contractions:Avoid contractions. Use 'We are' instead of 'We're'. -test.md:182:1:compris.Contractions:Avoid contractions. Use 'We have' instead of 'We've'. -test.md:185:1:compris.Contractions:Avoid contractions. Use 'We will' instead of 'We'll'. -test.md:188:1:compris.Contractions:Avoid contractions. Use 'We would' or 'We had' instead of 'We'd'. -test.md:189:1:compris.Contractions:Avoid contractions. Use 'We would' or 'We had' instead of 'We'd'. -test.md:192:11:compris.Contractions:Avoid contractions. Use 'were not' instead of 'weren't'. -test.md:195:1:compris.Contractions:Avoid contractions. Use 'What did' instead of 'What'd'. -test.md:198:1:compris.Contractions:Avoid contractions. Use 'What is' instead of 'What's'. -test.md:201:1:compris.Contractions:Avoid contractions. Use 'What will' instead of 'What'll'. -test.md:204:1:compris.Contractions:Avoid contractions. Use 'When did' instead of 'When'd'. -test.md:207:1:compris.Contractions:Avoid contractions. Use 'When is' or 'When has' instead of 'When's'. -test.md:208:1:compris.Contractions:Avoid contractions. Use 'When is' or 'When has' instead of 'When's'. -test.md:211:1:compris.Contractions:Avoid contractions. Use 'When will' instead of 'When'll'. -test.md:214:1:compris.Contractions:Avoid contractions. Use 'Where did' instead of 'Where'd'. -test.md:217:1:compris.Contractions:Avoid contractions. Use 'Where is' or 'Where has' instead of 'Where's'. -test.md:218:1:compris.Contractions:Avoid contractions. Use 'Where is' or 'Where has' instead of 'Where's'. -test.md:221:1:compris.Contractions:Avoid contractions. Use 'Where will' instead of 'Where'll'. -test.md:224:1:compris.Contractions:Avoid contractions. Use 'Which would' or 'Which had' instead of 'Which'd'. -test.md:227:1:compris.Contractions:Avoid contractions. Use 'Who had' or 'Who would' instead of 'Who'd'. -test.md:230:1:compris.Contractions:Avoid contractions. Use 'Who are' instead of 'Who're'. -test.md:233:1:compris.Contractions:Avoid contractions. Use 'Who is' or 'Who has' instead of 'Who's'. -test.md:234:1:compris.Contractions:Avoid contractions. Use 'Who is' or 'Who has' instead of 'Who's'. -test.md:237:1:compris.Contractions:Avoid contractions. Use 'Who will' instead of 'Who'll'. -test.md:240:1:compris.Contractions:Avoid contractions. Use 'Why are' instead of 'Why're'. -test.md:243:1:compris.Contractions:Avoid contractions. Use 'Why did' or 'Why would' instead of 'Why'd'. -test.md:246:1:compris.Contractions:Avoid contractions. Use 'Why is' or 'Why has' instead of 'Why's'. -test.md:249:5:compris.Contractions:Avoid contractions. Use 'will have' instead of 'will've'. -test.md:252:4:compris.Contractions:Avoid contractions. Use 'will not' instead of 'won't'. -test.md:255:12:compris.Contractions:Avoid contractions. Use 'with ' instead of 'w/'. -test.md:258:26:compris.Contractions:Avoid contractions. Use 'without' instead of 'w/o'. -test.md:261:3:compris.Contractions:Avoid contractions. Use 'would have' instead of 'would've'. -test.md:264:4:compris.Contractions:Avoid contractions. Use 'would not' instead of 'wouldn't'. -test.md:267:14:compris.Contractions:Avoid contractions. Use 'you are' instead of 'you're'. -test.md:270:1:compris.Contractions:Avoid contractions. Use 'You had' or 'You would' instead of 'You'd'. -test.md:271:4:compris.Contractions:Avoid contractions. Use 'you had' or 'you would' instead of 'you'd'. -test.md:274:7:compris.Contractions:Avoid contractions. Use 'you have' instead of 'you've'. -test.md:277:1:compris.Contractions:Avoid contractions. Use 'You will' instead of 'You'll'. +test.md:4:48:Prim.Contractions:Avoid contractions. Use 'accessibility' instead of 'a11y'. +test.md:7:13:Prim.Contractions:Avoid contractions. Use 'or' or 'also known as' instead of 'aka'. +test.md:8:28:Prim.Contractions:Avoid contractions. Use 'or' or 'also known as' instead of 'a.k.a'. +test.md:11:24:Prim.Contractions:Avoid contractions. Use 'are not' instead of 'aren't'. +test.md:14:27:Prim.Contractions:Avoid contractions. Use 'authentication' instead of 'authN'. +test.md:17:12:Prim.Contractions:Avoid contractions. Use 'authorization' instead of 'authZ'. +test.md:20:3:Prim.Contractions:Avoid contractions. Use 'cannot' instead of 'can't'. +test.md:23:3:Prim.Contractions:Avoid contractions. Use 'could have' instead of 'could've'. +test.md:26:5:Prim.Contractions:Avoid contractions. Use 'could not' instead of 'couldn't'. +test.md:29:4:Prim.Contractions:Avoid contractions. Use 'did not' instead of 'didn't'. +test.md:32:3:Prim.Contractions:Avoid contractions. Use 'do not' instead of 'don't'. +test.md:35:26:Prim.Contractions:Avoid contractions. Use 'does not' instead of 'doesn't'. +test.md:38:11:Prim.Contractions:Avoid contractions. Use 'globalization' instead of 'g11n'. +test.md:41:4:Prim.Contractions:Avoid contractions. Use 'had not' instead of 'hadn't'. +test.md:44:13:Prim.Contractions:Avoid contractions. Use 'has not' instead of 'hasn't'. +test.md:46:6:Prim.Contractions:Avoid contractions. Use 'have not' instead of 'haven't'. +test.md:50:1:Prim.Contractions:Avoid contractions. Use 'He had' or 'He would' instead of 'He'd'. +test.md:51:1:Prim.Contractions:Avoid contractions. Use 'He had' or 'He would' instead of 'He'd'. +test.md:54:1:Prim.Contractions:Avoid contractions. Use 'He is' or 'He has' instead of 'He's'. +test.md:55:1:Prim.Contractions:Avoid contractions. Use 'He is' or 'He has' instead of 'He's'. +test.md:58:1:Prim.Contractions:Avoid contractions. Use 'He will' or 'He shall' instead of 'He'll'. +test.md:61:1:Prim.Contractions:Avoid contractions. Use 'Here had' or 'Here would' instead of 'Here'd'. +test.md:62:1:Prim.Contractions:Avoid contractions. Use 'Here had' or 'Here would' instead of 'Here'd'. +test.md:65:1:Prim.Contractions:Avoid contractions. Use 'Here is' or 'Here has' instead of 'Here's'. +test.md:68:1:Prim.Contractions:Avoid contractions. Use 'How did' or 'How would' instead of 'How'd'. +test.md:69:1:Prim.Contractions:Avoid contractions. Use 'How did' or 'How would' instead of 'How'd'. +test.md:72:1:Prim.Contractions:Avoid contractions. Use 'How is' instead of 'How's'. +test.md:75:1:Prim.Contractions:Avoid contractions. Use 'How will' instead of 'How'll'. +test.md:78:1:Prim.Contractions:Avoid contractions. Use 'I am' instead of 'I'm'. +test.md:81:1:Prim.Contractions:Avoid contractions. Use 'I had' or 'I would' instead of 'I'd'. +test.md:84:1:Prim.Contractions:Avoid contractions. Use 'I have' instead of 'I've'. +test.md:87:1:Prim.Contractions:Avoid contractions. Use 'I will' instead of 'I'll'. +test.md:90:5:Prim.Contractions:Avoid contractions. Use 'internationalization' instead of 'i18n'. +test.md:93:11:Prim.Contractions:Avoid contractions. Use 'is not' instead of 'isn't'. +test.md:96:1:Prim.Contractions:Avoid contractions. Use 'It had' or 'It would' instead of 'It'd'. +test.md:97:1:Prim.Contractions:Avoid contractions. Use 'It had' or 'It would' instead of 'It'd'. +test.md:100:1:Prim.Contractions:Avoid contractions. Use 'It is' or 'It has' instead of 'It's'. +test.md:101:1:Prim.Contractions:Avoid contractions. Use 'It is' or 'It has' instead of 'It's'. +test.md:104:1:Prim.Contractions:Avoid contractions. Use 'It will' or 'It shall' instead of 'It'll'. +test.md:107:8:Prim.Contractions:Avoid contractions. Use 'Kubernetes' instead of 'k8s'. +test.md:110:1:Prim.Contractions:Avoid contractions. Use 'Let us' instead of 'Let's'. +test.md:113:5:Prim.Contractions:Avoid contractions. Use 'localization' instead of 'l10n'. +test.md:116:19:Prim.Contractions:Avoid contractions. Use 'personalization' instead of 'p13n'. +test.md:119:1:Prim.Contractions:Avoid contractions. Use 'She had' or 'She would' instead of 'She'd'. +test.md:120:1:Prim.Contractions:Avoid contractions. Use 'She had' or 'She would' instead of 'She'd'. +test.md:123:1:Prim.Contractions:Avoid contractions. Use 'She is' or 'She has' instead of 'She's'. +test.md:124:1:Prim.Contractions:Avoid contractions. Use 'She is' or 'She has' instead of 'She's'. +test.md:127:1:Prim.Contractions:Avoid contractions. Use 'She will' or 'She shall' instead of 'She'll'. +test.md:130:3:Prim.Contractions:Avoid contractions. Use 'should have' instead of 'should've'. +test.md:133:4:Prim.Contractions:Avoid contractions. Use 'should not' instead of 'shouldn't'. +test.md:136:1:Prim.Contractions:Avoid contractions. Use 'Somebody had' or 'Somebody would' instead of 'Somebody'd'. +test.md:137:1:Prim.Contractions:Avoid contractions. Use 'Somebody had' or 'Somebody would' instead of 'Somebody'd'. +test.md:140:1:Prim.Contractions:Avoid contractions. Use 'Someone had' or 'Someone would' instead of 'Someone'd'. +test.md:141:1:Prim.Contractions:Avoid contractions. Use 'Someone had' or 'Someone would' instead of 'Someone'd'. +test.md:144:12:Prim.Contractions:Avoid contractions. Use 'that had' or 'that would' instead of 'that'd'. +test.md:145:1:Prim.Contractions:Avoid contractions. Use 'That had' or 'That would' instead of 'That'd'. +test.md:148:1:Prim.Contractions:Avoid contractions. Use 'That is' or 'That has' instead of 'That's'. +test.md:149:9:Prim.Contractions:Avoid contractions. Use 'that is' or 'that has' instead of 'that's'. +test.md:152:25:Prim.Contractions:Avoid contractions. Use 'that will' instead of 'that'll'. +test.md:155:19:Prim.Contractions:Avoid contractions. Use 'they are' instead of 'they're'. +test.md:158:1:Prim.Contractions:Avoid contractions. Use 'There would' or 'There had' instead of 'There'd'. +test.md:159:1:Prim.Contractions:Avoid contractions. Use 'There would' or 'There had' instead of 'There'd'. +test.md:162:1:Prim.Contractions:Avoid contractions. Use 'There is' or 'There has' instead of 'There's'. +test.md:163:1:Prim.Contractions:Avoid contractions. Use 'There is' or 'There has' instead of 'There's'. +test.md:166:9:Prim.Contractions:Avoid contractions. Use 'they had' or 'they would' instead of 'they'd'. +test.md:167:1:Prim.Contractions:Avoid contractions. Use 'They had' or 'They would' instead of 'They'd'. +test.md:170:1:Prim.Contractions:Avoid contractions. Use 'They have' instead of 'They've'. +test.md:173:34:Prim.Contractions:Avoid contractions. Use 'they will' or 'they shall' instead of 'they'll'. +test.md:176:4:Prim.Contractions:Avoid contractions. Use 'was not' instead of 'wasn't'. +test.md:179:1:Prim.Contractions:Avoid contractions. Use 'We are' instead of 'We're'. +test.md:182:1:Prim.Contractions:Avoid contractions. Use 'We have' instead of 'We've'. +test.md:185:1:Prim.Contractions:Avoid contractions. Use 'We will' instead of 'We'll'. +test.md:188:1:Prim.Contractions:Avoid contractions. Use 'We would' or 'We had' instead of 'We'd'. +test.md:189:1:Prim.Contractions:Avoid contractions. Use 'We would' or 'We had' instead of 'We'd'. +test.md:192:11:Prim.Contractions:Avoid contractions. Use 'were not' instead of 'weren't'. +test.md:195:1:Prim.Contractions:Avoid contractions. Use 'What did' instead of 'What'd'. +test.md:198:1:Prim.Contractions:Avoid contractions. Use 'What is' instead of 'What's'. +test.md:201:1:Prim.Contractions:Avoid contractions. Use 'What will' instead of 'What'll'. +test.md:204:1:Prim.Contractions:Avoid contractions. Use 'When did' instead of 'When'd'. +test.md:207:1:Prim.Contractions:Avoid contractions. Use 'When is' or 'When has' instead of 'When's'. +test.md:208:1:Prim.Contractions:Avoid contractions. Use 'When is' or 'When has' instead of 'When's'. +test.md:211:1:Prim.Contractions:Avoid contractions. Use 'When will' instead of 'When'll'. +test.md:214:1:Prim.Contractions:Avoid contractions. Use 'Where did' instead of 'Where'd'. +test.md:217:1:Prim.Contractions:Avoid contractions. Use 'Where is' or 'Where has' instead of 'Where's'. +test.md:218:1:Prim.Contractions:Avoid contractions. Use 'Where is' or 'Where has' instead of 'Where's'. +test.md:221:1:Prim.Contractions:Avoid contractions. Use 'Where will' instead of 'Where'll'. +test.md:224:1:Prim.Contractions:Avoid contractions. Use 'Which would' or 'Which had' instead of 'Which'd'. +test.md:227:1:Prim.Contractions:Avoid contractions. Use 'Who had' or 'Who would' instead of 'Who'd'. +test.md:230:1:Prim.Contractions:Avoid contractions. Use 'Who are' instead of 'Who're'. +test.md:233:1:Prim.Contractions:Avoid contractions. Use 'Who is' or 'Who has' instead of 'Who's'. +test.md:234:1:Prim.Contractions:Avoid contractions. Use 'Who is' or 'Who has' instead of 'Who's'. +test.md:237:1:Prim.Contractions:Avoid contractions. Use 'Who will' instead of 'Who'll'. +test.md:240:1:Prim.Contractions:Avoid contractions. Use 'Why are' instead of 'Why're'. +test.md:243:1:Prim.Contractions:Avoid contractions. Use 'Why did' or 'Why would' instead of 'Why'd'. +test.md:246:1:Prim.Contractions:Avoid contractions. Use 'Why is' or 'Why has' instead of 'Why's'. +test.md:249:5:Prim.Contractions:Avoid contractions. Use 'will have' instead of 'will've'. +test.md:252:4:Prim.Contractions:Avoid contractions. Use 'will not' instead of 'won't'. +test.md:255:12:Prim.Contractions:Avoid contractions. Use 'with ' instead of 'w/'. +test.md:258:26:Prim.Contractions:Avoid contractions. Use 'without' instead of 'w/o'. +test.md:261:3:Prim.Contractions:Avoid contractions. Use 'would have' instead of 'would've'. +test.md:264:4:Prim.Contractions:Avoid contractions. Use 'would not' instead of 'wouldn't'. +test.md:267:14:Prim.Contractions:Avoid contractions. Use 'you are' instead of 'you're'. +test.md:270:1:Prim.Contractions:Avoid contractions. Use 'You had' or 'You would' instead of 'You'd'. +test.md:271:4:Prim.Contractions:Avoid contractions. Use 'you had' or 'you would' instead of 'you'd'. +test.md:274:7:Prim.Contractions:Avoid contractions. Use 'you have' instead of 'you've'. +test.md:277:1:Prim.Contractions:Avoid contractions. Use 'You will' instead of 'You'll'. diff --git a/test/expectations/Ellipsis.log b/test/expectations/Ellipsis.log index c919a16..eca3a61 100644 --- a/test/expectations/Ellipsis.log +++ b/test/expectations/Ellipsis.log @@ -1,2 +1,2 @@ -test.md:3:23:compris.Ellipsis:In general, don't use an ellipsis. -test.md:4:22:compris.Ellipsis:In general, don't use an ellipsis. +test.md:3:23:Prim.Ellipsis:In general, don't use an ellipsis. +test.md:4:22:Prim.Ellipsis:In general, don't use an ellipsis. diff --git a/test/expectations/EmDash.log b/test/expectations/EmDash.log index 491d0c0..bea0a5b 100644 --- a/test/expectations/EmDash.log +++ b/test/expectations/EmDash.log @@ -1,2 +1,2 @@ -test.md:3:16:compris.EmDash:Add spaces around '—'. -test.md:3:45:compris.EmDash:Add spaces around '—'. +test.md:3:16:Prim.EmDash:Add spaces around '—'. +test.md:3:45:Prim.EmDash:Add spaces around '—'. diff --git a/test/expectations/EnDash.log b/test/expectations/EnDash.log index 8c80e08..aa3240d 100644 --- a/test/expectations/EnDash.log +++ b/test/expectations/EnDash.log @@ -1,3 +1,3 @@ -test.md:3:47:compris.EnDash:Remove the spaces around '–'. -test.md:4:31:compris.EnDash:Remove the spaces around '–'. -test.md:5:42:compris.EnDash:Remove the spaces around '–'. +test.md:3:47:Prim.EnDash:Remove the spaces around '–'. +test.md:4:31:Prim.EnDash:Remove the spaces around '–'. +test.md:5:42:Prim.EnDash:Remove the spaces around '–'. diff --git a/test/expectations/Latin.log b/test/expectations/Latin.log index 47dbcfb..a470b7f 100644 --- a/test/expectations/Latin.log +++ b/test/expectations/Latin.log @@ -1,12 +1,12 @@ -test.md:4:13:compris.Latin:Avoid latin. Use 'around' or 'about' instead of 'circa'. -test.md:7:20:compris.Latin:Avoid latin. Use 'for example' instead of 'e.g.,'. -test.md:8:33:compris.Latin:Avoid latin. Use 'for example' instead of 'eg,'. -test.md:11:38:compris.Latin:Avoid latin. Use 'therefore' instead of 'ergo'. -test.md:14:8:compris.Latin:Avoid latin. Use 'and others' instead of 'et al.'. -test.md:17:38:compris.Latin:Avoid latin. Use 'and other(s)' instead of 'etc.'. -test.md:20:20:compris.Latin:Avoid latin. Use 'that is' instead of 'i.e.,'. -test.md:21:33:compris.Latin:Avoid latin. Use 'that is' instead of 'ie,'. -test.md:24:22:compris.Latin:Avoid latin. Use 'against' instead of 'vs.'. -test.md:27:26:compris.Latin:Avoid latin. Use 'against' instead of 'versus'. -test.md:30:33:compris.Latin:Avoid latin. Use 'over' or 'through' instead of 'via'. -test.md:33:31:compris.Latin:Avoid latin. Use 'namely' instead of 'viz.'. +test.md:4:13:Prim.Latin:Avoid latin. Use 'around' or 'about' instead of 'circa'. +test.md:7:20:Prim.Latin:Avoid latin. Use 'for example' instead of 'e.g.,'. +test.md:8:33:Prim.Latin:Avoid latin. Use 'for example' instead of 'eg,'. +test.md:11:38:Prim.Latin:Avoid latin. Use 'therefore' instead of 'ergo'. +test.md:14:8:Prim.Latin:Avoid latin. Use 'and others' instead of 'et al.'. +test.md:17:38:Prim.Latin:Avoid latin. Use 'and other(s)' instead of 'etc.'. +test.md:20:20:Prim.Latin:Avoid latin. Use 'that is' instead of 'i.e.,'. +test.md:21:33:Prim.Latin:Avoid latin. Use 'that is' instead of 'ie,'. +test.md:24:22:Prim.Latin:Avoid latin. Use 'against' instead of 'vs.'. +test.md:27:26:Prim.Latin:Avoid latin. Use 'against' instead of 'versus'. +test.md:30:33:Prim.Latin:Avoid latin. Use 'over' or 'through' instead of 'via'. +test.md:33:31:Prim.Latin:Avoid latin. Use 'namely' instead of 'viz.'. diff --git a/test/expectations/OptionalPlurals.log b/test/expectations/OptionalPlurals.log index 601fb0a..02a4195 100644 --- a/test/expectations/OptionalPlurals.log +++ b/test/expectations/OptionalPlurals.log @@ -1,2 +1,2 @@ -test.md:3:23:compris.OptionalPlurals:Don't use plurals in parentheses such as in 'extension(s)'. -test.md:4:5:compris.OptionalPlurals:Don't use plurals in parentheses such as in 'checkbox(es)'. +test.md:3:23:Prim.OptionalPlurals:Don't use plurals in parentheses such as in 'extension(s)'. +test.md:4:5:Prim.OptionalPlurals:Don't use plurals in parentheses such as in 'checkbox(es)'. diff --git a/test/expectations/Ordinal.log b/test/expectations/Ordinal.log index b9fc9a4..b894205 100644 --- a/test/expectations/Ordinal.log +++ b/test/expectations/Ordinal.log @@ -1,3 +1,3 @@ -test.md:3:1:compris.Ordinal:Don't add -ly to an ordinal number. -test.md:3:45:compris.Ordinal:Don't add -ly to an ordinal number. -test.md:3:84:compris.Ordinal:Don't add -ly to an ordinal number. +test.md:3:1:Prim.Ordinal:Don't add -ly to an ordinal number. +test.md:3:45:Prim.Ordinal:Don't add -ly to an ordinal number. +test.md:3:84:Prim.Ordinal:Don't add -ly to an ordinal number. diff --git a/test/expectations/OxfordComma.log b/test/expectations/OxfordComma.log index 1db63b0..ab71e4c 100644 --- a/test/expectations/OxfordComma.log +++ b/test/expectations/OxfordComma.log @@ -1,2 +1,2 @@ -test.md:3:41:compris.OxfordComma:Use the Oxford comma in 'flour, sugar, eggs and butter.'. -test.md:5:20:compris.OxfordComma:Use the Oxford comma in 'clothes, toiletries or books?'. +test.md:3:41:Prim.OxfordComma:Use the Oxford comma in 'flour, sugar, eggs and butter.'. +test.md:5:20:Prim.OxfordComma:Use the Oxford comma in 'clothes, toiletries or books?'. diff --git a/test/expectations/Percentages.log b/test/expectations/Percentages.log index 0bcbce5..2168458 100644 --- a/test/expectations/Percentages.log +++ b/test/expectations/Percentages.log @@ -1 +1 @@ -test.md:3:28:compris.Percentages:Use a numeral to represent a percentage. +test.md:3:28:Prim.Percentages:Use a numeral to represent a percentage. diff --git a/test/expectations/PreferredAlternatives.log b/test/expectations/PreferredAlternatives.log index 6eb6ad6..a55f5e5 100644 --- a/test/expectations/PreferredAlternatives.log +++ b/test/expectations/PreferredAlternatives.log @@ -1,3 +1,3 @@ -test.md:4:36:compris.PreferredAlternatives:Prefer using 'Zero-day' over '0-day'. -test.md:7:39:compris.PreferredAlternatives:Prefer using 'Midnight' over '12 am'. -test.md:10:30:compris.PreferredAlternatives:Prefer using 'Noon' over '12 pm'. +test.md:4:36:Prim.PreferredAlternatives:Prefer using 'Zero-day' over '0-day'. +test.md:7:39:Prim.PreferredAlternatives:Prefer using 'Midnight' over '12 am'. +test.md:10:30:Prim.PreferredAlternatives:Prefer using 'Noon' over '12 pm'. diff --git a/test/expectations/RequiredAlternatives.log b/test/expectations/RequiredAlternatives.log index 19a30bb..2866a5a 100644 --- a/test/expectations/RequiredAlternatives.log +++ b/test/expectations/RequiredAlternatives.log @@ -1,6 +1,6 @@ -test.md:4:34:compris.RequiredAlternatives:Use '24x7' instead of '24/7'. -test.md:7:27:compris.RequiredAlternatives:Use '3D' instead of '3-D'. -test.md:10:19:compris.RequiredAlternatives:Use 'sync' instead of 'synch'. -test.md:13:17:compris.RequiredAlternatives:Use 'URL' instead of 'url'. -test.md:14:5:compris.RequiredAlternatives:Use 'URL of' instead of 'URL for'. -test.md:15:10:compris.RequiredAlternatives:Use 'a URL' instead of 'an URL'. +test.md:4:34:Prim.RequiredAlternatives:Use '24x7' instead of '24/7'. +test.md:7:27:Prim.RequiredAlternatives:Use '3D' instead of '3-D'. +test.md:10:19:Prim.RequiredAlternatives:Use 'sync' instead of 'synch'. +test.md:13:17:Prim.RequiredAlternatives:Use 'URL' instead of 'url'. +test.md:14:5:Prim.RequiredAlternatives:Use 'URL of' instead of 'URL for'. +test.md:15:10:Prim.RequiredAlternatives:Use 'a URL' instead of 'an URL'. diff --git a/test/expectations/Semicolon.log b/test/expectations/Semicolon.log index 19ec4a8..410b6c2 100644 --- a/test/expectations/Semicolon.log +++ b/test/expectations/Semicolon.log @@ -1 +1 @@ -test.md:3:33:compris.Semicolon:Try to simplify this sentence. +test.md:3:33:Prim.Semicolon:Try to simplify this sentence. diff --git a/test/expectations/SentenceLength.log b/test/expectations/SentenceLength.log index f26ffbd..9161925 100644 --- a/test/expectations/SentenceLength.log +++ b/test/expectations/SentenceLength.log @@ -1 +1 @@ -test.md:3:1:compris.SentenceLength:Try to keep sentences short (< 30 words). +test.md:3:1:Prim.SentenceLength:Try to keep sentences short (< 30 words). diff --git a/test/expectations/SimplerAlternatives.log b/test/expectations/SimplerAlternatives.log index 291e784..ef0be75 100644 --- a/test/expectations/SimplerAlternatives.log +++ b/test/expectations/SimplerAlternatives.log @@ -1 +1 @@ -test.md:4:31:compris.SimplerAlternatives:Use 'about' instead of 'approximately'. +test.md:4:31:Prim.SimplerAlternatives:Use 'about' instead of 'approximately'. diff --git a/test/expectations/Space.log b/test/expectations/Space.log index 434a07b..e04f8f3 100644 --- a/test/expectations/Space.log +++ b/test/expectations/Space.log @@ -1,6 +1,6 @@ -test.md:3:20:compris.Space:'garden bloomed' should have one space between them. -test.md:4:35:compris.Space:'door. It' should have one space between them. -test.md:5:18:compris.Space:'melody.It' should have one space between them. -test.md:6:29:compris.Space:'ruins? They' should have one space between them. -test.md:7:32:compris.Space:', marveling' should have one space between them. -test.md:8:1:compris.Space:'Whoa! This' should have one space between them. +test.md:3:20:Prim.Space:'garden bloomed' should have one space between them. +test.md:4:35:Prim.Space:'door. It' should have one space between them. +test.md:5:18:Prim.Space:'melody.It' should have one space between them. +test.md:6:29:Prim.Space:'ruins? They' should have one space between them. +test.md:7:32:Prim.Space:', marveling' should have one space between them. +test.md:8:1:Prim.Space:'Whoa! This' should have one space between them. diff --git a/test/expectations/WordRepitition.log b/test/expectations/WordRepitition.log index e031d71..c532e86 100644 --- a/test/expectations/WordRepitition.log +++ b/test/expectations/WordRepitition.log @@ -1 +1 @@ -test.md:3:14:compris.WordRepitition:'zoom' is repeated. +test.md:3:14:Prim.WordRepitition:'zoom' is repeated. From 10ac0c1a93f906dd2ff00e49231a8751b956300f Mon Sep 17 00:00:00 2001 From: Naiyer <19614213+naiyerasif@users.noreply.github.com> Date: Sun, 24 Mar 2024 08:03:53 +0530 Subject: [PATCH 06/10] test: switch to snapshot tests --- README.md | 8 ++--- package.json | 1 + test/expectations/Semicolon.log | 1 - test/expectations/WordRepitition.log | 1 - {fixtures => test/fixtures}/AMPM/.vale.ini | 2 +- {fixtures => test/fixtures}/AMPM/test.md | 0 .../fixtures}/AbbreviationPeriods/.vale.ini | 2 +- .../fixtures}/AbbreviationPeriods/test.md | 0 .../fixtures}/Ambiguity/.vale.ini | 2 +- {fixtures => test/fixtures}/Ambiguity/test.md | 0 .../fixtures}/Contractions/.vale.ini | 2 +- .../fixtures}/Contractions/test.md | 0 .../fixtures}/Ellipsis/.vale.ini | 2 +- {fixtures => test/fixtures}/Ellipsis/test.md | 0 {fixtures => test/fixtures}/EmDash/.vale.ini | 2 +- {fixtures => test/fixtures}/EmDash/test.md | 0 {fixtures => test/fixtures}/EnDash/.vale.ini | 2 +- {fixtures => test/fixtures}/EnDash/test.md | 0 {fixtures => test/fixtures}/Latin/.vale.ini | 2 +- {fixtures => test/fixtures}/Latin/test.md | 0 .../fixtures}/OptionalPlurals/.vale.ini | 2 +- .../fixtures}/OptionalPlurals/test.md | 0 {fixtures => test/fixtures}/Ordinal/.vale.ini | 2 +- {fixtures => test/fixtures}/Ordinal/test.md | 0 .../fixtures}/OxfordComma/.vale.ini | 2 +- .../fixtures}/OxfordComma/test.md | 0 .../fixtures}/Percentages/.vale.ini | 2 +- .../fixtures}/Percentages/test.md | 0 .../fixtures}/PreferredAlternatives/.vale.ini | 2 +- .../fixtures}/PreferredAlternatives/test.md | 0 .../fixtures}/RequiredAlternatives/.vale.ini | 2 +- .../fixtures}/RequiredAlternatives/test.md | 0 .../fixtures}/Semicolon/.vale.ini | 2 +- {fixtures => test/fixtures}/Semicolon/test.md | 0 .../fixtures}/SentenceLength/.vale.ini | 2 +- .../fixtures}/SentenceLength/test.md | 0 .../fixtures}/SimplerAlternatives/.vale.ini | 2 +- .../fixtures}/SimplerAlternatives/test.md | 0 {fixtures => test/fixtures}/Space/.vale.ini | 2 +- {fixtures => test/fixtures}/Space/test.md | 0 .../fixtures}/WordRepitition/.vale.ini | 2 +- .../fixtures}/WordRepitition/test.md | 0 test/rules.parameters.js | 34 +++++++------------ test/rules.test.js | 15 ++++---- test/{expectations => snapshots}/AMPM.log | 2 +- .../AbbreviationPeriods.log | 2 +- .../{expectations => snapshots}/Ambiguity.log | 2 +- .../Contractions.log | 2 +- test/{expectations => snapshots}/Ellipsis.log | 2 +- test/{expectations => snapshots}/EmDash.log | 2 +- test/{expectations => snapshots}/EnDash.log | 2 +- test/{expectations => snapshots}/Latin.log | 2 +- .../OptionalPlurals.log | 2 +- test/{expectations => snapshots}/Ordinal.log | 2 +- .../OxfordComma.log | 2 +- .../Percentages.log | 2 +- .../PreferredAlternatives.log | 2 +- .../RequiredAlternatives.log | 2 +- test/snapshots/Semicolon.log | 1 + .../SentenceLength.log | 2 +- .../SimplerAlternatives.log | 2 +- test/{expectations => snapshots}/Space.log | 2 +- test/snapshots/WordRepitition.log | 1 + 63 files changed, 63 insertions(+), 71 deletions(-) delete mode 100644 test/expectations/Semicolon.log delete mode 100644 test/expectations/WordRepitition.log rename {fixtures => test/fixtures}/AMPM/.vale.ini (69%) rename {fixtures => test/fixtures}/AMPM/test.md (100%) rename {fixtures => test/fixtures}/AbbreviationPeriods/.vale.ini (74%) rename {fixtures => test/fixtures}/AbbreviationPeriods/test.md (100%) rename {fixtures => test/fixtures}/Ambiguity/.vale.ini (71%) rename {fixtures => test/fixtures}/Ambiguity/test.md (100%) rename {fixtures => test/fixtures}/Contractions/.vale.ini (72%) rename {fixtures => test/fixtures}/Contractions/test.md (100%) rename {fixtures => test/fixtures}/Ellipsis/.vale.ini (70%) rename {fixtures => test/fixtures}/Ellipsis/test.md (100%) rename {fixtures => test/fixtures}/EmDash/.vale.ini (70%) rename {fixtures => test/fixtures}/EmDash/test.md (100%) rename {fixtures => test/fixtures}/EnDash/.vale.ini (70%) rename {fixtures => test/fixtures}/EnDash/test.md (100%) rename {fixtures => test/fixtures}/Latin/.vale.ini (69%) rename {fixtures => test/fixtures}/Latin/test.md (100%) rename {fixtures => test/fixtures}/OptionalPlurals/.vale.ini (73%) rename {fixtures => test/fixtures}/OptionalPlurals/test.md (100%) rename {fixtures => test/fixtures}/Ordinal/.vale.ini (70%) rename {fixtures => test/fixtures}/Ordinal/test.md (100%) rename {fixtures => test/fixtures}/OxfordComma/.vale.ini (71%) rename {fixtures => test/fixtures}/OxfordComma/test.md (100%) rename {fixtures => test/fixtures}/Percentages/.vale.ini (71%) rename {fixtures => test/fixtures}/Percentages/test.md (100%) rename {fixtures => test/fixtures}/PreferredAlternatives/.vale.ini (75%) rename {fixtures => test/fixtures}/PreferredAlternatives/test.md (100%) rename {fixtures => test/fixtures}/RequiredAlternatives/.vale.ini (74%) rename {fixtures => test/fixtures}/RequiredAlternatives/test.md (100%) rename {fixtures => test/fixtures}/Semicolon/.vale.ini (71%) rename {fixtures => test/fixtures}/Semicolon/test.md (100%) rename {fixtures => test/fixtures}/SentenceLength/.vale.ini (72%) rename {fixtures => test/fixtures}/SentenceLength/test.md (100%) rename {fixtures => test/fixtures}/SimplerAlternatives/.vale.ini (74%) rename {fixtures => test/fixtures}/SimplerAlternatives/test.md (100%) rename {fixtures => test/fixtures}/Space/.vale.ini (69%) rename {fixtures => test/fixtures}/Space/test.md (100%) rename {fixtures => test/fixtures}/WordRepitition/.vale.ini (72%) rename {fixtures => test/fixtures}/WordRepitition/test.md (100%) rename test/{expectations => snapshots}/AMPM.log (95%) rename test/{expectations => snapshots}/AbbreviationPeriods.log (65%) rename test/{expectations => snapshots}/Ambiguity.log (98%) rename test/{expectations => snapshots}/Contractions.log (99%) rename test/{expectations => snapshots}/Ellipsis.log (50%) rename test/{expectations => snapshots}/EmDash.log (50%) rename test/{expectations => snapshots}/EnDash.log (66%) rename test/{expectations => snapshots}/Latin.log (99%) rename test/{expectations => snapshots}/OptionalPlurals.log (84%) rename test/{expectations => snapshots}/Ordinal.log (66%) rename test/{expectations => snapshots}/OxfordComma.log (86%) rename test/{expectations => snapshots}/Percentages.log (90%) rename test/{expectations => snapshots}/PreferredAlternatives.log (95%) rename test/{expectations => snapshots}/RequiredAlternatives.log (97%) create mode 100644 test/snapshots/Semicolon.log rename test/{expectations => snapshots}/SentenceLength.log (86%) rename test/{expectations => snapshots}/SimplerAlternatives.log (82%) rename test/{expectations => snapshots}/Space.log (98%) create mode 100644 test/snapshots/WordRepitition.log diff --git a/README.md b/README.md index 3ba4570..1274b8d 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,8 @@ To sync the latest updates, run `vale sync`. ## Development - [Rules](./Prim/) are written in `yml` files using the syntax described by [Vale docs](https://vale.sh/docs/). -- Every rule has a [fixture](./fixtures/) against which you can run tests. -- Tests are run against the [log output](./test/expectations/) of Vale. +- Every rule has a [fixture](./test/fixtures/) against which you can run tests. +- Tests are run against the [log output snapshots](./test/snapshots/) of Vale. ### Prerequisites @@ -53,8 +53,8 @@ Run `pnpm i` to download the test dependencies; you would need them to run the t A typical workflow looks like this. 1. Add a new rule by creating a new `Prim/.yml` file, or modify an existing rule in the existing `Prim/.yml` file. -2. Add or update the fixtures in the `fixtures//test.md` directory. -3. Add the expected logs in the `test/expectations/.log` file. +2. Add or update the fixtures in the `test/fixtures//test.md` directory. +3. Generate or update a snapshot with `pnpm snapshot:update` 4. Run `pnpm test` to run the tests. ## License diff --git a/package.json b/package.json index b09b25c..d91b205 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.0.3", "description": "A Vale-compatible prose style for non-native English speaker", "scripts": { + "snapshot:update": "vitest rules --update", "test": "vitest rules", "dist": "zip -r Prim.zip Prim -x \"*.DS_Store\"" }, diff --git a/test/expectations/Semicolon.log b/test/expectations/Semicolon.log deleted file mode 100644 index 410b6c2..0000000 --- a/test/expectations/Semicolon.log +++ /dev/null @@ -1 +0,0 @@ -test.md:3:33:Prim.Semicolon:Try to simplify this sentence. diff --git a/test/expectations/WordRepitition.log b/test/expectations/WordRepitition.log deleted file mode 100644 index c532e86..0000000 --- a/test/expectations/WordRepitition.log +++ /dev/null @@ -1 +0,0 @@ -test.md:3:14:Prim.WordRepitition:'zoom' is repeated. diff --git a/fixtures/AMPM/.vale.ini b/test/fixtures/AMPM/.vale.ini similarity index 69% rename from fixtures/AMPM/.vale.ini rename to test/fixtures/AMPM/.vale.ini index 3f3811d..86b33c5 100644 --- a/fixtures/AMPM/.vale.ini +++ b/test/fixtures/AMPM/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/AMPM/test.md b/test/fixtures/AMPM/test.md similarity index 100% rename from fixtures/AMPM/test.md rename to test/fixtures/AMPM/test.md diff --git a/fixtures/AbbreviationPeriods/.vale.ini b/test/fixtures/AbbreviationPeriods/.vale.ini similarity index 74% rename from fixtures/AbbreviationPeriods/.vale.ini rename to test/fixtures/AbbreviationPeriods/.vale.ini index c5e0015..741bca0 100644 --- a/fixtures/AbbreviationPeriods/.vale.ini +++ b/test/fixtures/AbbreviationPeriods/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/AbbreviationPeriods/test.md b/test/fixtures/AbbreviationPeriods/test.md similarity index 100% rename from fixtures/AbbreviationPeriods/test.md rename to test/fixtures/AbbreviationPeriods/test.md diff --git a/fixtures/Ambiguity/.vale.ini b/test/fixtures/Ambiguity/.vale.ini similarity index 71% rename from fixtures/Ambiguity/.vale.ini rename to test/fixtures/Ambiguity/.vale.ini index c3c4ac5..35fab90 100644 --- a/fixtures/Ambiguity/.vale.ini +++ b/test/fixtures/Ambiguity/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/Ambiguity/test.md b/test/fixtures/Ambiguity/test.md similarity index 100% rename from fixtures/Ambiguity/test.md rename to test/fixtures/Ambiguity/test.md diff --git a/fixtures/Contractions/.vale.ini b/test/fixtures/Contractions/.vale.ini similarity index 72% rename from fixtures/Contractions/.vale.ini rename to test/fixtures/Contractions/.vale.ini index b74bac0..07f12f6 100644 --- a/fixtures/Contractions/.vale.ini +++ b/test/fixtures/Contractions/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/Contractions/test.md b/test/fixtures/Contractions/test.md similarity index 100% rename from fixtures/Contractions/test.md rename to test/fixtures/Contractions/test.md diff --git a/fixtures/Ellipsis/.vale.ini b/test/fixtures/Ellipsis/.vale.ini similarity index 70% rename from fixtures/Ellipsis/.vale.ini rename to test/fixtures/Ellipsis/.vale.ini index c6a429a..dbcf21d 100644 --- a/fixtures/Ellipsis/.vale.ini +++ b/test/fixtures/Ellipsis/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/Ellipsis/test.md b/test/fixtures/Ellipsis/test.md similarity index 100% rename from fixtures/Ellipsis/test.md rename to test/fixtures/Ellipsis/test.md diff --git a/fixtures/EmDash/.vale.ini b/test/fixtures/EmDash/.vale.ini similarity index 70% rename from fixtures/EmDash/.vale.ini rename to test/fixtures/EmDash/.vale.ini index 5528a87..71b02ea 100644 --- a/fixtures/EmDash/.vale.ini +++ b/test/fixtures/EmDash/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/EmDash/test.md b/test/fixtures/EmDash/test.md similarity index 100% rename from fixtures/EmDash/test.md rename to test/fixtures/EmDash/test.md diff --git a/fixtures/EnDash/.vale.ini b/test/fixtures/EnDash/.vale.ini similarity index 70% rename from fixtures/EnDash/.vale.ini rename to test/fixtures/EnDash/.vale.ini index e73a605..a5e55cd 100644 --- a/fixtures/EnDash/.vale.ini +++ b/test/fixtures/EnDash/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/EnDash/test.md b/test/fixtures/EnDash/test.md similarity index 100% rename from fixtures/EnDash/test.md rename to test/fixtures/EnDash/test.md diff --git a/fixtures/Latin/.vale.ini b/test/fixtures/Latin/.vale.ini similarity index 69% rename from fixtures/Latin/.vale.ini rename to test/fixtures/Latin/.vale.ini index a792b5c..bd23622 100644 --- a/fixtures/Latin/.vale.ini +++ b/test/fixtures/Latin/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/Latin/test.md b/test/fixtures/Latin/test.md similarity index 100% rename from fixtures/Latin/test.md rename to test/fixtures/Latin/test.md diff --git a/fixtures/OptionalPlurals/.vale.ini b/test/fixtures/OptionalPlurals/.vale.ini similarity index 73% rename from fixtures/OptionalPlurals/.vale.ini rename to test/fixtures/OptionalPlurals/.vale.ini index 16b2b01..453c829 100644 --- a/fixtures/OptionalPlurals/.vale.ini +++ b/test/fixtures/OptionalPlurals/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/OptionalPlurals/test.md b/test/fixtures/OptionalPlurals/test.md similarity index 100% rename from fixtures/OptionalPlurals/test.md rename to test/fixtures/OptionalPlurals/test.md diff --git a/fixtures/Ordinal/.vale.ini b/test/fixtures/Ordinal/.vale.ini similarity index 70% rename from fixtures/Ordinal/.vale.ini rename to test/fixtures/Ordinal/.vale.ini index 43a8416..1d018c4 100644 --- a/fixtures/Ordinal/.vale.ini +++ b/test/fixtures/Ordinal/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/Ordinal/test.md b/test/fixtures/Ordinal/test.md similarity index 100% rename from fixtures/Ordinal/test.md rename to test/fixtures/Ordinal/test.md diff --git a/fixtures/OxfordComma/.vale.ini b/test/fixtures/OxfordComma/.vale.ini similarity index 71% rename from fixtures/OxfordComma/.vale.ini rename to test/fixtures/OxfordComma/.vale.ini index 7015824..c4c905e 100644 --- a/fixtures/OxfordComma/.vale.ini +++ b/test/fixtures/OxfordComma/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/OxfordComma/test.md b/test/fixtures/OxfordComma/test.md similarity index 100% rename from fixtures/OxfordComma/test.md rename to test/fixtures/OxfordComma/test.md diff --git a/fixtures/Percentages/.vale.ini b/test/fixtures/Percentages/.vale.ini similarity index 71% rename from fixtures/Percentages/.vale.ini rename to test/fixtures/Percentages/.vale.ini index 0421e64..18f2671 100644 --- a/fixtures/Percentages/.vale.ini +++ b/test/fixtures/Percentages/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/Percentages/test.md b/test/fixtures/Percentages/test.md similarity index 100% rename from fixtures/Percentages/test.md rename to test/fixtures/Percentages/test.md diff --git a/fixtures/PreferredAlternatives/.vale.ini b/test/fixtures/PreferredAlternatives/.vale.ini similarity index 75% rename from fixtures/PreferredAlternatives/.vale.ini rename to test/fixtures/PreferredAlternatives/.vale.ini index 627151f..2b946ad 100644 --- a/fixtures/PreferredAlternatives/.vale.ini +++ b/test/fixtures/PreferredAlternatives/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/PreferredAlternatives/test.md b/test/fixtures/PreferredAlternatives/test.md similarity index 100% rename from fixtures/PreferredAlternatives/test.md rename to test/fixtures/PreferredAlternatives/test.md diff --git a/fixtures/RequiredAlternatives/.vale.ini b/test/fixtures/RequiredAlternatives/.vale.ini similarity index 74% rename from fixtures/RequiredAlternatives/.vale.ini rename to test/fixtures/RequiredAlternatives/.vale.ini index f00ba8e..dbef0ae 100644 --- a/fixtures/RequiredAlternatives/.vale.ini +++ b/test/fixtures/RequiredAlternatives/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/RequiredAlternatives/test.md b/test/fixtures/RequiredAlternatives/test.md similarity index 100% rename from fixtures/RequiredAlternatives/test.md rename to test/fixtures/RequiredAlternatives/test.md diff --git a/fixtures/Semicolon/.vale.ini b/test/fixtures/Semicolon/.vale.ini similarity index 71% rename from fixtures/Semicolon/.vale.ini rename to test/fixtures/Semicolon/.vale.ini index f893bbd..e3b3e75 100644 --- a/fixtures/Semicolon/.vale.ini +++ b/test/fixtures/Semicolon/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/Semicolon/test.md b/test/fixtures/Semicolon/test.md similarity index 100% rename from fixtures/Semicolon/test.md rename to test/fixtures/Semicolon/test.md diff --git a/fixtures/SentenceLength/.vale.ini b/test/fixtures/SentenceLength/.vale.ini similarity index 72% rename from fixtures/SentenceLength/.vale.ini rename to test/fixtures/SentenceLength/.vale.ini index 14cd488..a1e412b 100644 --- a/fixtures/SentenceLength/.vale.ini +++ b/test/fixtures/SentenceLength/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/SentenceLength/test.md b/test/fixtures/SentenceLength/test.md similarity index 100% rename from fixtures/SentenceLength/test.md rename to test/fixtures/SentenceLength/test.md diff --git a/fixtures/SimplerAlternatives/.vale.ini b/test/fixtures/SimplerAlternatives/.vale.ini similarity index 74% rename from fixtures/SimplerAlternatives/.vale.ini rename to test/fixtures/SimplerAlternatives/.vale.ini index e1a2c5c..991affc 100644 --- a/fixtures/SimplerAlternatives/.vale.ini +++ b/test/fixtures/SimplerAlternatives/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/SimplerAlternatives/test.md b/test/fixtures/SimplerAlternatives/test.md similarity index 100% rename from fixtures/SimplerAlternatives/test.md rename to test/fixtures/SimplerAlternatives/test.md diff --git a/fixtures/Space/.vale.ini b/test/fixtures/Space/.vale.ini similarity index 69% rename from fixtures/Space/.vale.ini rename to test/fixtures/Space/.vale.ini index e7313ef..e14824e 100644 --- a/fixtures/Space/.vale.ini +++ b/test/fixtures/Space/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/Space/test.md b/test/fixtures/Space/test.md similarity index 100% rename from fixtures/Space/test.md rename to test/fixtures/Space/test.md diff --git a/fixtures/WordRepitition/.vale.ini b/test/fixtures/WordRepitition/.vale.ini similarity index 72% rename from fixtures/WordRepitition/.vale.ini rename to test/fixtures/WordRepitition/.vale.ini index 37d0be0..6812fed 100644 --- a/fixtures/WordRepitition/.vale.ini +++ b/test/fixtures/WordRepitition/.vale.ini @@ -1,4 +1,4 @@ -StylesPath = ../../ +StylesPath = ../../../ MinAlertLevel = suggestion diff --git a/fixtures/WordRepitition/test.md b/test/fixtures/WordRepitition/test.md similarity index 100% rename from fixtures/WordRepitition/test.md rename to test/fixtures/WordRepitition/test.md diff --git a/test/rules.parameters.js b/test/rules.parameters.js index 90b101a..8dd791b 100644 --- a/test/rules.parameters.js +++ b/test/rules.parameters.js @@ -1,27 +1,17 @@ import fs from "fs"; import path from "path"; -function* walkSync(dir) { - const files = fs.readdirSync(dir, { withFileTypes: true }); - for (const file of files) { - if (file.isDirectory()) { - yield* walkSync(path.join(dir, file.name)); - } else { - yield path.join(dir, file.name); - } - } -} +const testDirectory = "test"; +const fixturesDirectory = "fixtures"; -const dir = path.resolve(process.cwd(), "test", "expectations"); -const extension = ".log"; -const parameters = []; +const fixturesRoot = path.resolve(process.cwd(), testDirectory, fixturesDirectory); +const parameters = fs.readdirSync(fixturesRoot, { + withFileTypes: false, + recursive: false +}).map(fpath => path.basename(fpath)); -for (const filePath of walkSync(dir)) { - if (path.extname(filePath).toLowerCase() === extension) { - const fileName = path.basename(filePath).replace(extension, ""); - const fileContent = fs.readFileSync(filePath).toString().trim(); - parameters.push([fileName, fileContent]); - } -} - -export default parameters; +export { + parameters as default, + testDirectory, + fixturesDirectory +}; diff --git a/test/rules.test.js b/test/rules.test.js index 151f20a..b8e225b 100644 --- a/test/rules.test.js +++ b/test/rules.test.js @@ -1,7 +1,7 @@ import path from "path"; import { execa } from "execa"; -import { expect, test } from "vitest"; -import scenario from "./rules.parameters.js"; +import { expect, it } from "vitest"; +import scenario, { testDirectory, fixturesDirectory } from "./rules.parameters.js"; const command = "vale"; const args = [ @@ -11,17 +11,18 @@ const args = [ "--relative", "test.md" ] -const fixturesDirectory = "fixtures"; +const snapshotsDirectory = "snapshots"; -test.each(scenario)(`Test: %s`, async (rule, expected) => { +it.each(scenario)(`Test: %s`, async (rule) => { let result; try { - const cwd = path.resolve(process.cwd(), fixturesDirectory, rule); - const output = await execa(command, args, { cwd: cwd }); + const fixtureLocation = path.resolve(process.cwd(), testDirectory, fixturesDirectory, rule); + const output = await execa(command, args, { cwd: fixtureLocation }); result = output.stdout; } catch (error) { result = error.stdout; } - expect.soft(result.trim()).toBe(expected); + const snapshotFile = path.resolve(process.cwd(), testDirectory, snapshotsDirectory, `${rule}.log`); + await expect(result).toMatchFileSnapshot(snapshotFile); }); diff --git a/test/expectations/AMPM.log b/test/snapshots/AMPM.log similarity index 95% rename from test/expectations/AMPM.log rename to test/snapshots/AMPM.log index fd479e1..8354685 100644 --- a/test/expectations/AMPM.log +++ b/test/snapshots/AMPM.log @@ -2,4 +2,4 @@ test.md:3:24:Prim.AMPM:Use 'am' or 'pm' else 'a.m.' or 'p.m.' (preceded by a spa test.md:4:33:Prim.AMPM:Use 'am' or 'pm' else 'a.m.' or 'p.m.' (preceded by a space). test.md:4:41:Prim.AMPM:Use 'am' or 'pm' else 'a.m.' or 'p.m.' (preceded by a space). test.md:5:33:Prim.AMPM:Use 'am' or 'pm' else 'a.m.' or 'p.m.' (preceded by a space). -test.md:6:30:Prim.AMPM:Use 'am' or 'pm' else 'a.m.' or 'p.m.' (preceded by a space). +test.md:6:30:Prim.AMPM:Use 'am' or 'pm' else 'a.m.' or 'p.m.' (preceded by a space). \ No newline at end of file diff --git a/test/expectations/AbbreviationPeriods.log b/test/snapshots/AbbreviationPeriods.log similarity index 65% rename from test/expectations/AbbreviationPeriods.log rename to test/snapshots/AbbreviationPeriods.log index cbda784..691f91b 100644 --- a/test/expectations/AbbreviationPeriods.log +++ b/test/snapshots/AbbreviationPeriods.log @@ -1 +1 @@ -test.md:3:45:Prim.AbbreviationPeriods:Don't use periods with abbreviations such as 'H.T.T.P.S.'. +test.md:3:45:Prim.AbbreviationPeriods:Don't use periods with abbreviations such as 'H.T.T.P.S.'. \ No newline at end of file diff --git a/test/expectations/Ambiguity.log b/test/snapshots/Ambiguity.log similarity index 98% rename from test/expectations/Ambiguity.log rename to test/snapshots/Ambiguity.log index 7e64d08..a342561 100644 --- a/test/expectations/Ambiguity.log +++ b/test/snapshots/Ambiguity.log @@ -1 +1 @@ -test.md:3:49:Prim.Ambiguity:Avoid ambiguity. Don't use 'and/or'. +test.md:3:49:Prim.Ambiguity:Avoid ambiguity. Don't use 'and/or'. \ No newline at end of file diff --git a/test/expectations/Contractions.log b/test/snapshots/Contractions.log similarity index 99% rename from test/expectations/Contractions.log rename to test/snapshots/Contractions.log index 7ee9d4b..36131d2 100644 --- a/test/expectations/Contractions.log +++ b/test/snapshots/Contractions.log @@ -103,4 +103,4 @@ test.md:267:14:Prim.Contractions:Avoid contractions. Use 'you are' instead of 'y test.md:270:1:Prim.Contractions:Avoid contractions. Use 'You had' or 'You would' instead of 'You'd'. test.md:271:4:Prim.Contractions:Avoid contractions. Use 'you had' or 'you would' instead of 'you'd'. test.md:274:7:Prim.Contractions:Avoid contractions. Use 'you have' instead of 'you've'. -test.md:277:1:Prim.Contractions:Avoid contractions. Use 'You will' instead of 'You'll'. +test.md:277:1:Prim.Contractions:Avoid contractions. Use 'You will' instead of 'You'll'. \ No newline at end of file diff --git a/test/expectations/Ellipsis.log b/test/snapshots/Ellipsis.log similarity index 50% rename from test/expectations/Ellipsis.log rename to test/snapshots/Ellipsis.log index eca3a61..4e5e2d0 100644 --- a/test/expectations/Ellipsis.log +++ b/test/snapshots/Ellipsis.log @@ -1,2 +1,2 @@ test.md:3:23:Prim.Ellipsis:In general, don't use an ellipsis. -test.md:4:22:Prim.Ellipsis:In general, don't use an ellipsis. +test.md:4:22:Prim.Ellipsis:In general, don't use an ellipsis. \ No newline at end of file diff --git a/test/expectations/EmDash.log b/test/snapshots/EmDash.log similarity index 50% rename from test/expectations/EmDash.log rename to test/snapshots/EmDash.log index bea0a5b..86f4d31 100644 --- a/test/expectations/EmDash.log +++ b/test/snapshots/EmDash.log @@ -1,2 +1,2 @@ test.md:3:16:Prim.EmDash:Add spaces around '—'. -test.md:3:45:Prim.EmDash:Add spaces around '—'. +test.md:3:45:Prim.EmDash:Add spaces around '—'. \ No newline at end of file diff --git a/test/expectations/EnDash.log b/test/snapshots/EnDash.log similarity index 66% rename from test/expectations/EnDash.log rename to test/snapshots/EnDash.log index aa3240d..f54de6b 100644 --- a/test/expectations/EnDash.log +++ b/test/snapshots/EnDash.log @@ -1,3 +1,3 @@ test.md:3:47:Prim.EnDash:Remove the spaces around '–'. test.md:4:31:Prim.EnDash:Remove the spaces around '–'. -test.md:5:42:Prim.EnDash:Remove the spaces around '–'. +test.md:5:42:Prim.EnDash:Remove the spaces around '–'. \ No newline at end of file diff --git a/test/expectations/Latin.log b/test/snapshots/Latin.log similarity index 99% rename from test/expectations/Latin.log rename to test/snapshots/Latin.log index a470b7f..94e61d6 100644 --- a/test/expectations/Latin.log +++ b/test/snapshots/Latin.log @@ -9,4 +9,4 @@ test.md:21:33:Prim.Latin:Avoid latin. Use 'that is' instead of 'ie,'. test.md:24:22:Prim.Latin:Avoid latin. Use 'against' instead of 'vs.'. test.md:27:26:Prim.Latin:Avoid latin. Use 'against' instead of 'versus'. test.md:30:33:Prim.Latin:Avoid latin. Use 'over' or 'through' instead of 'via'. -test.md:33:31:Prim.Latin:Avoid latin. Use 'namely' instead of 'viz.'. +test.md:33:31:Prim.Latin:Avoid latin. Use 'namely' instead of 'viz.'. \ No newline at end of file diff --git a/test/expectations/OptionalPlurals.log b/test/snapshots/OptionalPlurals.log similarity index 84% rename from test/expectations/OptionalPlurals.log rename to test/snapshots/OptionalPlurals.log index 02a4195..194ca3a 100644 --- a/test/expectations/OptionalPlurals.log +++ b/test/snapshots/OptionalPlurals.log @@ -1,2 +1,2 @@ test.md:3:23:Prim.OptionalPlurals:Don't use plurals in parentheses such as in 'extension(s)'. -test.md:4:5:Prim.OptionalPlurals:Don't use plurals in parentheses such as in 'checkbox(es)'. +test.md:4:5:Prim.OptionalPlurals:Don't use plurals in parentheses such as in 'checkbox(es)'. \ No newline at end of file diff --git a/test/expectations/Ordinal.log b/test/snapshots/Ordinal.log similarity index 66% rename from test/expectations/Ordinal.log rename to test/snapshots/Ordinal.log index b894205..0faefe0 100644 --- a/test/expectations/Ordinal.log +++ b/test/snapshots/Ordinal.log @@ -1,3 +1,3 @@ test.md:3:1:Prim.Ordinal:Don't add -ly to an ordinal number. test.md:3:45:Prim.Ordinal:Don't add -ly to an ordinal number. -test.md:3:84:Prim.Ordinal:Don't add -ly to an ordinal number. +test.md:3:84:Prim.Ordinal:Don't add -ly to an ordinal number. \ No newline at end of file diff --git a/test/expectations/OxfordComma.log b/test/snapshots/OxfordComma.log similarity index 86% rename from test/expectations/OxfordComma.log rename to test/snapshots/OxfordComma.log index ab71e4c..e19f302 100644 --- a/test/expectations/OxfordComma.log +++ b/test/snapshots/OxfordComma.log @@ -1,2 +1,2 @@ test.md:3:41:Prim.OxfordComma:Use the Oxford comma in 'flour, sugar, eggs and butter.'. -test.md:5:20:Prim.OxfordComma:Use the Oxford comma in 'clothes, toiletries or books?'. +test.md:5:20:Prim.OxfordComma:Use the Oxford comma in 'clothes, toiletries or books?'. \ No newline at end of file diff --git a/test/expectations/Percentages.log b/test/snapshots/Percentages.log similarity index 90% rename from test/expectations/Percentages.log rename to test/snapshots/Percentages.log index 2168458..5243d4f 100644 --- a/test/expectations/Percentages.log +++ b/test/snapshots/Percentages.log @@ -1 +1 @@ -test.md:3:28:Prim.Percentages:Use a numeral to represent a percentage. +test.md:3:28:Prim.Percentages:Use a numeral to represent a percentage. \ No newline at end of file diff --git a/test/expectations/PreferredAlternatives.log b/test/snapshots/PreferredAlternatives.log similarity index 95% rename from test/expectations/PreferredAlternatives.log rename to test/snapshots/PreferredAlternatives.log index a55f5e5..940fa59 100644 --- a/test/expectations/PreferredAlternatives.log +++ b/test/snapshots/PreferredAlternatives.log @@ -1,3 +1,3 @@ test.md:4:36:Prim.PreferredAlternatives:Prefer using 'Zero-day' over '0-day'. test.md:7:39:Prim.PreferredAlternatives:Prefer using 'Midnight' over '12 am'. -test.md:10:30:Prim.PreferredAlternatives:Prefer using 'Noon' over '12 pm'. +test.md:10:30:Prim.PreferredAlternatives:Prefer using 'Noon' over '12 pm'. \ No newline at end of file diff --git a/test/expectations/RequiredAlternatives.log b/test/snapshots/RequiredAlternatives.log similarity index 97% rename from test/expectations/RequiredAlternatives.log rename to test/snapshots/RequiredAlternatives.log index 2866a5a..fcbcecf 100644 --- a/test/expectations/RequiredAlternatives.log +++ b/test/snapshots/RequiredAlternatives.log @@ -3,4 +3,4 @@ test.md:7:27:Prim.RequiredAlternatives:Use '3D' instead of '3-D'. test.md:10:19:Prim.RequiredAlternatives:Use 'sync' instead of 'synch'. test.md:13:17:Prim.RequiredAlternatives:Use 'URL' instead of 'url'. test.md:14:5:Prim.RequiredAlternatives:Use 'URL of' instead of 'URL for'. -test.md:15:10:Prim.RequiredAlternatives:Use 'a URL' instead of 'an URL'. +test.md:15:10:Prim.RequiredAlternatives:Use 'a URL' instead of 'an URL'. \ No newline at end of file diff --git a/test/snapshots/Semicolon.log b/test/snapshots/Semicolon.log new file mode 100644 index 0000000..d50175a --- /dev/null +++ b/test/snapshots/Semicolon.log @@ -0,0 +1 @@ +test.md:3:33:Prim.Semicolon:Try to simplify this sentence. \ No newline at end of file diff --git a/test/expectations/SentenceLength.log b/test/snapshots/SentenceLength.log similarity index 86% rename from test/expectations/SentenceLength.log rename to test/snapshots/SentenceLength.log index 9161925..11ecb80 100644 --- a/test/expectations/SentenceLength.log +++ b/test/snapshots/SentenceLength.log @@ -1 +1 @@ -test.md:3:1:Prim.SentenceLength:Try to keep sentences short (< 30 words). +test.md:3:1:Prim.SentenceLength:Try to keep sentences short (< 30 words). \ No newline at end of file diff --git a/test/expectations/SimplerAlternatives.log b/test/snapshots/SimplerAlternatives.log similarity index 82% rename from test/expectations/SimplerAlternatives.log rename to test/snapshots/SimplerAlternatives.log index ef0be75..8168562 100644 --- a/test/expectations/SimplerAlternatives.log +++ b/test/snapshots/SimplerAlternatives.log @@ -1 +1 @@ -test.md:4:31:Prim.SimplerAlternatives:Use 'about' instead of 'approximately'. +test.md:4:31:Prim.SimplerAlternatives:Use 'about' instead of 'approximately'. \ No newline at end of file diff --git a/test/expectations/Space.log b/test/snapshots/Space.log similarity index 98% rename from test/expectations/Space.log rename to test/snapshots/Space.log index e04f8f3..d298b4f 100644 --- a/test/expectations/Space.log +++ b/test/snapshots/Space.log @@ -3,4 +3,4 @@ test.md:4:35:Prim.Space:'door. It' should have one space between them. test.md:5:18:Prim.Space:'melody.It' should have one space between them. test.md:6:29:Prim.Space:'ruins? They' should have one space between them. test.md:7:32:Prim.Space:', marveling' should have one space between them. -test.md:8:1:Prim.Space:'Whoa! This' should have one space between them. +test.md:8:1:Prim.Space:'Whoa! This' should have one space between them. \ No newline at end of file diff --git a/test/snapshots/WordRepitition.log b/test/snapshots/WordRepitition.log new file mode 100644 index 0000000..9bb4b17 --- /dev/null +++ b/test/snapshots/WordRepitition.log @@ -0,0 +1 @@ +test.md:3:14:Prim.WordRepitition:'zoom' is repeated. \ No newline at end of file From 9707f5e09c7a9d530ef9874a80ea868dad6b9e8f Mon Sep 17 00:00:00 2001 From: Naiyer <19614213+naiyerasif@users.noreply.github.com> Date: Sun, 24 Mar 2024 08:28:32 +0530 Subject: [PATCH 07/10] feat(rule): required alternatives - AJAX --- Prim/RequiredAlternatives.yml | 1 + test/fixtures/RequiredAlternatives/test.md | 3 +++ test/snapshots/RequiredAlternatives.log | 9 +++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Prim/RequiredAlternatives.yml b/Prim/RequiredAlternatives.yml index 1d370ae..6b6141a 100644 --- a/Prim/RequiredAlternatives.yml +++ b/Prim/RequiredAlternatives.yml @@ -7,6 +7,7 @@ action: swap: 24/7: 24x7 3\-D: 3D + Ajax: AJAX synch: sync url: URL URL for: URL of diff --git a/test/fixtures/RequiredAlternatives/test.md b/test/fixtures/RequiredAlternatives/test.md index 5ab03a6..43f063a 100644 --- a/test/fixtures/RequiredAlternatives/test.md +++ b/test/fixtures/RequiredAlternatives/test.md @@ -6,6 +6,9 @@ Our emergency hotline is staffed 24/7 for immediate assistance. The movie was stunning in 3-D. + +The web developer used Ajax to create a dynamic search feature on the website. + The team needs to synch their schedules for the upcoming meeting. diff --git a/test/snapshots/RequiredAlternatives.log b/test/snapshots/RequiredAlternatives.log index fcbcecf..3823dd3 100644 --- a/test/snapshots/RequiredAlternatives.log +++ b/test/snapshots/RequiredAlternatives.log @@ -1,6 +1,7 @@ test.md:4:34:Prim.RequiredAlternatives:Use '24x7' instead of '24/7'. test.md:7:27:Prim.RequiredAlternatives:Use '3D' instead of '3-D'. -test.md:10:19:Prim.RequiredAlternatives:Use 'sync' instead of 'synch'. -test.md:13:17:Prim.RequiredAlternatives:Use 'URL' instead of 'url'. -test.md:14:5:Prim.RequiredAlternatives:Use 'URL of' instead of 'URL for'. -test.md:15:10:Prim.RequiredAlternatives:Use 'a URL' instead of 'an URL'. \ No newline at end of file +test.md:10:24:Prim.RequiredAlternatives:Use 'AJAX' instead of 'Ajax'. +test.md:13:19:Prim.RequiredAlternatives:Use 'sync' instead of 'synch'. +test.md:16:17:Prim.RequiredAlternatives:Use 'URL' instead of 'url'. +test.md:17:5:Prim.RequiredAlternatives:Use 'URL of' instead of 'URL for'. +test.md:18:10:Prim.RequiredAlternatives:Use 'a URL' instead of 'an URL'. \ No newline at end of file From 48f275a257554ffa8eb19348b89c05005ce2c06b Mon Sep 17 00:00:00 2001 From: Naiyer <19614213+naiyerasif@users.noreply.github.com> Date: Sun, 24 Mar 2024 08:44:09 +0530 Subject: [PATCH 08/10] feat(rule): required alternatives - auto-detect --- Prim/RequiredAlternatives.yml | 1 + test/fixtures/RequiredAlternatives/test.md | 3 +++ test/snapshots/RequiredAlternatives.log | 9 +++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Prim/RequiredAlternatives.yml b/Prim/RequiredAlternatives.yml index 6b6141a..dce03df 100644 --- a/Prim/RequiredAlternatives.yml +++ b/Prim/RequiredAlternatives.yml @@ -8,6 +8,7 @@ swap: 24/7: 24x7 3\-D: 3D Ajax: AJAX + autodetect: auto-detect synch: sync url: URL URL for: URL of diff --git a/test/fixtures/RequiredAlternatives/test.md b/test/fixtures/RequiredAlternatives/test.md index 43f063a..f6f6e10 100644 --- a/test/fixtures/RequiredAlternatives/test.md +++ b/test/fixtures/RequiredAlternatives/test.md @@ -9,6 +9,9 @@ The movie was stunning in 3-D. The web developer used Ajax to create a dynamic search feature on the website. + +The camera's autodetect recognizes faces and adjusts focus accordingly. + The team needs to synch their schedules for the upcoming meeting. diff --git a/test/snapshots/RequiredAlternatives.log b/test/snapshots/RequiredAlternatives.log index 3823dd3..8973c10 100644 --- a/test/snapshots/RequiredAlternatives.log +++ b/test/snapshots/RequiredAlternatives.log @@ -1,7 +1,8 @@ test.md:4:34:Prim.RequiredAlternatives:Use '24x7' instead of '24/7'. test.md:7:27:Prim.RequiredAlternatives:Use '3D' instead of '3-D'. test.md:10:24:Prim.RequiredAlternatives:Use 'AJAX' instead of 'Ajax'. -test.md:13:19:Prim.RequiredAlternatives:Use 'sync' instead of 'synch'. -test.md:16:17:Prim.RequiredAlternatives:Use 'URL' instead of 'url'. -test.md:17:5:Prim.RequiredAlternatives:Use 'URL of' instead of 'URL for'. -test.md:18:10:Prim.RequiredAlternatives:Use 'a URL' instead of 'an URL'. \ No newline at end of file +test.md:13:14:Prim.RequiredAlternatives:Use 'auto-detect' instead of 'autodetect'. +test.md:16:19:Prim.RequiredAlternatives:Use 'sync' instead of 'synch'. +test.md:19:17:Prim.RequiredAlternatives:Use 'URL' instead of 'url'. +test.md:20:5:Prim.RequiredAlternatives:Use 'URL of' instead of 'URL for'. +test.md:21:10:Prim.RequiredAlternatives:Use 'a URL' instead of 'an URL'. \ No newline at end of file From 64b2554ae7144a2d2fb0eb2b9826699b8b502bb7 Mon Sep 17 00:00:00 2001 From: Naiyer <19614213+naiyerasif@users.noreply.github.com> Date: Sun, 24 Mar 2024 08:49:00 +0530 Subject: [PATCH 09/10] feat(rule): ignorecase for ambiguity rules --- Prim/Ambiguity.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Prim/Ambiguity.yml b/Prim/Ambiguity.yml index cda3581..d74dc4b 100644 --- a/Prim/Ambiguity.yml +++ b/Prim/Ambiguity.yml @@ -1,6 +1,6 @@ extends: existence message: "Avoid ambiguity. Don't use '%s'." level: error -# ignorecase: true +ignorecase: true tokens: - and/or From 0556ce20d01d49a594ac4abeec72e5b9cdd5131a Mon Sep 17 00:00:00 2001 From: Naiyer <19614213+naiyerasif@users.noreply.github.com> Date: Sun, 24 Mar 2024 08:54:26 +0530 Subject: [PATCH 10/10] feat(rule): preferred alternatives - open-source --- Prim/PreferredAlternatives.yml | 1 + test/fixtures/PreferredAlternatives/test.md | 3 +++ test/snapshots/PreferredAlternatives.log | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Prim/PreferredAlternatives.yml b/Prim/PreferredAlternatives.yml index 2139f8b..d8dcfbd 100644 --- a/Prim/PreferredAlternatives.yml +++ b/Prim/PreferredAlternatives.yml @@ -8,3 +8,4 @@ swap: 0-day: zero-day 12 am: midnight 12 pm: noon + open-source: open source diff --git a/test/fixtures/PreferredAlternatives/test.md b/test/fixtures/PreferredAlternatives/test.md index 8c1a78d..f81d0f3 100644 --- a/test/fixtures/PreferredAlternatives/test.md +++ b/test/fixtures/PreferredAlternatives/test.md @@ -8,3 +8,6 @@ Our online support is available until 12 am. Please submit your report by 12 pm tomorrow. + + +I contributed a new feature to an open-source project. diff --git a/test/snapshots/PreferredAlternatives.log b/test/snapshots/PreferredAlternatives.log index 940fa59..297d767 100644 --- a/test/snapshots/PreferredAlternatives.log +++ b/test/snapshots/PreferredAlternatives.log @@ -1,3 +1,4 @@ test.md:4:36:Prim.PreferredAlternatives:Prefer using 'Zero-day' over '0-day'. test.md:7:39:Prim.PreferredAlternatives:Prefer using 'Midnight' over '12 am'. -test.md:10:30:Prim.PreferredAlternatives:Prefer using 'Noon' over '12 pm'. \ No newline at end of file +test.md:10:30:Prim.PreferredAlternatives:Prefer using 'Noon' over '12 pm'. +test.md:13:35:Prim.PreferredAlternatives:Prefer using 'open source' over 'open-source'. \ No newline at end of file