summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/frontend/lint-new-fe-karma-specs.sh15
-rwxr-xr-xscripts/static-analysis3
2 files changed, 17 insertions, 1 deletions
diff --git a/scripts/frontend/lint-new-fe-karma-specs.sh b/scripts/frontend/lint-new-fe-karma-specs.sh
new file mode 100755
index 00000000000..74c860231b8
--- /dev/null
+++ b/scripts/frontend/lint-new-fe-karma-specs.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+git remote -v
+
+NEW_KARMA_SPECS_COUNT=`git diff --name-only origin/master --diff-filter A | grep spec/javascripts | wc -l | tr -d '[:space:]'`
+
+echo "=> Found $NEW_KARMA_SPECS_COUNT new karma spec(s)."
+
+if [ $NEW_KARMA_SPECS_COUNT -gt 0 ]; then
+ echo "✖ ERROR: Please use Jest (spec/frontend) for new specs instead of Karma-Jasmine (spec/javascripts)."
+ exit 1
+fi
+
+echo "✔︎ No new Karma specs found. Thank you!"
+exit 0
diff --git a/scripts/static-analysis b/scripts/static-analysis
index 642c50ec0a8..42e01a91327 100755
--- a/scripts/static-analysis
+++ b/scripts/static-analysis
@@ -33,7 +33,8 @@ tasks = [
%w[yarn run prettier-all],
%w[bundle exec rubocop --parallel],
%w[scripts/lint-conflicts.sh],
- %w[scripts/lint-rugged]
+ %w[scripts/lint-rugged],
+ %w[scripts/frontend/lint-new-fe-karma-specs.sh]
]
static_analysis = Gitlab::Popen::Runner.new