Skip to content

A platform for community discussion. Free, open, simple.

FIX: Add syntax_tree to `lints` and `fix-all` lefthook hooks (#37258)

Alan Guo Xiang Tan4ada9dd73957
diff --git a/bin/lint b/bin/lint
index d028e0976bd..58790e8e3c9 100755
--- a/bin/lint
+++ b/bin/lint
@@ -184,7 +184,7 @@ class LefthookLinter
cmd << "--verbose" if @verbose
puts "Running: #{cmd.shelljoin}" if @verbose
- exit 1 unless system(*cmd)
+ exit 1 unless system({ "LEFTHOOK" => "1" }, *cmd)
end
def lefthook_config
diff --git a/lefthook.yml b/lefthook.yml
index ab2b53d7df2..6e6239a11d7 100644
--- a/lefthook.yml
+++ b/lefthook.yml
@@ -127,6 +127,15 @@ fix-all:
run: pnpm lint:css:fix
rubocop:
run: bundle exec rubocop --force-exclusion -A
+ syntax_tree:
+ exclude:
+ - "bin/notify_file_change"
+ - "bin/docker/**/*"
+ glob:
+ - "**/*.{rb,rake,thor}"
+ - "bin/**/*"
+ - "Gemfile"
+ run: bundle exec stree write Gemfile {all_files}
lints:
parallel: true
@@ -137,6 +146,15 @@ lints:
- "bin/**/*"
- "Gemfile"
run: bundle exec rubocop
+ syntax_tree:
+ exclude:
+ - "bin/notify_file_change"
+ - "bin/docker/**/*"
+ glob:
+ - "**/*.{rb,rake,thor}"
+ - "bin/**/*"
+ - "Gemfile"
+ run: bundle exec stree check Gemfile {all_files}
prettier:
run: pnpm lint:prettier
eslint: