Skip to content

Commit

Permalink
Adding en dash rule
Browse files Browse the repository at this point in the history
  • Loading branch information
aireilly committed Jan 2, 2024
1 parent f3a77e4 commit 0b6006c
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .vale/fixtures/RedHat/EnDashes/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `EnDashes` rule
StylesPath = ../../../styles
MinAlertLevel = suggestion
[*.adoc]
RedHat.EnDashes = YES
1 change: 1 addition & 0 deletions .vale/fixtures/RedHat/EnDashes/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
50 - 100 px
4 changes: 4 additions & 0 deletions .vale/fixtures/RedHat/EnDashes/testvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
numbers 12–15
pages 100–107
X'41'–X'FE'
September–December
14 changes: 9 additions & 5 deletions .vale/styles/RedHat/CaseSensitiveTerms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ message: Use '%s' rather than '%s'.
action:
name: replace
swap:
"(?<!.-)javadocs?": Javadoc|API documentation|Java API documentation
"(?<!/)var": VAR
"(?<!Business )Resource Planner|(?<!Business Resource )Planner": Business Resource Planner
"(?<!Microsoft )Azure": Microsoft Azure
Expand All @@ -17,6 +18,7 @@ swap:
"(?<!Red Hat )OpenStack Platform|RHOS|RH-OSP": Red Hat OpenStack Platform
"(?<!Red Hat JBoss )BRMS(?! engine)": inference engine
"(?<!Red Hat JBoss )BRMS|BRM|(?<!Red Hat )JBoss BRMS": Red Hat JBoss BRMS
"(?<!T-)BC": Business Central
"[dD]ay-0|day 0": Day 0
"[dD]ay-1|day 1": Day 1
"[dD]ay-2|day 2": Day 2
Expand All @@ -27,7 +29,7 @@ swap:
"Kernel(?!-based Virtual Machine)": kernel
"OCM|(?<!Red Hat OpenShift )Cluster Manager|(?<!Red Hat )OpenShift Cluster Manager|the OpenShift Cluster Manager": Red Hat OpenShift Cluster Manager
"OD": Red Hat OpenShift Dedicated
"(?<!.-)javadocs?": Javadoc|API documentation|Java API documentation
"sub version|(?<!Apache )Subversion": sub-version
'(?<!\.)IM': instant message
'(?<!\.)yaml|Yaml': YAML
'(?<!JBoss )EAP|(?<!Red Hat )JBoss(?!\sCommunity|\sBroker|\sClients|\sConsole|\sAMQ|\sData\sGrid|\sBRMS|\sBPMS|\sEnterprise\sApplication\sPlatform|\.org|\sInterconnect|\sEAP|\sBPM\sSuite)': JBoss EAP
Expand All @@ -54,18 +56,19 @@ swap:
'Red\sHat\sVirtualization\sHypervisor|RHV\sHost|RHV-H': Red Hat Virtualization Host
'RHVM|RHV-M|RHV\sManager': Red Hat Virtualization Manager
'self-hosted\sengine\svirtual\smachine|engine\sVM': Manager virtual machine
"sub version|(?<!Apache )Subversion": sub-version
(?<!Ansible )Playbook: playbook
Ansible playbook: Ansible Playbook
Ansible rulebook: Ansible Rulebook
Appliance Console: Appliance console
Applix|ApplixWare: Applixware
application stream|Application stream: Application Stream
Applix|ApplixWare: Applixware
Appstream|appstream: AppStream repository
asciidoctor|AsciiDoctor: Asciidoctor
asciidoc|Asciidoc: AsciiDoc
assertj|Assertj: AssertJ
auto-link|AutoLink: autolink
AWS opt in Region: AWS opt-in Region
basic authentication|Basic Authentication|basic auth|Basic auth|Basic Auth: Basic HTTP authentication|Basic authentication
"(?<!T-)BC": Business Central
Bean: bean
Bios: BIOS
blue print|BluePrint: blueprint
Expand Down Expand Up @@ -184,6 +187,7 @@ swap:
Lightweight Directory Access Protocol over Secure Socket Layer: LDAPS
LINUX|linux: Linux
live-backup group: master-slave group
Local Zone|LZ|local zone: AWS Local Zone
Lun|lun: LUN
master CA: IdM CA renewal server
master server: IdM server and replicas
Expand All @@ -205,10 +209,10 @@ swap:
ODF: Red Hat OpenShift Data Foundation
OK button|okay|ok: OK
Open InfiniBand|Infiniband: InfiniBand
Open Telemetry: OpenTelemetry (OTel)
openid connect|Openid Connect: OpenID Connect
openrewrite|Openrewrite|Open Rewrite: OpenRewrite
Openshift online|OO: Red Hat OpenShift Online
Open Telemetry: OpenTelemetry (OTel)
Operating Environment: operating environment
Operator Hub|Operator hub|Operatorhub|operatorhub: OperatorHub
Opex|Opex|OPEX|opEx: OpEx
Expand Down
9 changes: 9 additions & 0 deletions .vale/styles/RedHat/EnDashes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
extends: substitution
level: warning
link: https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/endashes/
message: "Use an en dash to show a range or inclusive numbers. Do not use a space before or after the en dash."
action:
name: replace
swap:
(?<=[\d]+)\s-\s(?=[\d]+):
3 changes: 2 additions & 1 deletion .vale/styles/RedHat/TermsWarnings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,17 @@ swap:
he|she: you
host name: hostname
illegal: invalid|not allowed|incorrect
invokable: invocable
in order to: to
ingests?: import|load|obtain|process
insure: ensure
invokable: invocable
kill: end|stop
kilobytes?: KB|kB
leverage: use
look at: examine
may: might|can
on-premises|on-prem|on premise: on-premise|on-site|in-house
opt into|opting into: opt in
preload: preinstall
preloaded: preinstalled
right double-click: double right-click
Expand Down
1 change: 1 addition & 0 deletions modules/reference-guide/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* xref:definitions.adoc[]
* xref:donotuse.adoc[]
* xref:ellipses.adoc[]
* xref:endashes.adoc[]
* xref:headingpunctuation.adoc[]
* xref:headings.adoc[]
* xref:hyphens.adoc[]
Expand Down
18 changes: 18 additions & 0 deletions modules/reference-guide/pages/endashes.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
:navtitle: endashes
:keywords: reference, rule, endashes

= En Dashes

Use an link:https://www.compart.com/en/unicode/U+2013[En dash] (`–`) to show a range or inclusive numbers.
Do not use spaces before or after the en dash.

[NOTE]
====
An link:https://www.compart.com/en/unicode/U+2014[Em dash] (`-`) is not the same as an en dash.
The em dash works like a comma, a colon, or parenthesis.
====

.Additional resources

* link:{ibmsg-url-print}[{ibmsg-print} - En dashes, p.48]
* link:{ibmsg-url}?topic=punctuation-dashes#showing-ranges-with-en-dashes[{ibmsg} - Showing ranges with en dashes]

0 comments on commit 0b6006c

Please sign in to comment.