feat: add AsciiDoc linter pre-commit hook (#285)#286
Merged
raifdmueller merged 3 commits intodocToolchain:mainfrom Feb 12, 2026
Merged
feat: add AsciiDoc linter pre-commit hook (#285)#286raifdmueller merged 3 commits intodocToolchain:mainfrom
raifdmueller merged 3 commits intodocToolchain:mainfrom
Conversation
Added docToolchain/asciidoc-linter to catch AsciiDoc syntax errors before commit. Changes: - Add asciidoc-linter as dev dependency (from git) - Configure local pre-commit hook for .adoc files - Enable direct git references in hatchling config Limitations: - Linter does NOT currently detect Markdown tables (issue docToolchain#38) - Only detects WS001 warnings (missing spaces after markers) - Requires manual fix of false positives (*bold* vs list markers) Feature requests filed in asciidoc-linter repo: - docToolchain#38: Detect Markdown table syntax - docToolchain#39: Add native pre-commit hooks support (.pre-commit-hooks.yaml) - docToolchain#40: Publish to PyPI for easier installation Testing: - Tested on ADR-011.adoc with known Markdown table (not detected) - Pre-commit hook runs successfully but needs improvements Related: docToolchain#285 (parent issue for AsciiDoc linting) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixed incorrect Markdown table syntax in ADR-011 and ADR-012. Converted to proper AsciiDoc table format with [cols] directive. Before (Markdown): | Dimension | Score | Level | Evidence | |-----------|-------|-------|----------| | Code Type | 2 | ... | ... | After (AsciiDoc): [cols="2,1,2,5"] |=== | Dimension | Score | Level | Evidence | Code Type | 2 | ... | ... |=== Note: The asciidoc-linter does not yet detect this error (issue docToolchain#38). These were found by manual code review. Linter status: - Remaining WS001 warnings are false positives (confuses *bold* with * list) - Same syntax exists in ADR-001 through ADR-010 (valid AsciiDoc) - Commit uses --no-verify due to false positives blocking commit Related: docToolchain#285, docToolchain/asciidoc-linter#38 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Added section to CLAUDE.md explaining: - AsciiDoc linter integration via pre-commit hook - Known issue: WS001 false positives on *bold* syntax - Known issue: Markdown tables not detected - Workaround: Use --no-verify for false positives - Linter runs on all .adoc files in repository This helps contributors understand: - Why commits may be blocked by the linter - How to distinguish real errors from false positives - When to use --no-verify safely Related: docToolchain#285, asciidoc-linter#38, asciidoc-linter#41 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds asciidoc-linter as a pre-commit hook to catch AsciiDoc syntax errors before commit. This addresses issue #285.
Changes
1. AsciiDoc Linter Integration
Added:
asciidoc-linteras dev dependency (installed from GitHub, not yet on PyPI).pre-commit-config.yamltool.hatch.metadata.allow-direct-references = trueto support git dependenciesRuns on: All
.adocand.asciidocfiles in the repository2. Fixed Markdown Tables in ADRs
Converted incorrect Markdown table syntax to proper AsciiDoc format:
Before (Markdown):
After (AsciiDoc):
Files fixed:
src/docs/arc42/adr/ADR-011.adocsrc/docs/arc42/adr/ADR-012.adoc3. Documentation
Updated
CLAUDE.mdwith:--no-verifyKnown Limitations
Linter Issues (reported upstream)
WS001 false positives (asciidoc-linter#41)
*bold*syntax as list markersgit commit --no-verifywhen only false positives presentMarkdown tables NOT detected (asciidoc-linter#38)
|---|---|syntaxFeature Requests Filed
Also filed upstream enhancement requests:
.pre-commit-hooks.yaml)Testing
Linter verification:
Results:
*bold*)Migration Guide
For contributors:
Install dev dependencies:
Pre-commit hooks auto-install on first commit
If commit is blocked by WS001 false positives:
*bold*syntax is correct):git commit --no-verify -m "your message"Watch for real errors:
Breaking Changes
None
Related Issues
Generated with 🤖 Claude Code (AI-assisted development)
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com