Skip to content

Commit

Permalink
Initial setup for the localization rule set
Browse files Browse the repository at this point in the history
  • Loading branch information
Chandralekha-RedHat committed Jan 23, 2024
0 parents commit c2139e4
Show file tree
Hide file tree
Showing 98 changed files with 1,658 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
#
# Copyright (c) 2021 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
name: Release
on:
push:
branches:
- main
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Create AsciiDoc ruleset release
run: |
cd .vale/styles
echo $GITHUB_RUN_NUMBER > version.txt
zip -r AsciiDoc.zip AsciiDoc
zip -r OpenShiftAsciiDoc.zip OpenShiftAsciiDoc
gh release create v$GITHUB_RUN_NUMBER 'AsciiDoc.zip' 'OpenShiftAsciiDoc.zip'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
19 changes: 19 additions & 0 deletions .github/workflows/validate-on-pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Verify Vale test fixtures
on:
- pull_request
jobs:
validate-rules:
name: Validate rules
runs-on: ubuntu-latest
#antora-for-modular-docs:main includes vale
container: quay.io/antoraformodulardocs/antora-for-modular-docs:main
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0 # enable git diff and building many branches
- name: Validate Vale rules
id: validate-rules
run: scripts/validate-vale-rules.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/**
11 changes: 11 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
StylesPath = ../.vale/styles

MinAlertLevel = suggestion

Packages = https://github.com/rohennes/ocp-rules/releases/latest/download/AsciiDoc.zip

#Ignore block comments in AsciiDoc source
TokenIgnores = (\/\/\/\/\n(.*\n)*\/\/\/\/\n)

[[!.]*.adoc]
BasedOnStyles = RedHat, AsciiDoc
5 changes: 5 additions & 0 deletions .vale/fixtures/AsciiDoc/ClosedAttributeBlocks/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `ClosedAttributeBlocks` rule
StylesPath = ../../../styles
MinAlertLevel = suggestion
[*.adoc]
AsciiDoc.ClosedAttributeBlocks = YES
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//vale-fixture
:_content-type: ASSEMBLY
[id="rosa-getting-started
= Comprehensive guide to getting started with {product-title}

//vale-fixture
:_content-type: ASSEMBLY
[id="rosa-getting-started_{context}
= Another guide to getting started
35 changes: 35 additions & 0 deletions .vale/fixtures/AsciiDoc/ClosedAttributeBlocks/testvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//vale-fixture
:_content-type: ASSEMBLY
[id="rosa-getting-started_{context}"]
= Comprehensive guide to getting started with {product-title}

//vale-fixture
.Example output
[source,terminal]
----
{"status":"success","data":{"resultType":"vector","result":[{"metric":{"__name__":"up","endpoint":"web","instance":"10.129.0.46:8080","job":"prometheus-example-app","namespace":"ns1","pod":"prometheus-example-app-68d47c4fb6-jztp2","service":"prometheus-example-app"},"value":[1591881154.748,"1"]}]}}
----

//vale-fixture
[source,terminal]
----
$ oc adm must-gather
[must-gather ] OUT Using must-gather plugin-in image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:125f183d13601537ff15b3239df95d47f0a604da2847b561151fedd699f5e3a5
[must-gather ] OUT namespace/openshift-must-gather-xm4wq created
[must-gather ] OUT clusterrolebinding.rbac.authorization.k8s.io/must-gather-2bd8x created
[must-gather ] OUT pod for plug-in image quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:125f183d13601537ff15b3239df95d47f0a604da2847b561151fedd699f5e3a5 created
----

//vale-fixture
.Example API response
[source,json]
----
[
{
"id": "ca11ab76-86f9-428c-8d3a-666c24e34d32",
"endpointUri": "http://localhost:9089/api/ocloudNotifications/v1/dummy",
"uriLocation": "http://localhost:8089/api/ocloudNotifications/v1/subscriptions/ca11ab76-86f9-428c-8d3a-666c24e34d32",
"resource": "/cluster/node/openshift-worker-0.openshift.example.com/redfish/event"
}
]
----
5 changes: 5 additions & 0 deletions .vale/fixtures/AsciiDoc/ClosedIdQuotes/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `ClosedIdQuotes` rule
StylesPath = ../../../styles
MinAlertLevel = suggestion
[*.adoc]
AsciiDoc.ClosedIdQuotes = YES
7 changes: 7 additions & 0 deletions .vale/fixtures/AsciiDoc/ClosedIdQuotes/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//vale-fixture
[id="rosa-getting-started_{context}]
= Comprehensive guide to getting started with {product-title}

//vale-fixture
[id="rosa-getting-started]
= Another guide to getting started
4 changes: 4 additions & 0 deletions .vale/fixtures/AsciiDoc/ClosedIdQuotes/testvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//vale-fixture
:_content-type: ASSEMBLY
[id="rosa-getting-started_{context}"]
= Comprehensive guide to getting started with {product-title}
5 changes: 5 additions & 0 deletions .vale/fixtures/AsciiDoc/ImageContainsAltText/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `XrefContainsAnchorID` rule
StylesPath = ../../../styles
MinAlertLevel = suggestion
[*.adoc]
AsciiDoc.ImageContainsAltText = YES
2 changes: 2 additions & 0 deletions .vale/fixtures/AsciiDoc/ImageContainsAltText/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//vale-fixture
image::my-image-name.png[]
2 changes: 2 additions & 0 deletions .vale/fixtures/AsciiDoc/ImageContainsAltText/testvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//Correct usage of alt text in image tags
image::my-image-name.png[my-image-alt-text]
5 changes: 5 additions & 0 deletions .vale/fixtures/AsciiDoc/MatchingDotCallouts/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `SequentialNumberedCallouts` rule
StylesPath = ../../../styles
MinAlertLevel = suggestion
[*.adoc]
AsciiDoc.MatchingDotCallouts = YES
25 changes: 25 additions & 0 deletions .vale/fixtures/AsciiDoc/MatchingDotCallouts/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//vale-fixture
[source,ruby]
----
get '/hi' do <.>
get '/hi' do <.>
get '/hi' do<.> <.> <.>
----
<.> first callout
<.> second callout
<.> third callout
<.> fourth callout
<.> fifth callout
<.> sixth callout

//vale-fixture
[source,ruby]
----
get '/hi' do <.>
get '/hi' do <.>
get '/hi' do <.>
----
<.> first callout, second block
<.> second callout, second block
<.> third callout, second block
<.> fourth callout, second block
12 changes: 12 additions & 0 deletions .vale/fixtures/AsciiDoc/MatchingDotCallouts/testvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//vale-fixture
[source,ruby]
----
require 'sinatra' <.>
get '/hi' do <.>
"Hello World!" <.>
end
----
<.> Library import
<.> URL mapping
<.> Response block
5 changes: 5 additions & 0 deletions .vale/fixtures/AsciiDoc/MatchingNumberedCallouts/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `SequentialNumberedCallouts` rule
StylesPath = ../../../styles
MinAlertLevel = suggestion
[*.adoc]
AsciiDoc.MatchingNumberedCallouts = YES
20 changes: 20 additions & 0 deletions .vale/fixtures/AsciiDoc/MatchingNumberedCallouts/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//vale-fixture
[source,ruby]
----
require 'frank' <1>
get '/hihi'<2><3>
----
<1> text
<2> More text
<3> More text again
<4> Again, more text

//vale-fixture
[source,ruby]
----
require 'frankie' <1>
get '/hihihi' <2>
----
<1> text!
<2> More text!
<3> More text again!
26 changes: 26 additions & 0 deletions .vale/fixtures/AsciiDoc/MatchingNumberedCallouts/testvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//vale-fixture
[source,ruby]
----
require 'sinatra' <1>
get '/hi' do <2> <3>
"Hello World!"
end
----
<1> Library import
<2> URL mapping
<3> Response block

//vale-fixture
[source,ruby]
----
require 'sinatra' \\//<1>
get '/hi' do <2><3>
"Hello World!"<4>
end
----
<1> Library import
<2> URL mapping
<3> Response block
<4> Hi
5 changes: 5 additions & 0 deletions .vale/fixtures/AsciiDoc/SequentialNumberedCallouts/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `SequentialNumberedCallouts` rule
StylesPath = ../../../styles
MinAlertLevel = suggestion
[*.adoc]
AsciiDoc.SequentialNumberedCallouts = YES
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[source,ruby]
----
require 'sinatra' <1>
get '/hi' do <2>
require 'sinatra' <3>
get '/hi' do <4>
hi there <5>
goop <6>
require 'sinatra'
get '/hi' do <7> <8>
"Hello World!"
----
//vale-fixture
<1> text
<2> More text
<3> More text again
<5> Some text
<6> Again, some text
<7> Moar text
<8> Again, some more text
25 changes: 25 additions & 0 deletions .vale/fixtures/AsciiDoc/SequentialNumberedCallouts/testvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//vale-fixture
[source,ruby]
----
require 'sinatra' <1>
get '/hi' do <2> <3>
"Hello World!"
end
----
<1> Library import
<2> URL mapping
<3> Response block

//vale-fixture
[source,ruby]
----
require 'sinatra' <1>
get '/hi' do <1>
"Hello World!"
end
key: value <2>
----
<1> Library import
<2> URL mapping
5 changes: 5 additions & 0 deletions .vale/fixtures/AsciiDoc/ValidAdmonitionBlocks/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `ValidAdmonitionBlocks` rule
StylesPath = ../../../styles
MinAlertLevel = suggestion
[*.adoc]
AsciiDoc.ValidAdmonitionBlocks = YES
18 changes: 18 additions & 0 deletions .vale/fixtures/AsciiDoc/ValidAdmonitionBlocks/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//vale-fixture
Here is a Admonition block:

[IMPORTANT]
.Feeding the Werewolves
====
While werewolves are hardy community members, keep in mind the following dietary concerns:
. They are allergic to cinnamon.
. More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.
. Celery makes them sad.
More text
[NOTE]
====
Hello
====
12 changes: 12 additions & 0 deletions .vale/fixtures/AsciiDoc/ValidAdmonitionBlocks/testvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//vale-fixture
Here is a Admonition block:

[IMPORTANT]
.Feeding the Werewolves
====
While werewolves are hardy community members, keep in mind the following dietary concerns:
. They are allergic to cinnamon.
. More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.
. Celery makes them sad.
====
5 changes: 5 additions & 0 deletions .vale/fixtures/AsciiDoc/ValidCodeBlocks/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `ValidConditions` rule
StylesPath = ../../../styles
MinAlertLevel = suggestion
[*.adoc]
AsciiDoc.ValidCodeBlocks = YES
33 changes: 33 additions & 0 deletions .vale/fixtures/AsciiDoc/ValidCodeBlocks/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//vale-fixture
Here is a code block:

[source,terminal]
----
$ pwd
----

Here is a another code block:

[source,terminal]
----
$ pwd
----

Here is a code block:

[source,yaml]
----
---
apiVersion: 4.11
Some text.
Here is a code block:
[subs="+quotes",options="nowrap",role="white-space-pre"]
----
---
apiVersion: 4.11
----

Some text.
Loading

0 comments on commit c2139e4

Please sign in to comment.