DEV: Add syntax_tree check to lefthook (#19877)

Adds the pre-commit hook for syntax_tree to lefthook. Didn't
add the normal linter because it seems to have a max file
limit, which we exceed with a combination of *.rb and *.rake.
If the format doesn't match on commit we get this:

```
EXECUTE > syntax_tree
[warn] lib/post_jobs_enqueuer.rb
[warn] lib/tasks/s3.rake
The listed files did not match the expected format.
```
This commit is contained in:
Martin Brennan 2023-01-17 10:16:07 +10:00 committed by GitHub
parent 88b0099639
commit d4e262d5dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,9 @@ pre-commit:
rubocop: rubocop:
glob: "*.rb" glob: "*.rb"
run: bundle exec rubocop --parallel --force-exclusion {staged_files} run: bundle exec rubocop --parallel --force-exclusion {staged_files}
syntax_tree:
glob: "*.{rb,rake}"
run: bundle exec stree check Gemfile {staged_files}
prettier: prettier:
glob: "*.js" glob: "*.js"
include: "app/assets/javascripts|plugins/.+?/assets/javascripts" include: "app/assets/javascripts|plugins/.+?/assets/javascripts"