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

New AsciiDoc rules - catch unclosed attr blocks, catch unclosed id quotes #54

Merged
merged 1 commit into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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\=\".*(?<!\")\]'