Skip to content

Commit bd56fc7

Browse files
committed
feat(rule): add abbreviation rules
1 parent 1739883 commit bd56fc7

File tree

5 files changed

+102
-1
lines changed

5 files changed

+102
-1
lines changed

Prim/Abbreviations.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
extends: conditional
2+
message: "Spell out '%s', if it's unfamiliar to the audience."
3+
level: suggestion
4+
ignorecase: false
5+
first: '\b(?=\w{3,})(?=(?:\w*[A-Z]){2,})[A-Za-z]+\b(?!\s*\((?:[A-Z][a-z]+\s+)+\))'
6+
second: '(?:\b[A-Z][a-z]+\s+)+\(([A-Za-z]{3,})\)'
7+
exceptions:
8+
- API
9+
- AWS
10+
- BIOS
11+
- CAPTCHA
12+
- CLI
13+
- CSS
14+
- CSV
15+
- DEBUG
16+
- DELETE
17+
- ERROR
18+
- FAQ
19+
- GET
20+
- GIF
21+
- INFO
22+
- HEAD
23+
- HTML
24+
- IDE
25+
- JAR
26+
- JDBC
27+
- JDK
28+
- JPA
29+
- JPEG
30+
- JSON
31+
- JVM
32+
- LaTeX
33+
- MIT
34+
- OEM
35+
- OSS
36+
- PATCH
37+
- PIN
38+
- PNG
39+
- POST
40+
- PUT
41+
- ReCAPTCHA
42+
- REST
43+
- RSS
44+
- SQL
45+
- SVG
46+
- TODO
47+
- TRACE
48+
- USB
49+
- UTF
50+
- WARN
51+
- WebP
52+
- WiFi
53+
- XML
54+
- YAML
55+
- YML
56+
- ZIP

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "prim",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"description": "A Vale-compatible prose style for non-native English speaker",
55
"type": "module",
66
"author": "Naiyer Asif (https://naiyerasif.com)",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
StylesPath = ../../../
2+
3+
MinAlertLevel = suggestion
4+
5+
[*.md]
6+
Prim.Abbreviations = YES
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Abbreviation Periods
2+
3+
<!-- ❌ trigger on abbreviations without full forms -->
4+
Our email service supports PGP.
5+
VoIP is widely used in corporate environments.
6+
Let's standardize this DoD.
7+
8+
<!-- ✅ ignore abbreviations followed by full forms -->
9+
International Space Station (ISS) is a marvel of engineering.
10+
International Organization for Standardization (ISO) develops and publishes international standards.
11+
12+
<!-- ✅ ignore two letter abbreviations -->
13+
Europe is trying to move away from US tech.
14+
Reboot your PC to install upgrades.
15+
16+
<!-- ✅ ignore exceptions -->
17+
CAPTCHA is becoming annoying.
18+
Just use HTML and CSS.
19+
Do you use JPA to connect to database or just JDBC to work with SQL?
20+
Should the endpoint return a JSON or XML response?
21+
This equation can be written in LaTeX.
22+
They have put a ReCAPTCHA on login.
23+
What's your WiFi password?
24+
You should expose this service as a REST API.
25+
You can use a JPEG, PNG or SVG, although you should be using WebP.
26+
Your IDE can generate the JAR file using the installed JDK.
27+
Here are some FAQ about JVM.
28+
Use verbs like GET, POST, PATCH, PUT, DELETE or HEAD instead of always returning an OK with custom message.
29+
Add a TODO comment to implement an RSS feed later.
30+
For complete address, please provide a ZIP or PIN code.
31+
AWS CLI can be used to upload the GIF.
32+
Either of the aliases, YAML or YML, is fine.
33+
The log level can be set to TRACE, DEBUG, INFO, WARN or ERROR.
34+
The OEM needs an OSS license, such as MIT.
35+
Encode the CSV with UTF for maximum compatibility.
36+
Unplug the USB drive to avoid rebooting into the BIOS.

test/snapshots/Abbreviations.log

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
test.md:4:28:Prim.Abbreviations:Spell out 'PGP', if it's unfamiliar to the audience.
2+
test.md:5:1:Prim.Abbreviations:Spell out 'VoIP', if it's unfamiliar to the audience.
3+
test.md:6:24:Prim.Abbreviations:Spell out 'DoD', if it's unfamiliar to the audience.

0 commit comments

Comments
 (0)