Browse Source

Maintenance: Improve overcommit to run multiple custom commands.

Martin Gruner 2 years ago
parent
commit
8454dd58c1
3 changed files with 12 additions and 4 deletions
  1. 8 0
      .overcommit.sh
  2. 3 3
      .overcommit.yml
  3. 1 1
      script/build/cleanup.sh

+ 8 - 0
.overcommit.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+set -eux
+
+echo "Checking .pot catalog consistency..."
+rails generate translation_catalog --check
+
+.gitlab/check_graphql_api_consistency.sh

+ 3 - 3
.overcommit.yml

@@ -26,9 +26,9 @@ PreCommit:
     exclude: 'public/assets/chat/**/*'
   CustomScript:
     enabled: true
-    description: 'Check if translation catalog is up-to-date'
-    required_executable: 'rails'
-    flags: ['generate', 'translation_catalog', '--check']
+    description: 'Perform custom Zammad code checks'
+    required_executable: 'bash'
+    flags: ['.overcommit.sh']
   Stylelint:
     enabled: true
   EsLint:

+ 1 - 1
script/build/cleanup.sh

@@ -26,7 +26,7 @@ rm -rf .rubocop
 rm .stylelintrc.json .eslintignore .eslintrc .eslintrc.js .prettierrc.json
 rm coffeelint.json
 rm -rf .coffeelint
-rm .overcommit.yml
+rm .overcommit.*
 
 # misc
 rm .codeclimate.yml