Skip to content
Draft
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
14 changes: 14 additions & 0 deletions .github/workflows/pr-lint-vale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: reviewdog
on: [pull_request]

jobs:
vale:
name: runner / vale
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: errata-ai/[email protected]
with:
reporter: github-pr-check
vale_flags: "--minAlertLevel=suggestion"
fail_on_error: true
127 changes: 127 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
###################
### Vale Config ###
###################

# This is a Vale linter configuration file.
# - Repo: esp-vale-config (Default config)
# - Version: v0-1-1
# It lists all necessary parameters to configure Vale for your project.
# For official documentation on all config settings, see
# https://vale.sh/docs/topics/config


##############
### Global ###
##############

# This section lists core settings applying to Vale itself.


# Specify path to external resources (e.g., styles and vocab files).
# The path value may be absolute or relative to this configuration file.
StylesPath = .vale/styles


# Specify the minimum alert severity that Vale will report.
MinAlertLevel = suggestion # "suggestion", "warning", or "error"


# Specify vocabulary for special treatment.
# Create a folder in <StylesPath>/Vocab/<name>/and add its name here
# The folder should contain two files:
# - accept.txt -- lists words with accepted case-sensitive spelling
# - reject.txt -- lists words whose occurrences throw an error
# Vocab = Espressif


# Specify the packages to import into your project.
# A package is a zip file containing a number of rules (style) written in YAML.
# For a list of official packages, see Package Hub at https://vale.sh/hub/
# For official documentation on packages, see
# https://vale.sh/docs/topics/packages/
# Before linting, navigate to your project and run `vale sync` to download
# the official packages specified below.
# Packages = Package1, Package2, \
# https://example.com/path/to/package/Package.zip
Packages = Google, Microsoft, RedHat, \
https://dl.espressif.com/dl/esp-vale-config/Espressif-latest.zip


###############
### Formats ###
###############

# This section enables association of "unknown" formats with the ones
# supported by Vale. For official documentation on supported formats, see
# https://vale.sh/docs/topics/scoping/
[formats]

# For example, treat MDX files as Markdown files.
# mdx = md


################################
### Format-specific settings ###
################################

# This section lists the settings that apply to specific file formats
# based on their glob pattern.
# Settings provided under a more specific glob pattern,
# such as [*.{md,txt}] will override those in [*].
[*.{md,rst}]


# Enable styles to activate all rules included in them.
# BasedOnStyles = Style1, Style2
BasedOnStyles = Vale, Espressif-latest, Espressif-devportal


### Deactivate individual rules ###
### in enabled styles.
# Style1.Rule1 = NO
Vale.Repetition = NO
Vale.Spelling = NO
Espressif-latest.Admonitions = NO
Espressif-latest.Adverbs = NO
Espressif-latest.Contractions = NO
Espressif-latest.HeadingBegin = NO
Espressif-latest.HeadingEnd = NO
Espressif-latest.Headings = NO
Espressif-latest.Monospace = NO
Espressif-latest.PascalCamelCase = NO
Espressif-latest.TermsAcronyms = NO
Espressif-latest.TermsFixedPattern = NO
Espressif-latest.TermsSingleCorrectSpelling = NO


### Change default severity level ###
### of an activated rule.
# Choose between "suggestion", "warning", or "error".
# Style1.Rule2 = error


### Activate individual rules ###
### in non-enabled styles stored in <StylesPath>.
# Style1.Rule = YES
Google.Gender = YES
Google.GenderBias = YES
Google.Slang = YES
Google.Spacing = YES
Microsoft.DateNumbers = YES
Microsoft.Ellipses = YES
#Microsoft.FirstPerson = YES
Microsoft.Hyphens = YES
Microsoft.Ordinal = YES
#Microsoft.OxfordComma = YES
Microsoft.Percentages = YES
#Microsoft.Quotes = YES
Microsoft.RangeTime = YES
Microsoft.Semicolon = YES
#Microsoft.SentenceLength = YES
Microsoft.Suspended = YES
Microsoft.Units = YES
Microsoft.URLFormat = YES
#Microsoft.We = YES
Microsoft.Wordiness = YES
#RedHat.Contractions = YES
RedHat.RepeatedWords = YES
168 changes: 168 additions & 0 deletions .vale/styles/Espressif-devportal/HeadingSentenceCase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
---
extends: capitalization
level: suggestion
link: https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/headings/
match: $sentence
message: "Use sentence-style capitalization. Found: '%s'. Suggested: '%s'. Ensure that proper nouns and noun phrases are capitalized correctly."
scope: heading
indicators:
- ":"
exceptions:

# Espressif
- Espressif
- Xtensa
- RISC-V
- Wokwi
- 'Developer Portal'
- DevKit
- SoCs?
- (?i)VSCode
- (?i)FreeRTOS
- eFuses?
- \bESP[-A-Za-z0-9_]*\b
- Rainmaker
- LowCode
- ZeroCode

# Embedded
- ADC
- AIoT
- DAC
- IoT
- Matter
- PHY
- PSRAM
- RAM
- SRAM
- WLED

# Rust
- 'Rust'
- 'std'
- 'no_std'

# Measurement Units
- kbps|Mbps|Gbps
- KiB|MiB|GiB
- kHz|MHz|GHz
- dBm|dBu|dBV

