Skip to content

Commit

Permalink
532 - exclude snippet ranges from includes in assemblies
Browse files Browse the repository at this point in the history
  • Loading branch information
rohennes committed Jul 28, 2023
1 parent 24ed372 commit 1c228e1
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .vale/fixtures/OpenShiftAsciiDoc/NoLineRanges/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `NoLineRanges` rule
StylesPath = ../../../styles
MinAlertLevel = error
[*.adoc]
OpenShiftAsciiDoc.NoLineRanges = YES
11 changes: 11 additions & 0 deletions .vale/fixtures/OpenShiftAsciiDoc/NoLineRanges/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//vale-fixture
include::filename.txt[lines=5..10]

//vale-fixture
include::filename.txt[lines="1..10,15..20"]

//vale-fixture
include::filename.txt[lines=7;14..25;28..43]

//vale-fixture
include::filename.txt[lines=12..-1]
15 changes: 15 additions & 0 deletions .vale/fixtures/OpenShiftAsciiDoc/NoLineRanges/testvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
include::snippets/technology-preview.adoc[leveloffset=+0]

include::https://raw.githubusercontent.com/openshift/managed-cluster-validating-webhooks/master/docs/webhooks.json[]

include::yaml/ordinary-clock.yaml[leveloffset=+0]

include::yaml/ordinary-clock.yml[leveloffset=+0]

include::ordinary-clock.json[leveloffset=+0]

include::ordinary-clock.txt[leveloffset=+0]

include::ordinary-clock.md[leveloffset=+0]

include::xml/path/ordinary-clock.xml[]
8 changes: 8 additions & 0 deletions .vale/styles/OpenShiftAsciiDoc/NoLineRanges.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
extends: existence
scope: raw
level: error
link: https://github.com/openshift/openshift-docs/blob/main/contributing_to_docs/doc_guidelines.adoc#assembly-file-metadata
message: "Do not use line ranges for included files."
raw:
- '(?<!\/\/)include::.*\[lines=.*\]'

0 comments on commit 1c228e1

Please sign in to comment.