Skip to content

Commit

Permalink
Vale POS rule For noun + using
Browse files Browse the repository at this point in the history
  • Loading branch information
aireilly committed Jul 23, 2024
1 parent 5610115 commit ea36919
Show file tree
Hide file tree
Showing 21 changed files with 142 additions and 99 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/preview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
preview-build:
name: Preview build
runs-on: ubuntu-latest
container: quay.io/antoraformodulardocs/antora-for-modular-docs:main
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -34,6 +33,12 @@ jobs:
# Refresh the cache every week to avoid a stale cache for htmltest
# See: https://github.com/actions/cache
# See: http://man7.org/linux/man-pages/man1/date.1.html
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install Antora
run: npm i antora @antora/lunr-extension
- name: Get yearweek for cache
id: get-date # used below
run: echo "yearweek=$(/bin/date -u "+%Y%U")" >> $GITHUB_OUTPUT
Expand All @@ -45,8 +50,15 @@ jobs:
with:
path: .cache
key: ${{ steps.get-date.outputs.yearweek }}
- name: Build
run: tools/publication-builder.sh
- name: Install Vale
run: |
sudo gem install asciidoctor
curl -s https://api.github.com/repos/errata-ai/vale/releases/latest | grep "browser_download_url.*Linux_64-bit.tar.gz" | cut -d : -f 2,3 | tr -d \" | wget -qi -
mkdir bin && tar -xvzf *Linux_64-bit.tar.gz -C bin
export PATH=./bin:"$PATH"
vale -v
- name: Generate Site
run: npx antora antora-playbook.yml
- name: Store pull request details for preview-publish
run: |
echo "${{ github.event.number }}" > PR_NUMBER
Expand All @@ -60,8 +72,14 @@ jobs:
PR_NUMBER
PR_SHA
retention-days: 7
- uses: actions/cache@v2
with:
path: tmp/.htmltest
key: ${{ runner.os }}-htmltest
- name: Validate internal and external links
run: htmltest
run: |
curl https://htmltest.wjdp.uk | bash
bin/htmltest
- name: Validate language changes
run: |
tools/validate-language-changes.sh
tools/validate-language-changes.sh
11 changes: 8 additions & 3 deletions .github/workflows/publication-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@ jobs:
publication-builder:
name: Build and publish to publication branch
runs-on: ubuntu-latest
container: quay.io/antoraformodulardocs/antora-for-modular-docs:main
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build using antora
run: tools/publication-builder.sh
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install Antora
run: npm i antora @antora/lunr-extension
- name: Generate Site
run: npx antora antora-playbook.yml
- name: Commit artifact to publication branch
uses: peaceiris/actions-gh-pages@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/validate-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
- name: Install Vale and validate rules
run: |
sudo gem install asciidoctor
wget https://github.com/errata-ai/vale/releases/download/v2.30.0/vale_2.30.0_Linux_64-bit.tar.gz
curl -s https://api.github.com/repos/errata-ai/vale/releases/latest | grep "browser_download_url.*Linux_64-bit.tar.gz" | cut -d : -f 2,3 | tr -d \" | wget -qi -
mkdir bin && tar -xvzf *Linux_64-bit.tar.gz -C bin
export PATH=./bin:"$PATH"
vale -v
chmod +x tools/validate-vale-rules.sh
./tools/validate-vale-rules.sh
./tools/validate-vale-rules.sh
24 changes: 0 additions & 24 deletions .github/workflows/web-ide-link.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ Hybrid Cloud Console
//vale-fixture
IBM Cloud
//vale-fixture
IBM Cloud Bare Metal
//vale-fixture
IBM LinuxONE
//vale-fixture
IBM Power
Expand Down Expand Up @@ -177,4 +175,4 @@ CAPV
//vale-fixture
CAPX
//vale-fixture
CAPZ
CAPZ
3 changes: 0 additions & 3 deletions .vale/fixtures/RedHat/CaseSensitiveTerms/testinvalid.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,6 @@ UNIX-like
uri
url
urn
Use the .NET Core framework
Use the .Net Core framework
Use the .Net framework
User Portal
var
VCPU
Expand Down
21 changes: 19 additions & 2 deletions .vale/fixtures/RedHat/TermsErrors/testinvalid.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,25 @@ back slash
backside
backwards compatible
barcode
bare metal clusters
bare metal compute
bare metal configuration
bare metal control
bare metal environment
bare metal equipment
bare metal event
bare metal hardware
bare metal host
bare metal infrastructure
bare metal installation
bare metal installer
bare metal machine
bare metal media
bare metal node
bare metal provisioning
bare metal server
bare metal worker
Install on bare-metal.
best of breed
Bidi
Big Blue
Expand Down Expand Up @@ -388,7 +407,6 @@ TCP/IP network
teleprocessing line
testcase
the installer
There are many ways to write, for instance, using a pencil.
thin provisioned
third-party software vendor
thru
Expand Down Expand Up @@ -443,7 +461,6 @@ virtual diskette drive
virtual DOS machine
virtual hard disk
virtual hard disk
w/ this
w/o
wait condition
war room
Expand Down
18 changes: 18 additions & 0 deletions .vale/fixtures/RedHat/TermsErrors/testvalid.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ back
backslash
backup
bar code
bare-metal clusters
bare-metal compute
bare-metal configuration
bare-metal control
bare-metal environment
bare-metal equipment
bare-metal event
bare-metal hardware
bare-metal host
bare-metal infrastructure
bare-metal installation
bare-metal installer
bare-metal machine
bare-metal media
bare-metal node
bare-metal provisioning
bare-metal server
bare-metal worker
bean
benchmark
best in class
Expand Down
19 changes: 0 additions & 19 deletions .vale/fixtures/RedHat/TermsSuggestions/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
above
afterwards
all caps
bare metal clusters
bare metal compute
bare metal configuration
bare metal control
bare metal environment
bare metal equipment
bare metal event
bare metal hardware
bare metal host
bare metal infrastructure
bare metal installation
bare metal installer
bare metal machine
bare metal media
bare metal node
bare metal provisioning
bare metal server
bare metal worker
below
bottom left
bottom right
Expand Down Expand Up @@ -48,7 +30,6 @@ segfault
shell
spawn
start up
Start using this.
tar
tar file
tarball
Expand Down
21 changes: 1 addition & 20 deletions .vale/fixtures/RedHat/TermsSuggestions/testvalid.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,8 @@ about using
after
are not using
are using
bare-metal clusters
bare-metal compute
bare-metal configuration
bare-metal control
bare-metal environment
bare-metal equipment
bare-metal event
bare-metal hardware
bare-metal host
bare-metal infrastructure
bare-metal installation
bare-metal installer
bare-metal machine
bare-metal media
bare-metal node
bare-metal provisioning
bare-metal server
bare-metal worker
before
By using
by using
by
earlier
following
from
Expand Down
14 changes: 9 additions & 5 deletions .vale/fixtures/RedHat/UserReplacedValues/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
This is __<a-user-replaced-value>__ with hyphens.
This is __<a-user-replaced_value>__ with hyphens and underscores.
This is __<a_user-replaced-value>__ with hyphens and undersores.
This is __<a_user-replaced_value>__ with hyphens and underscores.
This is __<a_user-`replaced`_value>__ with hyphens and monospaced.
* `<user-replaced-value>` with hyphens in backticks
* <user-replaced_value> with hyphens and underscores
* <user-replaced-value> with hyphens and undersores
* <user-replaced_value> with hyphens and underscores
* __<a-user-replaced-value>__ with hyphens
* __<a-user-replaced_value>__ with hyphens and underscores
* __<a_user-replaced-value>__ with hyphens and undersores
* __<a_user-replaced_value>__ with hyphens and underscores
* __<a_user-`replaced`_value>__ with hyphens and monospaced
5 changes: 5 additions & 0 deletions .vale/fixtures/RedHat/Using/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `Using` rule
StylesPath = ../../../styles
MinAlertLevel = suggestion
[*.adoc]
RedHat.Using = YES
1 change: 1 addition & 0 deletions .vale/fixtures/RedHat/Using/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
We improved the system using new algorithms.
6 changes: 6 additions & 0 deletions .vale/fixtures/RedHat/Using/testvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
If you are using the ElasticSearch log store do nothing.
The application crashes when not using the recommended API.
Developers are using the latest version of the framework.
Switching to using cloud storage improved our backup efficiency.
The documentation provides guidelines about using third-party libraries.
Users experience faster load times when using the optimized query.
2 changes: 1 addition & 1 deletion .vale/styles/RedHat/CaseSensitiveTerms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ swap:
'(?<!JBoss )EAP|(?<!Red Hat )JBoss(?!\sCommunity|\sBroker|\sClients|\sConsole|\sAMQ|\sData\sGrid|\sBRMS|\sBPMS|\sEnterprise\sApplication\sPlatform|\.org|\sInterconnect|\sEAP|\sBPM\sSuite)': JBoss EAP
'(?<!Realtime )Decision\sServer': Realtime Decision Server
'[nN]odejs|[nN]ode\.JS|node\.js': Node.js
'\s\.Net Core|\s\.Net|\s\.NET\sCore|dotNet': .NET
'\s\.Net Core|\s\.Net|\s\.NET\sCore|dotNet': \s.NET
'A-MQ(?!\sBroker|\sClient|\sConsole|\sInterconnect)': AMQ
'A-MQ\sBroker': AMQ Broker
'A-MQ\sClients': AMQ Clients
Expand Down
6 changes: 5 additions & 1 deletion .vale/styles/RedHat/RepeatedWords.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ link: https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference
ignorecase: false
alpha: true
action:
name: remove
name: edit
params:
- regex
- '(\w+)(\s\w+)' # pattern
- "$1" # replace
tokens:
- '[^\s\.]+'
- '[^\s]+'
3 changes: 2 additions & 1 deletion .vale/styles/RedHat/TermsErrors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ swap:
"(?<!Mozilla )Thunderbird": Mozilla Thunderbird
"(?<!pseudo-)ops": operations
"(?<!self-)hosted engine|hosted-engine": self-hosted engine
"bare metal( clusters?| compute| configuration| controls?| environments?| equipment| events?| hardware| hosts?| infrastructure| installations?| installers?| machines?| media| nodes?| provisioning| servers?| workers?)": bare-metal $1
"bare-metal(?! clusters?| compute| configuration| controls?| environments?| equipment| events?| hardware| hosts?| infrastructure| installations?| installers?| machines?| media| nodes?| provisioning| servers?| workers?)": bare metal
"[bB]asic [aA]uth": Basic HTTP authentication|Basic authentication
"a lot(?: of)?": many|much
"best of breed|best-of-breed": best in class
Expand All @@ -34,7 +36,6 @@ swap:
"top(?:-)?left": upper left|upper right|upper-left|upper-right
"top(?:-)?right": upper left|upper right|upper-left|upper-right
"UPI": user-provisioned infrastructure
"w/(?!o) ": "with "
"w/o": without
'(?<!IBM\s)S\/390|S90|S\s390': IBM S/390
'backwards?\scompatible': compatible with earlier versions
Expand Down
8 changes: 3 additions & 5 deletions .vale/styles/RedHat/TermsSuggestions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ ignorecase: false
level: suggestion
link: https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/termssuggestions/
message: "Depending on the context, consider using '%s' rather than '%s'."
scope: sentence
action:
name: replace
swap:
"(?<!,| in| on| at| to| for| from| of| with| without| against) which": ", which| that"
"(?<!.-)jar": compress|archive
"(?<![Bb]y |not |are |to |about |[Ww]hen )using": by using|that uses
"(?<!, | in | on | at | to | for | from | of | with | without | against )which": "that"
", that": ", which| that"
"[Bb]are metal(?= clusters?| compute| configuration| controls?| environments?| equipment| events?| hardware| hosts?| infrastructure| installations?| installers?| machines?| media| nodes?| provisioning| servers?| workers?)": bare-metal
"[Bb]are-metal(?! clusters?| compute| configuration| controls?| environments?| equipment| events?| hardware| hosts?| infrastructure| installations?| installers?| machines?| media| nodes?| provisioning| servers?| workers?)": bare metal
"(?<!.-)jar": compress|archive
"[Nn]avigate": click|select|browse|go to
"bottom(?:-)?left": lower left|lower-left
"bottom(?:-)?right": lower right|lower-right
Expand Down
18 changes: 13 additions & 5 deletions .vale/styles/RedHat/UserReplacedValues.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
---
extends: substitution
message: "%s."
link: https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/userreplacedvalues/
extends: existence
level: suggestion
message: "Separate words by underscores in user-replaced values."
link: https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/userreplacedvalues/
scope: raw
swap:
'__<[a-z_\x60]+-[\x60a-z_-]+>__': Separate words by underscores in user-replaced values
nonword: true
action:
name: edit
params:
- regex
- "(-)" # pattern
- "_" # replace
tokens:
- '__<[a-z_\x60]+-[\x60a-z_-]+>__'
- '<[a-z_]+-[a-z_-]+>'
14 changes: 14 additions & 0 deletions .vale/styles/RedHat/Using.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
extends: sequence
message: "Use 'by using' instead of 'using' when it follows a noun for clarity and grammatical correctness."
link: https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/using/
level: warning
action:
name: edit
params:
- regex
- '(\w+)( using)' # pattern
- "$1 by using" # replace
tokens:
- tag: NN|NNP|NNPS|NNS
- pattern: using
Loading

0 comments on commit ea36919

Please sign in to comment.