Skip to content

Validation Rules updates #1911

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

Merged
merged 2 commits into from
May 6, 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
106 changes: 53 additions & 53 deletions scripts/validation/rules/rules-trademarks.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
# Bluetooth® rule
- regex: "((?<![a-zA-Z]|[0-9])(?<=\\s)([bB]lueto{2}th)(?!®|[a-zA-Z]))|((?<![a-zA-Z]|[0-9])(?<=\\s)(blueto{2}th)(?=®))"
regexModifiers: "gi"
shouldMatch: false
includeCodeBlocks: false
format: markdown
type: warning
errorMessage: The Bluetooth® trademark is not used correctly.

# LoRa® / LoRaWAN® rule
# Avoids false positives by excluding the word in conjunction with a dash (e.g. URLs) and as part of code)
- regex: "((?<![a-zA-Z]|[0-9])(?<=\\s)((lora(?:WAN|\\sAlliance)?))(?!®|[a-zA-Z]))|((?<![a-zA-Z]|[0-9])(?<=\\s)((((?<=(Lora\\s|loRa\\s|lora\\s))Alliance)|(?<=(Lora|loRa|lora)[wW][aA][nN])))(?=®))"
shouldMatch: false
includeCodeBlocks: false
format: markdown
type: warning
errorMessage: The LoRa® / LoRaWAN® trademark is not used correctly.

# USB-C® / USB Type-C® / USB4® rule
- regex: "((?<![a-zA-Z]|[0-9])(?<=\\s)(?:USB-C|USB\\sType[-]C|USB4)(?!®|[a-zA-Z]))"
regexModifiers: "gi"
shouldMatch: false
includeCodeBlocks: false
format: markdown
type: warning
errorMessage: The USB-C® / USB Type-C® / USB4® trademark is not used correctly.

# Arduino Opta® rule
- regex: "(?<!http[s]?:\\/\\/\\S*| - )(?<![a-zA-Z]|[0-9])(?<=\\s)(([oO]pta)(?!®|™|[a-zA-Z])|(((?<=[aA]rduino\\s)([oO]pta(?=™)))|((?<=[aA]rduino®\\s)([oO]pta))))"
regexModifiers: "gi"
shouldMatch: false
includeCodeBlocks: false
format: markdown
type: warning
errorMessage: The Arduino Opta® / Opta™ trademark is not used correctly.

# Edge Impulse® rule
# Skip the match if it is inside tags' lists
- regex: "(?<!http[s]?:\\/\\/\\S*| - )(?:Edge[ -]Impulse|[eE]dge[iI]mpulse)(?!®)\\b"
regexModifiers: "gi"
shouldMatch: false
includeCodeBlocks: false
format: markdown
type: warning
errorMessage: The Edge Impulse® trademark is not used correctly.

