Skip to content

Adding CodeBlockSubsVerbatim rule#1004

Open
aireilly wants to merge 1 commit into
redhat-documentation:mainfrom
aireilly:CodeBlockSubsVerbatim
Open

Adding CodeBlockSubsVerbatim rule#1004
aireilly wants to merge 1 commit into
redhat-documentation:mainfrom
aireilly:CodeBlockSubsVerbatim

Conversation

@aireilly
Copy link
Copy Markdown
Member

@aireilly aireilly commented Jan 22, 2026

Created .vale/styles/AsciiDoc/CodeBlockSubsVerbatim.yml

  • Detects shell redirection patterns like 2>&1, >&2, &>, &>> in code blocks
  • Only flags when subs=verbatim is not present on the code block
Example output

4:120  error  Code block contains shell redirection '2>&1' 
       but is missing 'subs=verbatim'. Add 'subs=verbatim' or
       'subs="+quotes,verbatim"' to prevent parsing issues.

The rule properly handles:

  • [source,terminal,subs=verbatim] - no warning
  • [source,bash,subs="verbatim"] - no warning
  • [source,shell,subs="+quotes,verbatim"] - no warning
  • Code blocks without subs=verbatim containing 2>&1, >&2, &> - error

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 22, 2026

⚡️ Deploying PR Preview...

@aireilly aireilly force-pushed the CodeBlockSubsVerbatim branch 3 times, most recently from 045a050 to 47dec43 Compare January 22, 2026 14:20
Signed-off-by: Aidan Reilly <aireilly@redhat.com>

Signed-off-by: Aidan Reilly <aireilly@redhat.com>

Signed-off-by: Aidan Reilly <aireilly@redhat.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@aireilly aireilly force-pushed the CodeBlockSubsVerbatim branch from 47dec43 to 109868c Compare April 15, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant