Set up lefthook for Ruby formatters and type checking
This commit is contained in:
38
lefthook.yml
Normal file
38
lefthook.yml
Normal 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"
|
||||
Reference in New Issue
Block a user