# MIPI® / A-PHY® / CSI-2® / I3C® / M-PHY® rule
- regex: "((?<![a-zA-Z]|[0-9])((mipi)|((aphy)|(a-phy))|((csi2)|(csi-2))|(i3c)|((mphy)|(m-phy)))(?!®|[a-zA-Z]))|(([mM][iI][pP][i])|(([aA][pP][hH][yY])|([aA]-[pP][hH][y]))|(([cC][sS][iI]2)|([cC][sS][i]-2))|([iI]3[c])|(([mM][pP][hH][yY])|([mM]-[pP][hH][y])))(?=®)"
regexModifiers: "gi"
shouldMatch: false
includeCodeBlocks: false
format: markdown
type: warning
# Bluetooth® rule
#- regex: "((?<![a-zA-Z]|[0-9])(?<=\\s)([bB]lueto{2}th)(?!®|[a-zA-Z]))|((?<![a-zA-Z]|[0-9])(?<=\\s)(blueto{2}th)(?=®))"
# regexModifiers: "gi"
# shouldMatch: false
# includeCodeBlocks: false
# format: markdown
# type: warning
# errorMessage: The Bluetooth® trademark is not used correctly.
# LoRa® / LoRaWAN® rule
# Avoids false positives by excluding the word in conjunction with a dash (e.g. URLs) and as part of code)
- regex: "((?<![a-zA-Z]|[0-9])(?<=\\s)((lora(?:WAN|\\sAlliance)?))(?!®|[a-zA-Z]))|((?<![a-zA-Z]|[0-9])(?<=\\s)((((?<=(Lora\\s|loRa\\s|lora\\s))Alliance)|(?<=(Lora|loRa|lora)[wW][aA][nN])))(?=®))"
shouldMatch: false
includeCodeBlocks: false
format: markdown
type: warning
errorMessage: The LoRa® / LoRaWAN® trademark is not used correctly.
# USB-C® / USB Type-C® / USB4® rule
- regex: "((?<![a-zA-Z]|[0-9])(?<=\\s)(?:USB-C|USB\\sType[-]C|USB4)(?!®|[a-zA-Z]))"
regexModifiers: "gi"
shouldMatch: false
includeCodeBlocks: false
format: markdown
type: warning
errorMessage: The USB-C® / USB Type-C® / USB4® trademark is not used correctly.
# Arduino Opta® rule
- regex: "(?<!http[s]?:\\/\\/\\S*| - )(?<![a-zA-Z]|[0-9])(?<=\\s)(([oO]pta)(?!®|™|[a-zA-Z])|(((?<=[aA]rduino\\s)([oO]pta(?=™)))|((?<=[aA]rduino®\\s)([oO]pta))))"
regexModifiers: "gi"
shouldMatch: false
includeCodeBlocks: false
format: markdown
type: warning
errorMessage: The Arduino Opta® / Opta™ trademark is not used correctly.
# Edge Impulse® rule
# Skip the match if it is inside tags' lists
- regex: "(?<!http[s]?:\\/\\/\\S*| - )(?:Edge[ -]Impulse|[eE]dge[iI]mpulse)(?!®)\\b"
regexModifiers: "gi"
shouldMatch: false
includeCodeBlocks: false
format: markdown
type: warning
errorMessage: The Edge Impulse® trademark is not used correctly.
# MIPI® / A-PHY® / CSI-2® / I3C® / M-PHY® rule
- regex: "((?<![a-zA-Z]|[0-9])((mipi)|((aphy)|(a-phy))|((csi2)|(csi-2))|(i3c)|((mphy)|(m-phy)))(?!®|[a-zA-Z]))|(([mM][iI][pP][i])|(([aA][pP][hH][yY])|([aA]-[pP][hH][y]))|(([cC][sS][iI]2)|([cC][sS][i]-2))|([iI]3[c])|(([mM][pP][hH][yY])|([mM]-[pP][hH][y])))(?=®)"
regexModifiers: "gi"
shouldMatch: false
includeCodeBlocks: false
format: markdown
type: warning
errorMessage: The MIPI® / A-PHY® / CSI-2® / I3C® / M-PHY® trademark owned by MIPI Alliance is not used correctly.
20 changes: 10 additions & 10 deletions scripts/validation/rules/rules-tutorials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
# format: markdown
# errorMessage: Missing '## Goals' section.

- regex: "(?<=\\s)\\*[^* ].*\\*[^*]"
shouldMatch: false
type: warning
format: markdown
errorMessage: The use of italic emphasis is discouraged.
#- regex: "(?<=\\s)\\*[^* ].*\\*[^*]"
# shouldMatch: false
# type: warning
# format: markdown
# errorMessage: The use of italic emphasis is discouraged.

- regex: "(?<=\\s)_[^_].*_[^_]"
shouldMatch: false
type: warning
format: markdown
errorMessage: The use of italic emphasis is discouraged.
# - regex: "(?<=\\s)_[^_].*_[^_]"
# shouldMatch: false
# type: warning
# format: markdown
# errorMessage: The use of italic emphasis is discouraged.

- regex: "^\\*{3}(?: +\\S+)|(?:\\S+ +)\\*{3}$"
shouldMatch: false
Expand Down