lefthook.yml in gitlab-styles-9.2.0 vs lefthook.yml in gitlab-styles-10.0.0

- old
+ new

@@ -8,9 +8,17 @@ rubocop: files: git diff --name-only --diff-filter=d $(git merge-base origin/master HEAD)..HEAD glob: '*.{rb,rake}' run: bundle exec rubocop --parallel --force-exclusion {files} - # Run all tests (warn if there are any missing tools required for tests). + # Run only relevant specs. rspec: - run: bundle exec rspec -f progress - glob: '*.rb' + files: git diff --name-only --diff-filter=d $(git merge-base origin/master HEAD)..HEAD + run: | + tests=$(tff --mapping-file .tests_mapping.yml {files}) + if [ "$tests" != "" ]; then + echo "bundle exec rspec --format progress $tests" + bundle exec rspec --format progress $tests + else + echo "No specs to run." + exit 0 + fi