Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.0.6 #5

Merged
merged 6 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Prim/Ampersand.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends: existence
message: "Use 'and' as a separator instead of '&'."
level: warning
nonword: true
tokens:
- '\b\w+\s&\s\w+\b'
185 changes: 185 additions & 0 deletions Prim/PassiveVoice.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
extends: existence
message: "'%s' looks like passive voice."
level: suggestion
ignorecase: true
raw:
- \b(am|are|were|being|is|been|was|be)\b\s*
tokens:
- '[\w]+ed'
- arisen
- awoken
- beaten
- become
- been
- begun
- bent
- beset
- bet
- bid
- bidden
- bitten
- bled
- blown
- born
- borne
- bought
- bound
- bred
- broadcast
- broken
- brought
- built
- burnt
- burst
- cast
- caught
- chosen
- clung
- come
- cost
- crept
- cut
- dealt
- done
- dove
- drawn
- dreamed
- dreamt
- driven
- drunk
- dug
- eaten
- fallen
- felt
- fit
- fled
- flown
- flung
- forbidden
- foregone
- forgiven
- forgotten
- forsaken
- fought
- found
- frozen
- given
- gone
- gotten
- ground
- grown
- heard
- held
- hidden
- hit
- hung
- hurt
- kept
- knelt
- knit
- known
- laid
- lain
- leapt
- learnt
- left
- lent
- let
- lit
- lost
- made
- meant
- met
- misspelt
- mistaken
- mown
- overcome
- overdone
- overseen
- overtaken
- overthrown
- paid
- proven
- put
- quit
- read
- rid
- ridden
- risen
- run
- rung
- said
- sat
- sawn
- seen
- sent
- set
- sewn
- shaken
- shaven
- shod
- shone
- shorn
- shot
- shown
- shrunk
- shrunken
- shut
- slain
- slept
- slid
- slit
- slung
- smelt
- smitten
- sold
- sought
- sown
- spent
- spilt
- spit
- split
- spoken
- spread
- sprung
- spun
- stolen
- stood
- stridden
- striven
- struck
- strung
- stuck
- stung
- stunk
- sung
- sunk
- swept
- swollen
- sworn
- swum
- swung
- taken
- taught
- thought
- thrown
- thrust
- told
- torn
- trodden
- undergone
- understood
- undertaken
- upheld
- upset
- wept
- withdrawn
- withheld
- withstood
- woken
- won
- worn
- wound
- woven
- written
- wrung
3 changes: 3 additions & 0 deletions Prim/RequiredAlternatives.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ swap:
hard copy: hardcopy
hardcoded: hard-coded
HTTPs: HTTPS
in depth: in-depth
on demand: on-demand
(?:file ?path|path ?name)s?: path|paths
(?:scroll bar|scroll-bar)s?: scrollbar|scrollbars
synch: sync
Expand All @@ -26,3 +28,4 @@ swap:
URL for: URL of
an URL: a URL
usecases?: use case|use cases
(?:WiFi|wifi): Wi-Fi
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prim",
"version": "0.0.5",
"version": "0.0.6",
"description": "A Vale-compatible prose style for non-native English speaker",
"scripts": {
"snapshot:update": "vitest rules --update",
Expand Down
6 changes: 6 additions & 0 deletions test/fixtures/Ampersand/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
StylesPath = ../../../

MinAlertLevel = suggestion

[*.md]
Prim.Ampersand = YES
3 changes: 3 additions & 0 deletions test/fixtures/Ampersand/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ampersand

He labored for the diploma day & night.
6 changes: 6 additions & 0 deletions test/fixtures/PassiveVoice/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
StylesPath = ../../../

MinAlertLevel = suggestion

[*.md]
Prim.PassiveVoice = YES
7 changes: 7 additions & 0 deletions test/fixtures/PassiveVoice/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Passive Voice

Great expectations were formed of him.
The house was filled with laughter.
He was struck by her beauty.
The streets were paved with gold.
The cake was left on the table.
10 changes: 10 additions & 0 deletions test/fixtures/RequiredAlternatives/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ The menu was hardcoded and could not be customized.
<!-- HTTPs -->
Always use HTTPs for secure online transactions.

<!-- in depth -->
The article provided an in depth analysis of the housing crash.

<!-- on demand -->
I prefer watching movies on demand.

<!-- path -->
Check the file path to locate the document.
Copy and paste the full path names to navigate to the desired folder.
Expand All @@ -66,3 +72,7 @@ Hover on an URL to preview the page.
<!-- usecase -->
Can you provide a specific usecase where this technology would be beneficial?
We analyzed the usecases to identify potential improvements.

<!-- wifi -->
The cafe offers free wifi for customers.
I can't finish my work without WiFi.
1 change: 1 addition & 0 deletions test/snapshots/Ampersand.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test.md:3:28:Prim.Ampersand:Use 'and' as a separator instead of '&'.
5 changes: 5 additions & 0 deletions test/snapshots/PassiveVoice.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test.md:3:20:Prim.PassiveVoice:'were formed' looks like passive voice.
test.md:4:11:Prim.PassiveVoice:'was filled' looks like passive voice.
test.md:5:4:Prim.PassiveVoice:'was struck' looks like passive voice.
test.md:6:13:Prim.PassiveVoice:'were paved' looks like passive voice.
test.md:7:10:Prim.PassiveVoice:'was left' looks like passive voice.
28 changes: 16 additions & 12 deletions test/snapshots/RequiredAlternatives.log
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@ test.md:35:34:Prim.RequiredAlternatives:Use 'dual-boot' instead of 'dual boot'.
test.md:38:18:Prim.RequiredAlternatives:Use 'hardcopy' instead of 'hard copy'.
test.md:41:14:Prim.RequiredAlternatives:Use 'hard-coded' instead of 'hardcoded'.
test.md:44:12:Prim.RequiredAlternatives:Use 'HTTPS' instead of 'HTTPs'.
test.md:47:11:Prim.RequiredAlternatives:Use 'path' or 'paths' instead of 'file path'.
test.md:48:25:Prim.RequiredAlternatives:Use 'path' or 'paths' instead of 'path names'.
test.md:51:9:Prim.RequiredAlternatives:Use 'scrollbar' or 'scrollbars' instead of 'scroll bar'.
test.md:52:24:Prim.RequiredAlternatives:Use 'scrollbar' or 'scrollbars' instead of 'scroll-bars'.
test.md:55:19:Prim.RequiredAlternatives:Use 'sync' instead of 'synch'.
test.md:58:5:Prim.RequiredAlternatives:Use 'test case' or 'test cases' instead of 'testcase'.
test.md:59:76:Prim.RequiredAlternatives:Use 'test case' or 'test cases' instead of 'testcases'.
test.md:62:17:Prim.RequiredAlternatives:Use 'URL' instead of 'url'.
test.md:63:5:Prim.RequiredAlternatives:Use 'URL of' instead of 'URL for'.
test.md:64:10:Prim.RequiredAlternatives:Use 'a URL' instead of 'an URL'.
test.md:67:28:Prim.RequiredAlternatives:Use 'use case' or 'use cases' instead of 'usecase'.
test.md:68:17:Prim.RequiredAlternatives:Use 'use case' or 'use cases' instead of 'usecases'.
test.md:47:25:Prim.RequiredAlternatives:Use 'in-depth' instead of 'in depth'.
test.md:50:26:Prim.RequiredAlternatives:Use 'on-demand' instead of 'on demand'.
test.md:53:11:Prim.RequiredAlternatives:Use 'path' or 'paths' instead of 'file path'.
test.md:54:25:Prim.RequiredAlternatives:Use 'path' or 'paths' instead of 'path names'.
test.md:57:9:Prim.RequiredAlternatives:Use 'scrollbar' or 'scrollbars' instead of 'scroll bar'.
test.md:58:24:Prim.RequiredAlternatives:Use 'scrollbar' or 'scrollbars' instead of 'scroll-bars'.
test.md:61:19:Prim.RequiredAlternatives:Use 'sync' instead of 'synch'.
test.md:64:5:Prim.RequiredAlternatives:Use 'test case' or 'test cases' instead of 'testcase'.
test.md:65:76:Prim.RequiredAlternatives:Use 'test case' or 'test cases' instead of 'testcases'.
test.md:68:17:Prim.RequiredAlternatives:Use 'URL' instead of 'url'.
test.md:69:5:Prim.RequiredAlternatives:Use 'URL of' instead of 'URL for'.
test.md:70:10:Prim.RequiredAlternatives:Use 'a URL' instead of 'an URL'.
test.md:73:28:Prim.RequiredAlternatives:Use 'use case' or 'use cases' instead of 'usecase'.
test.md:74:17:Prim.RequiredAlternatives:Use 'use case' or 'use cases' instead of 'usecases'.
test.md:77:22:Prim.RequiredAlternatives:Use 'Wi-Fi' instead of 'wifi'.
test.md:78:32:Prim.RequiredAlternatives:Use 'Wi-Fi' instead of 'WiFi'.
Loading