Skip to content

Fix WS001 false positive with bold syntax (Issue #41)#44

Merged
rdmueller merged 1 commit intodocToolchain:mainfrom
raifdmueller:feature/issue-41-ws001-bold-syntax
Feb 12, 2026
Merged

Fix WS001 false positive with bold syntax (Issue #41)#44
rdmueller merged 1 commit intodocToolchain:mainfrom
raifdmueller:feature/issue-41-ws001-bold-syntax

Conversation

@raifdmueller
Copy link
Collaborator

Summary

  • Fix: WS001 no longer flags AsciiDoc bold syntax (*text*, **text**) as list markers missing a space
  • Root cause: The list marker check treated any line starting with * as a potential list marker, without distinguishing inline bold formatting
  • Solution: Added _is_bold_syntax() helper method that detects matching closing asterisks, indicating bold formatting rather than a list marker

Changes

asciidoc_linter/rules/whitespace_rules.py

  • Added _is_bold_syntax(self, stripped) method to WhitespaceRule
  • Updated list marker check to skip bold syntax when asterisk markers are detected

tests/rules/test_whitespace_rules.py

Added 5 new test cases:

  1. test_bold_syntax_not_flagged_as_list_marker*Status:* Accepted pattern (common in ADRs)
  2. test_double_bold_syntax_not_flagged_as_list_marker**Positive:** pattern
  3. test_mid_line_bold_not_flagged — mid-line *bold* text
  4. test_list_marker_without_space_still_flagged — ensures real *Item violations are still caught
  5. test_valid_list_markers_not_flagged — ensures * item remains valid

Test plan

  • All 13 whitespace rule tests pass
  • All 143 tests in the full suite pass
  • Bold syntax at line start (*Status:*) no longer triggers WS001
  • Double-bold at line start (**Positive:**) no longer triggers WS001
  • Actual list markers without space (*Item) still correctly flagged
  • Valid list markers (* Item) remain unflagged

Fixes #41

🤖 Generated with Claude Code

…ocToolchain#41)

WS001 was incorrectly flagging AsciiDoc bold syntax (*text* and **text**)
as list markers missing a space. Added _is_bold_syntax() method to detect
when asterisks are used for inline bold formatting rather than list markers,
by checking for matching closing asterisks in the text.

Closes docToolchain#41

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rdmueller rdmueller merged commit 5c4a982 into docToolchain:main Feb 12, 2026
6 checks passed
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.

Bug: WS001 false positive - confuses bold syntax with list markers

2 participants

Comments