Skip to content

Commit 2ba3ae3

Browse files
authored
Use Rubocop plugins, use Ruby 3.0 as minimum version everywhere (#85)
Just a bit of cleanup: - use Rubocop's plugin system instead of `require` to silence a warning with recent Rubocop versions - I added version constraints to ensure the various Rubocop gems are all compatible with the new plugin system - use 3.0 as the target Rubocop version instead of 2.7 - run Rubocop with Ruby 3.0 instead of 3.2 in CI - use Ruby 3.0 instead of 3.1 as the oldest version in CI This is consistent with 3.0 being the minimum required version in the gemspec.
2 parents b2a7b90 + f9499f5 commit 2ba3ae3

File tree

5 files changed

+75
-21
lines changed

5 files changed

+75
-21
lines changed

.github/workflows/test.yml

Lines changed: 65 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Ruby
1616
uses: ruby/setup-ruby@v1
1717
with:
18-
ruby-version: 3.2
18+
ruby-version: 3.0
1919
bundler-cache: true
2020
rubygems: latest
2121

@@ -26,13 +26,70 @@ jobs:
2626
name: test (ruby=${{ matrix.ruby }}, grape=${{ matrix.grape }}, grape-swagger=${{ matrix.grape_swagger}}, grape_entity=${{ matrix.grape_entity }})
2727
strategy:
2828
matrix:
29-
grape: [ '~> 2.0.0', 'head' ]
30-
grape_swagger: [ '~> 2.0.3', 'head' ]
31-
grape_entity: [ '~> 1.0.1', 'head' ]
32-
ruby: [ '3.1', '3.4', 'head' ]
33-
# Exclude combinations that are not supported.
34-
exclude:
35-
- { grape_swagger: '~> 2.0.3', grape: 'head' }
29+
include:
30+
# Ruby 3.1 combinations
31+
- ruby: '3.0'
32+
grape: '~> 2.0.0'
33+
grape_swagger: '~> 2.0.3'
34+
grape_entity: '~> 1.0.1'
35+
- ruby: '3.0'
36+
grape: '~> 2.0.0'
37+
grape_swagger: '~> 2.1.1'
38+
grape_entity: 'head'
39+
40+
# Ruby 3.4 combinations
41+
- ruby: '3.4'
42+
grape: '~> 2.0.0'
43+
grape_swagger: '~> 2.0.3'
44+
grape_entity: '~> 1.0.1'
45+
- ruby: '3.4'
46+
grape: '~> 2.0.0'
47+
grape_swagger: '~> 2.0.3'
48+
grape_entity: 'head'
49+
- ruby: '3.4'
50+
grape: '~> 2.0.0'
51+
grape_swagger: 'head'
52+
grape_entity: '~> 1.0.1'
53+
- ruby: '3.4'
54+
grape: '~> 2.0.0'
55+
grape_swagger: 'head'
56+
grape_entity: 'head'
57+
# - ruby: '3.4'
58+
# grape: 'head'
59+
# grape_swagger: 'head'
60+
# grape_entity: '~> 1.0.1'
61+
# - ruby: '3.4'
62+
# grape: 'head'
63+
# grape_swagger: 'head'
64+
# grape_entity: 'head'
65+
66+
# Ruby head combinations
67+
- ruby: 'head'
68+
grape: '~> 2.0.0'
69+
grape_swagger: '~> 2.0.3'
70+
grape_entity: '~> 1.0.1'
71+
- ruby: 'head'
72+
grape: '~> 2.0.0'
73+
grape_swagger: '~> 2.0.3'
74+
grape_entity: 'head'
75+
- ruby: 'head'
76+
grape: '~> 2.0.0'
77+
grape_swagger: 'head'
78+
grape_entity: '~> 1.0.1'
79+
80+
# - ruby: 'head'
81+
# grape: '~> 2.0.0'
82+
# grape_swagger: 'head'
83+
# grape_entity: 'head'
84+
# - ruby: 'head'
85+
# grape: 'head'
86+
# grape_swagger: 'head'
87+
# grape_entity: '~> 1.0.1'
88+
# - ruby: 'head'
89+
# grape: 'head'
90+
# grape_swagger: 'head'
91+
# grape_entity: 'head'
92+
3693
runs-on: ubuntu-latest
3794
env:
3895
GRAPE_VERSION: ${{ matrix.grape }}

.rubocop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ AllCops:
33
Exclude:
44
- vendor/**/*
55
TargetRubyVersion:
6-
2.7
6+
3.0
77

88
inherit_from: .rubocop_todo.yml
99

10-
require:
10+
plugins:
1111
- rubocop-rake
1212
- rubocop-rspec
1313

.rubocop_todo.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2025-05-12 21:32:47 UTC using RuboCop version 1.75.5.
3+
# on 2025-05-28 16:52:10 UTC using RuboCop version 1.75.8.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 1
10-
# Configuration parameters: Severity, Include.
11-
# Include: **/*.gemspec
12-
Gemspec/RequiredRubyVersion:
13-
Exclude:
14-
- 'grape-swagger-entity.gemspec'
15-
169
# Offense count: 3
1710
# Configuration parameters: AllowedMethods.
1811
# AllowedMethods: enums

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#### Features
44

55
* [#81](https://github.com/ruby-grape/grape-swagger-entity/pull/81): Make entity fields required by default - [@olivier-thatch](https://github.com/olivier-thatch).
6+
* [#85](https://github.com/ruby-grape/grape-swagger-entity/pull/85): Use rubocop plugins, use ruby 3.0 as minimum version everywhere - [@olivier-thatch](https://github.com/olivier-thatch).
67
* Your contribution here.
78

89
#### Fixes

Gemfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@ group :development, :test do
3434
gem 'rake'
3535
gem 'rdoc'
3636
gem 'rspec'
37-
gem 'rubocop'
38-
gem 'rubocop-rake'
39-
gem 'rubocop-rspec'
37+
end
38+
39+
group :development do
40+
gem 'rubocop', '>= 1.72', require: false
41+
gem 'rubocop-rake', '>= 0.7', require: false
42+
gem 'rubocop-rspec', '>= 3.5.0', require: false
4043
end
4144

4245
group :test do

0 commit comments

Comments
 (0)