Skip to content

Commit f56d998

Browse files
authored
Merge pull request #391 from Shopify/fix-config-check-for-minimum-rubocop-version
Skip config tests on minimum Rubocop version
2 parents f5122f5 + 7175204 commit f56d998

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.github/workflows/ruby.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ jobs:
2828
run: bundle info rubocop | head -1
2929
- name: RuboCop and Tests
3030
run: bundle exec rake
31+
env:
32+
CHECKING_RUBOCOP_VERSION_COMPATIBILITY: ${{ matrix.gemfile == 'gemfiles/minimum_rubocop.gemfile' }}

test/config_test.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
class ConfigTest < Minitest::Test
99
def test_config_is_unchanged
10+
skip if checking_rubocop_version_compatibility?
11+
1012
Rake.application.load_rakefile
1113

1214
original_config = "test/fixtures/full_config.yml"
@@ -32,6 +34,8 @@ def test_config_is_unchanged
3234
end
3335

3436
def test_config_has_no_redundant_entries
37+
skip if checking_rubocop_version_compatibility?
38+
3539
config = RuboCop::ConfigLoader.load_file("rubocop.yml")
3640
default_config = RuboCop::ConfigLoader.default_configuration
3741
redundant_config = Hash.new { |hash, key| hash[key] = {} }
@@ -57,4 +61,10 @@ def test_config_has_no_redundant_entries
5761

5862
assert(redundant_config.empty?, error_message)
5963
end
64+
65+
private
66+
67+
def checking_rubocop_version_compatibility?
68+
ENV.fetch("CHECKING_RUBOCOP_VERSION_COMPATIBILITY", "") == "true"
69+
end
6070
end

0 commit comments

Comments
 (0)