Add pre-commit hooks for code quality #19

Merged
eblume merged 1 commit from add-pre-commit into main 2026-01-16 19:33:03 -08:00
Owner

Summary

  • Add pre-commit framework with hooks for YAML, Ansible, Python, shell, TOML, JSON, and secret detection
  • Fix all 91+ ansible-lint violations (variable naming, handler capitalization, changed_when)
  • Fix shellcheck warnings in mise-tasks scripts
  • Document pre-commit setup in README.md

Deployment and Testing

  • All pre-commit hooks pass (uvx pre-commit run --all-files)
  • Test ansible playbook with --check mode
  • Run mise run indri-services-check after deploy

🤖 Generated with Claude Code

## Summary - Add pre-commit framework with hooks for YAML, Ansible, Python, shell, TOML, JSON, and secret detection - Fix all 91+ ansible-lint violations (variable naming, handler capitalization, changed_when) - Fix shellcheck warnings in mise-tasks scripts - Document pre-commit setup in README.md ## Deployment and Testing - [x] All pre-commit hooks pass (`uvx pre-commit run --all-files`) - [x] Test ansible playbook with `--check` mode - [x] Run `mise run indri-services-check` after deploy 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Introduces pre-commit framework with hooks for:
- General file hygiene (trailing whitespace, EOF, large files)
- Secret detection (TruffleHog)
- YAML linting (yamllint)
- Ansible linting (ansible-lint)
- Python linting/formatting (ruff)
- Shell script analysis (shellcheck, shfmt)
- TOML formatting (taplo)
- JSON formatting (prettier)

Fixes 91+ ansible-lint violations:
- Renamed variables to use role prefixes (e.g., brew_start -> alloy_brew_start)
- Capitalized handler names per convention
- Added changed_when to command tasks
- Fixed template usage in task names

Fixes shellcheck warnings:
- Removed unused variables
- Fixed SC2155 (declare and assign separately)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
eblume merged commit 9931829d03 into main 2026-01-16 19:33:03 -08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
eblume/blumeops!19
No description provided.