Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-10-20 18:10:58 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-10-20 18:10:58 +0300
commit049d16d168fdee408b78f5f38619c092fd3b2265 (patch)
tree22d1db5ab4fae0967a4da4b1a6b097ef9e5d7aa2 /.gitlab/ci/static-analysis.gitlab-ci.yml
parentbf18f3295b550c564086efd0a32d9a25435ce216 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to '.gitlab/ci/static-analysis.gitlab-ci.yml')
-rw-r--r--.gitlab/ci/static-analysis.gitlab-ci.yml11
1 files changed, 9 insertions, 2 deletions
diff --git a/.gitlab/ci/static-analysis.gitlab-ci.yml b/.gitlab/ci/static-analysis.gitlab-ci.yml
index 59ea665ae07..0a310691cd7 100644
--- a/.gitlab/ci/static-analysis.gitlab-ci.yml
+++ b/.gitlab/ci/static-analysis.gitlab-ci.yml
@@ -122,6 +122,8 @@ rubocop:
needs:
- job: detect-tests
optional: true
+ variables:
+ RUBOCOP_TARGET_FILES: "tmp/rubocop_target_files.txt"
script:
- |
# For non-merge request, or when RUN_ALL_RUBOCOP is 'true', run all RuboCop rules
@@ -132,8 +134,13 @@ rubocop:
unset CI_SLACK_WEBHOOK_URL
run_timed_command "bundle exec rake rubocop:check:graceful"
else
- cat ${RSPEC_CHANGED_FILES_PATH} | ruby -e 'puts $stdin.read.split(" ").select { |f| File.exist?(f) }.join(" ")' > tmp/rubocop_target_files.txt
- run_timed_command "bundle exec rubocop --parallel --force-exclusion $(cat tmp/rubocop_target_files.txt)"
+ cat "${RSPEC_CHANGED_FILES_PATH}" | ruby -e 'print $stdin.read.split(" ").select { |f| File.exist?(f) }.join(" ")' > "$RUBOCOP_TARGET_FILES"
+ # Skip running RuboCop if there's no target files
+ if [ -s "${RUBOCOP_TARGET_FILES}" ]; then
+ run_timed_command "bundle exec rubocop --parallel --force-exclusion $(cat ${RUBOCOP_TARGET_FILES})"
+ else
+ echoinfo "Nothing interesting changed for RuboCop. Skipping."
+ fi
fi
qa:metadata-lint: