Skip to content

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

DEV: Add Lefthook command to auto-correct staged files (#27620)

Ted Johanssond8920921515d
diff --git a/lefthook.yml b/lefthook.yml
index d7ba1648551..a81dfcb6efa 100644
--- a/lefthook.yml
+++ b/lefthook.yml
@@ -39,6 +39,20 @@ pre-commit:
glob: "**/{client,server}.en.yml"
run: bundle exec ruby script/i18n_lint.rb {staged_files}
+fix-staged:
+ parallel: false
+ commands:
+ prettier:
+ glob: "*.js"
+ include: "app/assets/javascripts|plugins/.+?/assets/javascripts"
+ run: yarn pprettier --write {staged_files}
+ rubocop:
+ glob: "*.rb"
+ run: bundle exec rubocop --force-exclusion -A {staged_files}
+ syntax_tree:
+ glob: "*.{rb,rake}"
+ run: bundle exec stree write Gemfile {staged_files}
+
lints:
parallel: true
commands: