Set up lefthook for Ruby formatters and type checking

This commit is contained in:
Dylan Knutson
2025-07-13 01:20:45 +00:00
parent fd82eafb50
commit 6fc3f772c3
79 changed files with 172996 additions and 14 deletions

38
lefthook.yml Normal file
View File

@@ -0,0 +1,38 @@
pre-commit:
commands:
syntax-tree:
glob: "*.rb,*.rbi,*.rbs"
run: bundle exec stree write {staged_files}
stage_fixed: true
exclude: |
vendor/
tmp/
log/
sorbet:
run: bundle exec srb tc
pass_filenames: false
fail_text: "Sorbet type checking failed"
tapioca-gems:
run: bundle exec tapioca gems
pass_filenames: false
fail_text: "Tapioca gems check failed"
trailing-whitespace:
glob: "*.{rb,yml,yaml,json,md}"
run: sed -i 's/[[:space:]]*$//' {staged_files}
stage_fixed: true
commit-msg:
commands:
# Add commit message linting if desired
# conventional-commits:
# run: echo "Commit message validation passed"
pre-push:
commands:
# Run more comprehensive checks before pushing
# tests:
# run: bundle exec rspec
# fail_text: "Tests failed"