# General
- Ansible
- Antora
- API
- AppData
- AsciiDoc
- Asciidoctor
- AWS
- Azure
- BASIC
- Bitbucket
- BOM
- Bugzilla
- CDs
- CentOS
- Ceph
- CLI
- Clion
- CMake
- Copilot
- DdoS
- DevOps
- DevOps
- DNS
- DNSSec
- Docker
- Dockerfiles?
- Eclipse
- Flatpak
- Flatpak Builder
- GCC
- Git
- GitHub
- GitLab
- GitOps
- GraphQL
- GUI
- Homebrew
- HTTP
- HTTPS
- IaaS
- IBM
- ID
- IDEs?
- IDs
- IntelliJ
- IPSec
- JAR file
- Java
- JavaScript
- JetBrains
- Jira
- JSON
- Kubernetes
- LibreOffice
- Linux
- LLVM
- Lua
- MAC
- macOS
- Makefile
- Mattermost
- MicroPython
- Microsoft
- MinGW
- MongoDB
- MySQL
- NetworkManager
- Nginx
- Node.js
- NuttX
- NVMe
- OAuth
- OpenJDK
- OpenOCD
- OpenShift
- OpenSSH
- OpenSSL
- OpenStack
- OpenTelemetry
- OpenTracing
- PCIe
- PHP
- Podman
- POSIX
- PostgreSQL
- PostScript
- PowerShell
- Prometheus
- Python
- Pytorch
- Qt
- Qute
- Red Hat
- Redis
- RTOS
- SaaS
- SDK
- SELinux
- Studio
- SVG
- SysV
- Traefik
- TypeScript
- URI
- URIs?
- URLs?
- USB
- Vale
- Vmware
- VS
- VS Code
- WebSocket
- Windows
- WireGuard
- Wordpress
- xterm
- YouTube
19 changes: 19 additions & 0 deletions .vale/styles/Espressif-devportal/ListEndPunctuation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
extends: existence
message: "Ensure consistent punctuation in lists. Some items end with punctuation while others don't."
level: warning
link: https://mos.espressif.com/punctuation.html#punctuation-in-lists
scope: raw
nonword: true
tokens:
# Find bulleted lists with inconsistent punctuation
- '(?m)^[\-\+\*]\s.*\w(?<![.!?:;])$\n{1,2}[\-\+\*]\s.*\w[.!?:;]$'
- '(?m)^[\-\+\*]\s.*\w[.!?:;]$\n{1,2}[\-\+\*]\s.*\w(?<![.!?:;])$'
# Find numbered lists with inconsistent punctuation
- '(?m)^\d+\.\s.*\w(?<![.!?:;])$\n{1,2}\d+\.\s.*\w[.!?:;]$'
- '(?m)^\d+\.\s.*\w[.!?:;]$\n{1,2}\d+\.\s.*\w(?<![.!?:;])$'
# Find bulleted sublists with inconsistent punctuation
- '(?m)^[ ]{2,4}[\-\+\*]\s.*\w(?<![.!?:;])$\n{1,2}[ ]{2,4}[\-\+\*]\s.*\w[.!?:;]$'
- '(?m)^[ ]{2,4}[\-\+\*]\s.*\w[.!?:;]$\n{1,2}[ ]{2,4}[\-\+\*]\s.*\w(?<![.!?:;])$'
# Find numbered sublists with inconsistent punctuation
- '(?m)^[ ]{2,4}\d+\.\s.*\w(?<![.!?:;])$\n{1,2}[ ]{2,4}\d+\.\s.*\w[.!?:;]$'
- '(?m)^[ ]{2,4}\d+\.\s.*\w[.!?:;]$\n{1,2}[ ]{2,4}\d+\.\s.*\w(?<![.!?:;])$'
12 changes: 12 additions & 0 deletions .vale/styles/Espressif-devportal/ListMixedType.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extends: existence
message: "Don't mix bulleted and numbered lists at the same level."
level: warning
scope: raw
nonword: true
tokens:
# Find lists with bullets and numbers at the same level
- '(?m)^[\-\+\*]\s.*$\n{1,2}\d+\.\s.*$'
- '(?m)^\d+\.\s.*$\n{1,2}[\-\+\*]\s.*$'
# Find sublists with bullets and numbers at the same level
- '(?m)^[ ]{2,4}[\-\+\*]\s.*$\n{1,2}[ ]{2,4}\d+\.\s.*$'
- '(?m)^[ ]{2,4}\d+\.\s.*$\n{1,2}[ ]{2,4}[\-\+\*]\s.*$'
11 changes: 11 additions & 0 deletions .vale/styles/Espressif-devportal/NonStandardChars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extends: substitution
message: Do not use non-standard symbols. Use %s rather than %s.
level: warning
nonword: true
scope: raw
action:
name: replace
swap:
‘|’: "'"
‟|″|‶: "\""
–|—: "--"
8 changes: 8 additions & 0 deletions .vale/styles/Espressif-devportal/OfxordComma.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: existence
message: "Use the Oxford comma in '%s'."
link: https://mos.espressif.com/punctuation.html#intricacies-of-using-the-oxford-comma
scope: text
level: suggestion
nonword: true
tokens:
- '(?:\b[\w-`]+(?: [\w-`]+)?, ){1,}[\w-`]+ (and|or) [\w-`]+\b'
Loading
Loading