Skip to content

Commit

Permalink
adding symbols rule
Browse files Browse the repository at this point in the history
  • Loading branch information
aireilly committed Aug 22, 2023
1 parent f3afe4f commit c17e4fc
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .vale/fixtures/RedHat/Symbols/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `Symbols` rule
StylesPath = ../../../styles
MinAlertLevel = suggestion
[*.adoc]
RedHat.Symbols = YES
6 changes: 6 additions & 0 deletions .vale/fixtures/RedHat/Symbols/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Don't use this !
or this!
Don't use this & that
This + that is not OK.


12 changes: 12 additions & 0 deletions .vale/fixtures/RedHat/Symbols/testvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
:!attribute:
:attribute!:
\include::example.adoc[leveloffset=+1]
and is ok.
Use of C++ is OK.
don't use an exclamation mark
kbd:[Ctrl + a]
kbd:[Ctrl + shift + a]
plus symbol is fine
Use the "!" symbol
Use the "&" symbol
Use the "+" symbol
13 changes: 13 additions & 0 deletions .vale/styles/RedHat/Symbols.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
extends: existence
level: warning
scope: raw
link: https://redhat-documentation.github.io/supplementary-style-guide/#_symbols
message: "Do not use the '%s' symbol in original body copy."
nonword: true
tokens:
- '(?<![":])\!(?![":])'
- '(?<!")\&(?!")'
- '(?<!")\+(?!.*\]|\")'
exceptions:
- C\+\+
3 changes: 2 additions & 1 deletion modules/reference-guide/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
* xref:slash.adoc[]
* xref:spacing.adoc[]
* xref:spelling.adoc[]
* xref:symbols.adoc[]
* xref:termserrors.adoc[]
* xref:termssuggestions.adoc[]
* xref:termswarnings.adoc[]
* xref:usage.adoc[]
* xref:userreplacedvalues.adoc[]
* xref:userreplacedvalues.adoc[]
10 changes: 10 additions & 0 deletions modules/reference-guide/pages/symbols.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
:navtitle: Symbols
:keywords: reference, rule, Symbols

= Symbols

Do not use symbols such as ampersand (`&`), exclamation point (`!`), or plus symbol (`+`) in original body copy.

.Additional resources

* link:https://redhat-documentation.github.io/supplementary-style-guide/#_symbols[]

0 comments on commit c17e4fc

Please sign in to comment.