Skip to content

Commit ee101d4

Browse files
committed
feat: add vale configuration and Espressif-devportal style
1 parent 4d9e612 commit ee101d4

File tree

10 files changed

+548
-0
lines changed

10 files changed

+548
-0
lines changed

.vale.ini

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
###################
2+
### Vale Config ###
3+
###################
4+
5+
# This is a Vale linter configuration file.
6+
# - Repo: esp-vale-config (Default config)
7+
# - Version: v0-1-1
8+
# It lists all necessary parameters to configure Vale for your project.
9+
# For official documentation on all config settings, see
10+
# https://vale.sh/docs/topics/config
11+
12+
13+
##############
14+
### Global ###
15+
##############
16+
17+
# This section lists core settings applying to Vale itself.
18+
19+
20+
# Specify path to external resources (e.g., styles and vocab files).
21+
# The path value may be absolute or relative to this configuration file.
22+
StylesPath = .vale/styles
23+
24+
25+
# Specify the minimum alert severity that Vale will report.
26+
MinAlertLevel = suggestion # "suggestion", "warning", or "error"
27+
28+
29+
# Specify vocabulary for special treatment.
30+
# Create a folder in <StylesPath>/Vocab/<name>/and add its name here
31+
# The folder should contain two files:
32+
# - accept.txt -- lists words with accepted case-sensitive spelling
33+
# - reject.txt -- lists words whose occurrences throw an error
34+
# Vocab = Espressif
35+
36+
37+
# Specify the packages to import into your project.
38+
# A package is a zip file containing a number of rules (style) written in YAML.
39+
# For a list of official packages, see Package Hub at https://vale.sh/hub/
40+
# For official documentation on packages, see
41+
# https://vale.sh/docs/topics/packages/
42+
# Before linting, navigate to your project and run `vale sync` to download
43+
# the official packages specified below.
44+
# Packages = Package1, Package2, \
45+
# https://example.com/path/to/package/Package.zip
46+
Packages = Google, Microsoft, RedHat, \
47+
https://dl.espressif.com/dl/esp-vale-config/Espressif-latest.zip
48+
49+
50+
###############
51+
### Formats ###
52+
###############
53+
54+
# This section enables association of "unknown" formats with the ones
55+
# supported by Vale. For official documentation on supported formats, see
56+
# https://vale.sh/docs/topics/scoping/
57+
[formats]
58+
59+
# For example, treat MDX files as Markdown files.
60+
# mdx = md
61+
62+
63+
################################
64+
### Format-specific settings ###
65+
################################
66+
67+
# This section lists the settings that apply to specific file formats
68+
# based on their glob pattern.
69+
# Settings provided under a more specific glob pattern,
70+
# such as [*.{md,txt}] will override those in [*].
71+
[*.{md,rst}]
72+
73+
74+
# Enable styles to activate all rules included in them.
75+
# BasedOnStyles = Style1, Style2
76+
BasedOnStyles = Vale, Espressif-latest, Espressif-devportal
77+
78+
79+
### Deactivate individual rules ###
80+
### in enabled styles.
81+
# Style1.Rule1 = NO
82+
Vale.Repetition = NO
83+
Vale.Spelling = NO
84+
Espressif-latest.Admonitions = NO
85+
Espressif-latest.Adverbs = NO
86+
Espressif-latest.Contractions = NO
87+
Espressif-latest.HeadingBegin = NO
88+
Espressif-latest.HeadingEnd = NO
89+
Espressif-latest.Headings = NO
90+
Espressif-latest.Monospace = NO
91+
Espressif-latest.PascalCamelCase = NO
92+
Espressif-latest.TermsAcronyms = NO
93+
Espressif-latest.TermsFixedPattern = NO
94+
Espressif-latest.TermsSingleCorrectSpelling = NO
95+
96+
97+
### Change default severity level ###
98+
### of an activated rule.
99+
# Choose between "suggestion", "warning", or "error".
100+
# Style1.Rule2 = error
101+
102+
103+
### Activate individual rules ###
104+
### in non-enabled styles stored in <StylesPath>.
105+
# Style1.Rule = YES
106+
Google.Gender = YES
107+
Google.GenderBias = YES
108+
Google.Slang = YES
109+
Google.Spacing = YES
110+
Microsoft.DateNumbers = YES
111+
Microsoft.Ellipses = YES
112+
#Microsoft.FirstPerson = YES
113+
Microsoft.Hyphens = YES
114+
Microsoft.Ordinal = YES
115+
#Microsoft.OxfordComma = YES
116+
Microsoft.Percentages = YES
117+
#Microsoft.Quotes = YES
118+
Microsoft.RangeTime = YES
119+
Microsoft.Semicolon = YES
120+
#Microsoft.SentenceLength = YES
121+
Microsoft.Suspended = YES
122+
Microsoft.Units = YES
123+
Microsoft.URLFormat = YES
124+
#Microsoft.We = YES
125+
Microsoft.Wordiness = YES
126+
#RedHat.Contractions = YES
127+
RedHat.RepeatedWords = YES
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
---
2+
extends: capitalization
3+
level: suggestion
4+
link: https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/headings/
5+
match: $sentence
6+
message: "Use sentence-style capitalization. Found: '%s'. Suggested: '%s'. Ensure that proper nouns and noun phrases are capitalized correctly."
7+
scope: heading
8+
indicators:
9+
- ":"
10+
exceptions:
11+
12+
# Espressif
13+
- Espressif
14+
- Xtensa
15+
- RISC-V
16+
- Wokwi
17+
- 'Developer Portal'
18+
- DevKit
19+
- SoCs?
20+
- (?i)VSCode
21+
- (?i)FreeRTOS
22+
- eFuses?
23+
- \bESP[-A-Za-z0-9_]*\b
24+
- Rainmaker
25+
- LowCode
26+
- ZeroCode
27+
28+
# Embedded
29+
- ADC
30+
- AIoT
31+
- DAC
32+
- IoT
33+
- Matter
34+
- PHY
35+
- PSRAM
36+
- RAM
37+
- SRAM
38+
- WLED
39+
40+
# Rust
41+
- 'Rust'
42+
- 'std'
43+
- 'no_std'
44+
45+
# Measurement Units
46+
- kbps|Mbps|Gbps
47+
- KiB|MiB|GiB
48+
- kHz|MHz|GHz
49+
- dBm|dBu|dBV
50+
51+
# General
52+
- Ansible
53+
- Antora
54+
- API
55+
- AppData
56+
- AsciiDoc
57+
- Asciidoctor
58+
- AWS
59+
- Azure
60+
- BASIC
61+
- Bitbucket
62+
- BOM
63+
- Bugzilla
64+
- CDs
65+
- CentOS
66+
- Ceph
67+
- CLI
68+
- Clion
69+
- CMake
70+
- Copilot
71+
- DdoS
72+
- DevOps
73+
- DevOps
74+
- DNS
75+
- DNSSec
76+
- Docker
77+
- Dockerfiles?
78+
- Eclipse
79+
- Flatpak
80+
- Flatpak Builder
81+
- GCC
82+
- Git
83+
- GitHub
84+
- GitLab
85+
- GitOps
86+
- GraphQL
87+
- GUI
88+
- Homebrew
89+
- HTTP
90+
- HTTPS
91+
- IaaS
92+
- IBM
93+
- ID
94+
- IDEs?
95+
- IDs
96+
- IntelliJ
97+
- IPSec
98+
- JAR file
99+
- Java
100+
- JavaScript
101+
- JetBrains
102+
- Jira
103+
- JSON
104+
- Kubernetes
105+
- LibreOffice
106+
- Linux
107+
- LLVM
108+
- Lua
109+
- MAC
110+
- macOS
111+
- Makefile
112+
- Mattermost
113+
- MicroPython
114+
- Microsoft
115+
- MinGW
116+
- MongoDB
117+
- MySQL
118+
- NetworkManager
119+
- Nginx
120+
- Node.js
121+
- NuttX
122+
- NVMe
123+
- OAuth
124+
- OpenJDK
125+
- OpenOCD
126+
- OpenShift
127+
- OpenSSH
128+
- OpenSSL
129+
- OpenStack
130+
- OpenTelemetry
131+
- OpenTracing
132+
- PCIe
133+
- PHP
134+
- Podman
135+
- POSIX
136+
- PostgreSQL
137+
- PostScript
138+
- PowerShell
139+
- Prometheus
140+
- Python
141+
- Pytorch
142+
- Qt
143+
- Qute
144+
- Red Hat
145+
- Redis
146+
- RTOS
147+
- SaaS
148+
- SDK
149+
- SELinux
150+
- Studio
151+
- SVG
152+
- SysV
153+
- Traefik
154+
- TypeScript
155+
- URI
156+
- URIs?
157+
- URLs?
158+
- USB
159+
- Vale
160+
- Vmware
161+
- VS
162+
- VS Code
163+
- WebSocket
164+
- Windows
165+
- WireGuard
166+
- Wordpress
167+
- xterm
168+
- YouTube
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
extends: existence
2+
message: "Ensure consistent punctuation in lists. Some items end with punctuation while others don't."
3+
level: warning
4+
link: https://mos.espressif.com/punctuation.html#punctuation-in-lists
5+
scope: raw
6+
nonword: true
7+
tokens:
8+
# Find bulleted lists with inconsistent punctuation
9+
- '(?m)^[\-\+\*]\s.*\w(?<![.!?:;])$\n{1,2}[\-\+\*]\s.*\w[.!?:;]$'
10+
- '(?m)^[\-\+\*]\s.*\w[.!?:;]$\n{1,2}[\-\+\*]\s.*\w(?<![.!?:;])$'
11+
# Find numbered lists with inconsistent punctuation
12+
- '(?m)^\d+\.\s.*\w(?<![.!?:;])$\n{1,2}\d+\.\s.*\w[.!?:;]$'
13+
- '(?m)^\d+\.\s.*\w[.!?:;]$\n{1,2}\d+\.\s.*\w(?<![.!?:;])$'
14+
# Find bulleted sublists with inconsistent punctuation
15+
- '(?m)^[ ]{2,4}[\-\+\*]\s.*\w(?<![.!?:;])$\n{1,2}[ ]{2,4}[\-\+\*]\s.*\w[.!?:;]$'
16+
- '(?m)^[ ]{2,4}[\-\+\*]\s.*\w[.!?:;]$\n{1,2}[ ]{2,4}[\-\+\*]\s.*\w(?<![.!?:;])$'
17+
# Find numbered sublists with inconsistent punctuation
18+
- '(?m)^[ ]{2,4}\d+\.\s.*\w(?<![.!?:;])$\n{1,2}[ ]{2,4}\d+\.\s.*\w[.!?:;]$'
19+
- '(?m)^[ ]{2,4}\d+\.\s.*\w[.!?:;]$\n{1,2}[ ]{2,4}\d+\.\s.*\w(?<![.!?:;])$'
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extends: existence
2+
message: "Don't mix bulleted and numbered lists at the same level."
3+
level: error
4+
scope: raw
5+
nonword: true
6+
tokens:
7+
# Find lists with bullets and numbers at the same level
8+
- '(?m)^[\-\+\*]\s.*$\n{1,2}\d+\.\s.*$'
9+
- '(?m)^\d+\.\s.*$\n{1,2}[\-\+\*]\s.*$'
10+
# Find sublists with bullets and numbers at the same level
11+
- '(?m)^[ ]{2,4}[\-\+\*]\s.*$\n{1,2}[ ]{2,4}\d+\.\s.*$'
12+
- '(?m)^[ ]{2,4}\d+\.\s.*$\n{1,2}[ ]{2,4}[\-\+\*]\s.*$'
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
extends: substitution
2+
message: Do not use non-standard symbols. Use %s rather than %s.
3+
level: warning
4+
nonword: true
5+
scope: raw
6+
action:
7+
name: replace
8+
swap:
9+
‘|’: "'"
10+
‟|″|‶: "\""
11+
–|—: "--"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extends: existence
2+
message: "Use the Oxford comma in '%s'."
3+
link: https://mos.espressif.com/punctuation.html#intricacies-of-using-the-oxford-comma
4+
scope: text
5+
level: suggestion
6+
nonword: true
7+
tokens:
8+
- '(?:\b[\w-`]+(?: [\w-`]+)?, ){1,}[\w-`]+ (and|or) [\w-`]+\b'

0 commit comments

Comments
 (0)