diff --git a/Gemfile.lock b/Gemfile.lock index 2416ce66..9cea5679 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,34 +2,35 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.2) - parallel (1.20.1) - parser (3.0.1.0) + json (2.6.2) + parallel (1.22.1) + parser (3.1.2.1) ast (~> 2.4.1) - rainbow (3.0.0) - regexp_parser (2.1.1) + rainbow (3.1.1) + regexp_parser (2.6.0) rexml (3.2.5) - rubocop (1.12.1) + rubocop (1.36.0) + json (~> 2.3) parallel (~> 1.10) - parser (>= 3.0.0.0) + parser (>= 3.1.2.1) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.2.0, < 2.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.20.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.4.1) - parser (>= 2.7.1.5) - rubocop-discourse (2.4.1) + rubocop-ast (1.22.0) + parser (>= 3.1.1.0) + rubocop-discourse (3.0) rubocop (>= 1.1.0) rubocop-rspec (>= 2.0.0) - rubocop-rspec (2.2.0) - rubocop (~> 1.0) - rubocop-ast (>= 1.1.0) + rubocop-rspec (2.13.2) + rubocop (~> 1.33) ruby-progressbar (1.11.0) - unicode-display_width (2.0.0) + unicode-display_width (2.3.0) PLATFORMS - ruby + arm64-darwin-21 DEPENDENCIES rubocop-discourse diff --git a/lefthook.yml b/lefthook.yml new file mode 100644 index 00000000..995d1f2a --- /dev/null +++ b/lefthook.yml @@ -0,0 +1,41 @@ +skip_output: + - meta + - success + +pre-commit: + parallel: true + commands: + rubocop: + glob: "*.rb" + run: bundle exec rubocop --parallel --force-exclusion {staged_files} + prettier: + glob: "*.js" + include: "app/assets/javascripts|plugins/.+?/assets/javascripts" + run: yarn prettier --list-different {staged_files} + prettier-scss: + glob: "*.scss" + include: "app/assets/stylesheets|plugins/.+?/assets/stylesheets" + run: yarn prettier --list-different {staged_files} + eslint: + glob: "*.js" + include: "app/assets/javascripts|plugins/.+?/assets/javascripts" + run: yarn eslint -f compact --quiet {staged_files} + i18n-lint: + glob: "**/{client,server}.en.yml" + run: bundle exec ruby script/i18n_lint.rb {staged_files} + +lints: + parallel: true + commands: + rubocop: + glob: "*.rb" + run: bundle exec rubocop --parallel + prettier: + run: yarn prettier --list-different **/*.js + prettier-scss: + run: yarn prettier --list-different **/*.scss + eslint: + run: yarn eslint -f compact --quiet --ext .js . + i18n-lint: + glob: "**/{client,server}.en.yml" + run: bundle exec ruby script/i18n_lint.rb {all_files}