Skip to content

Use Rubocop plugins, use Ruby 3.0 as minimum version everywhere #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
ruby-version: 3.0
bundler-cache: true
rubygems: latest

Expand All @@ -29,7 +29,7 @@ jobs:
grape: [ '~> 2.0.0', 'head' ]
grape_swagger: [ '~> 2.0.3', 'head' ]
grape_entity: [ '~> 1.0.1', 'head' ]
ruby: [ '3.1', '3.4', 'head' ]
ruby: [ '3.0', '3.4', 'head' ]
# Exclude combinations that are not supported.
exclude:
- { grape_swagger: '~> 2.0.3', grape: 'head' }
Comment on lines 29 to 35
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's unwrap this! For example:

        include:
          # Ruby 3.1 combinations
          - ruby: '3.0'
            grape: '~> 2.0.0'
            grape_swagger: '~> 2.0.3'
            grape_entity: '~> 1.0.1'
          - ruby: '3.0'
            grape: '~> 2.0.0'
            grape_swagger: '~> 2.1.1'
            grape_entity: 'head'

          # Ruby 3.4 combinations
          - ruby: '3.4'
            grape: '~> 2.0.0'
            grape_swagger: '~> 2.0.3'
            grape_entity: '~> 1.0.1'
          - ruby: '3.4'
            grape: '~> 2.0.0'
            grape_swagger: '~> 2.0.3'
            grape_entity: 'head'
          - ruby: '3.4'
            grape: '~> 2.0.0'
            grape_swagger: 'head'
            grape_entity: '~> 1.0.1'
          - ruby: '3.4'
            grape: '~> 2.0.0'
            grape_swagger: 'head'
            grape_entity: 'head'
          - ruby: '3.4'
            grape: 'head'
            grape_swagger: 'head'
            grape_entity: '~> 1.0.1'
          - ruby: '3.4'
            grape: 'head'
            grape_swagger: 'head'
            grape_entity: 'head'

          # Ruby head combinations
          - ruby: 'head'
            grape: '~> 2.0.0'
            grape_swagger: '~> 2.0.3'
            grape_entity: '~> 1.0.1'
          - ruby: 'head'
            grape: '~> 2.0.0'
            grape_swagger: '~> 2.0.3'
            grape_entity: 'head'
          - ruby: 'head'
            grape: '~> 2.0.0'
            grape_swagger: 'head'
            grape_entity: '~> 1.0.1'
          - ruby: 'head'
            grape: '~> 2.0.0'
            grape_swagger: 'head'
            grape_entity: 'head'
          - ruby: 'head'
            grape: 'head'
            grape_swagger: 'head'
            grape_entity: '~> 1.0.1'
          - ruby: 'head'
            grape: 'head'
            grape_swagger: 'head'
            grape_entity: 'head'

This will allow us to skip, for example, (ruby=3.0, grape=head, grape-swagger=head, grape_entity=head) combination where grape-swagger-2.1.2 requires ruby version >= 3.1.

Expand Down
4 changes: 2 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ AllCops:
Exclude:
- vendor/**/*
TargetRubyVersion:
2.7
3.0

inherit_from: .rubocop_todo.yml

require:
plugins:
- rubocop-rake
- rubocop-rspec

Expand Down
17 changes: 5 additions & 12 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-09-09 22:35:29 UTC using RuboCop version 1.66.1.
# on 2025-05-28 16:52:10 UTC using RuboCop version 1.75.8.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
# Configuration parameters: Severity, Include.
# Include: **/*.gemspec
Gemspec/RequiredRubyVersion:
Exclude:
- 'grape-swagger-entity.gemspec'

# Offense count: 3
# Configuration parameters: AllowedMethods.
# AllowedMethods: enums
Expand Down Expand Up @@ -64,7 +57,7 @@ Metrics/PerceivedComplexity:
# Offense count: 5
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
# SupportedStyles: snake_case, normalcase, non_integer
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
# AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
Naming/VariableNumber:
Exclude:
- 'spec/grape-swagger/entities/response_model_spec.rb'
Expand Down Expand Up @@ -102,7 +95,7 @@ RSpec/DescribeClass:
RSpec/ExampleLength:
Max: 187

# Offense count: 24
# Offense count: 26
RSpec/LeakyConstantDeclaration:
Exclude:
- 'spec/grape-swagger/entities/response_model_spec.rb'
Expand All @@ -118,14 +111,14 @@ RSpec/MultipleDescribes:
RSpec/MultipleExpectations:
Max: 11

# Offense count: 20
# Offense count: 21
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
# SupportedStyles: always, named_only
RSpec/NamedSubject:
Exclude:
- 'spec/grape-swagger/entities/response_model_spec.rb'

# Offense count: 39
# Offense count: 46
# Configuration parameters: AllowedGroups.
RSpec/NestedGroups:
Max: 5
Expand Down
9 changes: 6 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ group :development, :test do
gem 'rake'
gem 'rdoc'
gem 'rspec'
gem 'rubocop'
gem 'rubocop-rake'
gem 'rubocop-rspec'
end

group :development do
gem 'rubocop', '>= 1.72', require: false
gem 'rubocop-rake', '>= 0.7', require: false
gem 'rubocop-rspec', '>= 3.5.0', require: false
end

group :test do
Expand Down
Loading