Skip to content

Commit f14dfcb

Browse files
committed
doc: Added Vale linter and NordicVale styles
Added Vale doc linter and NordicVale styles Signed-off-by: Francesco Domenico Servidio <[email protected]>
1 parent b6675b0 commit f14dfcb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1653
-0
lines changed

.github/vale/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Vale Documentation Linting
2+
3+
This directory contains configuration files for [Vale](https://vale.sh/docs), an open-source documentation linting tool.
4+
5+
## Setup
6+
7+
1. [Install Vale](https://vale.sh/docs/install):
8+
- **Windows**: `choco install vale`
9+
- **macOS**: `brew install vale`
10+
- **Linux**: `snap install vale`
11+
12+
2. Run the linting:
13+
- **Windows**: `.\scripts\check-docs.ps1`
14+
- **Linux/macOS**: `./scripts/check-docs.sh`
15+
16+
## Configuration
17+
18+
- `.vale.ini`: Main configuration file (located in the repository root)
19+
- `.github/vale/styles/`: Contains custom style rules
20+
- `.github/vale/vocab/`: Contains project-specific vocabulary
21+
22+
## CI Integration
23+
24+
Vale automatically runs on pull requests that modify documentation files via the GitHub Actions workflow defined in `.github/workflows/vale-lint.yml`.
25+
26+
## Adding New Rules
27+
28+
To add new style rules:
29+
30+
1. Create a new YAML file in `.github/vale/styles/Vale/`.
31+
2. Define the rule using Vale's [style syntax](https://vale.sh/docs/styles).
32+
3. Test the rule locally.
33+
34+
## Project-Specific Vocabulary
35+
36+
Add project-specific terms to:
37+
- `.github/vale/vocab/Base/accept.txt` for words that should be accepted
38+
- `.github/vale/vocab/Base/reject.txt` for words that should be flagged
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: existence
2+
message: Use 'AM' or 'PM' (preceded by a space).
3+
link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/date-time-terms
4+
level: error
5+
nonword: true
6+
tokens:
7+
- '\d{1,2}[AP]M'
8+
- '\d{1,2} ?[ap]m'
9+
- '\d{1,2} ?[aApP]\.[mM]\.'
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
extends: existence
2+
message: "Don't use language (such as '%s') that defines people by their disability."
3+
link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/accessibility-terms
4+
level: suggestion
5+
ignorecase: true
6+
tokens:
7+
- a victim of
8+
- able-bodied
9+
- an epileptic
10+
- birth defect
11+
- crippled
12+
- differently abled
13+
- disabled
14+
- dumb
15+
- handicapped
16+
- handicaps
17+
- healthy person
18+
- hearing-impaired
19+
- lame
20+
- maimed
21+
- mentally handicapped
22+
- missing a limb
23+
- mute
24+
- non-verbal
25+
- normal person
26+
- sight-impaired
27+
- slow learner
28+
- stricken with
29+
- suffers from
30+
- vision-impaired
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
extends: conditional
2+
message: "'%s' has no definition."
3+
link: https://docs.microsoft.com/en-us/style-guide/acronyms
4+
level: suggestion
5+
ignorecase: false
6+
# Ensures that the existence of 'first' implies the existence of 'second'.
7+
first: '\b([A-Z]{3,5})\b'
8+
second: '(?:\b[A-Z][a-z]+ )+\(([A-Z]{3,5})\)'
9+
# ... with the exception of these:
10+
exceptions:
11+
- ACME
12+
- ADAC
13+
- AES
14+
- AMP
15+
- API
16+
- APIs
17+
- APB
18+
- ARM
19+
- ASP
20+
- BICR
21+
- CBOR
22+
- CCM
23+
- CDDL
24+
- CLI
25+
- CLK
26+
- COEX
27+
- COM
28+
- CPU
29+
- CPUs
30+
- CSN
31+
- CSS
32+
- CTRL
33+
- CSV
34+
- DEBUG
35+
- DFU
36+
- DK
37+
- DMA
38+
- DOM
39+
- DPI
40+
- DTS
41+
- DVFS
42+
- ESB
43+
- EXMIF
44+
- FAQ
45+
- FLPR
46+
- GCC
47+
- GDB
48+
- GET
49+
- GND
50+
- GPIO
51+
- GPU
52+
- GRTC
53+
- GTK
54+
- GUI
55+
- HCI
56+
- HEX
57+
- HFXO
58+
- HOST
59+
- HTML
60+
- HSFLL
61+
- HSFLLs
62+
- HTTP
63+
- HTTPS
64+
- ICMsg
65+
- ICBMsg
66+
- ID
67+
- IDE
68+
- IEEE
69+
- IETF
70+
- IPC
71+
- IRQ
72+
- ISR
73+
- JAR
74+
- JSON
75+
- JSX
76+
- LCS
77+
- LESS
78+
- LFCLK
79+
- LFXO
80+
- LLDB
81+
- MAC
82+
- MCU
83+
- MIPI
84+
- MPC
85+
- MPI
86+
- MRAM
87+
- NCS
88+
- NET
89+
- NFC
90+
- NOTE
91+
- NSC
92+
- NVDA
93+
- NVM
94+
- OEM
95+
- OSS
96+
- PATH
97+
- PCA
98+
- PCB
99+
- PDF
100+
- PHP
101+
- POST
102+
- PPR
103+
- PRO
104+
- PSA
105+
- PUF
106+
- RAM
107+
- RAW
108+
- REPL
109+
- RESET
110+
- RFC
111+
- RISC
112+
- RMA
113+
- RoT
114+
- ROM
115+
- RSA
116+
- RTOS
117+
- SAADC
118+
- SCFW
119+
- SCM
120+
- SCSS
121+
- SDFW
122+
- SDK
123+
- SDRFW
124+
- SDROM
125+
- SMP
126+
- SoC
127+
- SPI
128+
- SPIS
129+
- SPU
130+
- SQL
131+
- SSF
132+
- SSH
133+
- SSL
134+
- SUIT
135+
- SVG
136+
- SVD
137+
- SWD
138+
- SWJ
139+
- SYSCTRL
140+
- TCP
141+
- TTP
142+
- UART
143+
- UARTE
144+
- UARTE120
145+
- UICR
146+
- URI
147+
- URIs
148+
- URL
149+
- USB
150+
- USBHS
151+
- UTF
152+
- UUID
153+
- VBUS
154+
- VCOM
155+
- VDD
156+
- VDDH
157+
- VEVIF
158+
- VID
159+
- VPR
160+
- VPRs
161+
- VSC
162+
- XML
163+
- XSS
164+
- YAML
165+
- ZIP

0 commit comments

Comments
 (0)