Skip to content

Commit

Permalink
Dinamically select the right Rubocop version for each Ruby version (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
srbarrios authored Oct 9, 2024
1 parent 2928bd0 commit dd3ec12
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions jenkins_pipelines/manager_prs/tests_files/rubocop.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#! /bin/bash

echo "running rubocop on step files"
rubocop.ruby2.5 -v
cd testsuite
rubocop.ruby2.5 features/*
rubocop_file="testsuite/.rubocop.yml"
if [[ -f "$rubocop_file" ]]; then
# Extract the Ruby version from the file
ruby_version=$(grep "TargetRubyVersion:" "$rubocop_file" | awk '{print $2}')
if [[ -n "$ruby_version" ]]; then
rubocop.ruby"$ruby_version" -v
cd testsuite
rubocop.ruby"$ruby_version" features/*
else
echo "No TargetRubyVersion found in $rubocop_file."
fi
else
echo "File $rubocop_file does not exist."
fi

0 comments on commit dd3ec12

Please sign in to comment.