Skip to content

Commit

Permalink
Add OpenShift "No 'Optional:' in header" rule
Browse files Browse the repository at this point in the history
  • Loading branch information
apinnick committed Sep 19, 2024
1 parent 1653816 commit c136dbd
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .vale/fixtures/OpenShiftAsciiDoc/NoOptionalInHeader/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `NoOptionalInHeader` rule
StylesPath = ../../../styles
MinAlertLevel = error
[*.adoc]
OpenShiftAsciiDoc.NoOptionalInHeader = YES
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//vale-fixture
:_mod-docs-content-type: REFERENCE
[id="optional-postinstall-configurations_{context}"]
= Optional: Postinstall configurations

== Optional: More postinstall configurations

\\ == Optional: more options

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//vale-fixture
:_mod-docs-content-type: REFERENCE
[id="cli-basic-commands_{context}"]
= No optional CLI commands
8 changes: 8 additions & 0 deletions .vale/styles/OpenShiftAsciiDoc/NoOptionalInHeader.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 begin a module or assembly header with 'Optional:'."
raw:
- '(?<!\/\/)={1,5} Optional:'

0 comments on commit c136dbd

Please sign in to comment.