Skip to content

Add markdown linting and pre-push build validation to git hooks#116

Merged
thomasnemer merged 1 commit intomainfrom
115-improve-git-hooks
Nov 11, 2025
Merged

Add markdown linting and pre-push build validation to git hooks#116
thomasnemer merged 1 commit intomainfrom
115-improve-git-hooks

Conversation

@thomasnemer
Copy link
Copy Markdown
Contributor

@thomasnemer thomasnemer commented Nov 11, 2025

Summary

This PR implements the improvements requested in issue #115 by adding:

  • Markdown linting to the pre-commit hook
  • Pre-push build validation to prevent broken code from reaching the remote

Changes Made

1. Markdown Linting Integration

Added rumdl as markdown linter:

  • Added rumdl (Rust Markdown Linter) to .mise.toml tools
  • Created mise run markdown-check task for checking markdown files
  • Created mise run markdown-fix task for auto-fixing markdown issues

Updated pre-commit hook:

  • Added markdown linting step to hk.pkl pre-commit hook
  • Automatically checks all **/*.md files
  • Auto-fixes violations when possible (blank lines, heading spacing, list formatting)
  • Re-stages fixed markdown files automatically

2. Pre-Push Build Validation

Added pre-push hook:

  • New pre-push hook in hk.pkl that runs mise run build-ci
  • Ensures library, tests, and examples build successfully before push
  • Verifies no formatting violations exist
  • Prevents CI failures and broken pushes

3. Markdown Formatting Applied

  • Fixed 343 auto-fixable markdown issues across 32 files
  • Addressed spacing, blank lines, and list formatting issues
  • Remaining line length warnings (MD013) left for manual review

Testing

  • ✅ Git hooks installed successfully with hk install
  • ✅ Pre-commit hook runs clang-format on C++ files
  • ✅ Pre-commit hook runs rumdl fmt on markdown files
  • ✅ Pre-push hook runs full build validation
  • ✅ Committed and pushed successfully with new hooks

Benefits

  1. Consistency: All markdown files follow consistent formatting style
  2. Early detection: Catch build failures locally before pushing
  3. CI efficiency: Fewer failed CI runs due to formatting or build issues
  4. Documentation quality: Better docs with enforced markdown standards

Related Issue

Closes #115

Documentation

  • Git hooks configuration documented in hk.pkl with inline comments
  • Mise tasks documented with clear descriptions
  • Hook behavior documented in CONTRIBUTING.md

Fixes #115

@thomasnemer thomasnemer merged commit 5a284ed into main Nov 11, 2025
1 check passed
@thomasnemer thomasnemer deleted the 115-improve-git-hooks branch November 11, 2025 17:13
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.

Expand git hooks: add markdown linting and pre-push build validation

1 participant