Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Commit

Permalink
adds rules to catch broken ids
Browse files Browse the repository at this point in the history
  • Loading branch information
aireilly committed Apr 27, 2023
1 parent cbd5697 commit 093e41b
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 0 deletions.
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 = error
[*.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
4 changes: 4 additions & 0 deletions .vale/fixtures/AsciiDoc/ClosedAttributeBlocks/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/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 = error
[*.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}
7 changes: 7 additions & 0 deletions .vale/styles/AsciiDoc/ClosedAttributeBlocks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
extends: existence
scope: raw
level: error
message: "Attribute block is not closed."
raw:
- '(?<!\/\/)\[.*(?<!\])\n'
7 changes: 7 additions & 0 deletions .vale/styles/AsciiDoc/ClosedIdQuotes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
extends: existence
scope: raw
level: error
message: "Quoted ID value is not closed."
raw:
- '(?<!\/\/)\[id\=\".*(?<!\")\]'

0 comments on commit 093e41b

Please sign in to comment.