Skip to content
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

Upgraded Rubocop to 1.62.1 and Puma to 6.4.2. #59

Merged
merged 7 commits into from
Mar 19, 2024
Merged
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
18 changes: 7 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,22 @@ jobs:
RAILS_ENV: test
DATABASE_URL: postgres://test:[email protected]:5432/grape_on_rails_test
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile.file }}.gemfile
continue-on-error: ${{ matrix.gemfile.experimental }}
strategy:
fail-fast: false
matrix:
ruby:
- "2.7"
- "3.0"
- "3.1"
- "3.2"
gemfile:
- { file: rails_6, experimental: false }
- { file: rails_6_1, experimental: false }
- { file: rails_7, experimental: false }
- { file: rails_edge, experimental: true }
- { ruby: '2.7', file: rails_6 }
- { ruby: '3.0', file: rails_6_1 }
- { ruby: '3.1', file: rails_7 }
- { ruby: '3.2', file: rails_7 }
- { ruby: '3.3', file: rails_7 }
# - { ruby: '3.2' ,file: rails_edge }
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
ruby-version: ${{ matrix.entry.ruby }}
bundler-cache: true
- name: Setup Firefox
uses: browser-actions/setup-firefox@latest
Expand Down
9 changes: 8 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@ AllCops:
Exclude:
- vendor/**/*
- bin/**/*
NewCops: enable

Style/Documentation:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

Metrics/LineLength:
Layout/LineLength:
Enabled: false

require:
- rubocop-capybara
- rubocop-rails
- rubocop-rake
- rubocop-rspec

inherit_from: .rubocop_todo.yml
73 changes: 62 additions & 11 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,72 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2019-07-06 10:22:55 -0400 using RuboCop version 0.72.0.
# on 2024-03-19 16:06:55 UTC using RuboCop version 1.62.1.
# 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: 2
# Configuration parameters: CountComments, ExcludedMethods.
# ExcludedMethods: refine
Metrics/BlockLength:
Max: 33
# Offense count: 1
# Configuration parameters: AllowComments, AllowEmptyLambdas.
Lint/EmptyBlock:
Exclude:
- 'spec/helpers/welcome_helper_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
# SupportedStyles: slashes, percent_r, mixed
Style/RegexpLiteral:
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/EmptyExampleGroup:
Exclude:
- 'spec/helpers/welcome_helper_spec.rb'

# Offense count: 4
# Configuration parameters: CountAsOne.
RSpec/ExampleLength:
Max: 13

# Offense count: 5
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
# Include: **/*_spec*rb*, **/spec/**/*
RSpec/FilePath:
Exclude:
- 'spec/api/headers_spec.rb'
- 'spec/api/ping_spec.rb'
- 'spec/api/post_spec.rb'
- 'spec/api/protected_spec.rb'
- 'spec/api/raise_spec.rb'

# Offense count: 4
RSpec/MultipleExpectations:
Max: 2

# Offense count: 4
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: ResponseMethods.
# ResponseMethods: response, last_response
RSpec/Rails/HaveHttpStatus:
Exclude:
- 'spec/api/post_spec.rb'
- 'spec/api/protected_spec.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Inferences.
RSpec/Rails/InferredSpecType:
Exclude:
- 'spec/features/homepage_spec.rb'
- 'spec/features/swagger_spec.rb'

# Offense count: 2
RSpec/RepeatedExample:
Exclude:
- 'spec/api/headers_spec.rb'

# Offense count: 5
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
# Include: **/*_spec.rb
RSpec/SpecFilePathFormat:
Exclude:
- 'spec/spec_helper.rb'
- 'spec/api/headers_spec.rb'
- 'spec/api/ping_spec.rb'
- 'spec/api/post_spec.rb'
- 'spec/api/protected_spec.rb'
- 'spec/api/raise_spec.rb'
6 changes: 5 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ group :test do
gem 'capybara'
gem 'rspec'
gem 'rspec-rails'
gem 'rubocop'
gem 'rubocop', '1.62.1'
gem 'rubocop-capybara'
gem 'rubocop-rails'
gem 'rubocop-rake'
gem 'rubocop-rspec'
gem 'selenium-webdriver'
gem 'webdrivers'
end
49 changes: 37 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ GEM
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
json (2.7.1)
language_server-protocol (3.17.0.3)
loofah (2.19.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
Expand Down Expand Up @@ -165,9 +167,10 @@ GEM
racc (~> 1.4)
nokogiri (1.14.3-x86_64-linux)
racc (~> 1.4)
parallel (1.22.1)
parser (3.1.2.0)
parallel (1.24.0)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
pg (1.3.5)
public_suffix (4.0.7)
puma (5.6.7)
Expand Down Expand Up @@ -231,18 +234,35 @@ GEM
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.11.0)
rubocop (1.30.1)
rubocop (1.62.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.1.0.0)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.18.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.18.0)
parser (>= 3.1.1.0)
ruby-progressbar (1.11.0)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.2)
parser (>= 3.3.0.4)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-rails (2.24.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (2.27.1)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
selenium-webdriver (4.2.1)
Expand All @@ -267,7 +287,7 @@ GEM
railties (>= 6.0.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.1.0)
unicode-display_width (2.5.0)
web-console (4.2.0)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
Expand All @@ -287,6 +307,7 @@ GEM

PLATFORMS
arm64-darwin-21
x86_64-darwin-19
x86_64-darwin-20
x86_64-linux

Expand All @@ -304,7 +325,11 @@ DEPENDENCIES
rails (~> 7.0.4)
rspec
rspec-rails
rubocop
rubocop (= 1.62.1)
rubocop-capybara
rubocop-rails
rubocop-rake
rubocop-rspec
selenium-webdriver
sprockets-rails
stimulus-rails
Expand All @@ -314,4 +339,4 @@ DEPENDENCIES
webdrivers

BUNDLED WITH
2.3.16
2.3.26
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
config.active_support.report_deprecations = false

# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
config.log_formatter = Logger::Formatter.new

# Use a different logger for distributed setups.
# require "syslog/logger"
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Rails.application.routes.draw do
get 'welcome/index'
mount API => '/'
root 'welcome#index'
mount API => '/'
end
8 changes: 6 additions & 2 deletions gemfiles/rails_6.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gem 'grape-swagger'
gem 'importmap-rails'
gem 'jbuilder'
gem 'pg', '~> 1.1'
gem 'puma', '~> 5.0'
gem 'puma', '~> 5.6'
gem 'rails', '~> 6.0'
gem 'sprockets-rails'
gem 'stimulus-rails'
Expand All @@ -28,7 +28,11 @@ group :test do
gem 'capybara'
gem 'rspec'
gem 'rspec-rails'
gem 'rubocop'
gem 'rubocop', '1.62.1'
gem 'rubocop-capybara'
gem 'rubocop-rails'
gem 'rubocop-rake'
gem 'rubocop-rspec'
gem 'selenium-webdriver'
gem 'webdrivers'
end
8 changes: 6 additions & 2 deletions gemfiles/rails_6_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gem 'grape-swagger'
gem 'importmap-rails'
gem 'jbuilder'
gem 'pg', '~> 1.1'
gem 'puma', '~> 5.0'
gem 'puma', '~> 5.6'
gem 'rails', '~> 6.1'
gem 'sprockets-rails'
gem 'stimulus-rails'
Expand All @@ -28,7 +28,11 @@ group :test do
gem 'capybara'
gem 'rspec'
gem 'rspec-rails'
gem 'rubocop'
gem 'rubocop', '1.62.1'
gem 'rubocop-capybara'
gem 'rubocop-rails'
gem 'rubocop-rake'
gem 'rubocop-rspec'
gem 'selenium-webdriver'
gem 'webdrivers'
end
8 changes: 6 additions & 2 deletions gemfiles/rails_7.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gem 'grape-swagger'
gem 'importmap-rails'
gem 'jbuilder'
gem 'pg', '~> 1.1'
gem 'puma', '~> 5.0'
gem 'puma', '~> 6.4.2'
gem 'rails', '~> 7.0'
gem 'sprockets-rails'
gem 'stimulus-rails'
Expand All @@ -28,7 +28,11 @@ group :test do
gem 'capybara'
gem 'rspec'
gem 'rspec-rails'
gem 'rubocop'
gem 'rubocop', '1.62.1'
gem 'rubocop-capybara'
gem 'rubocop-rails'
gem 'rubocop-rake'
gem 'rubocop-rspec'
gem 'selenium-webdriver'
gem 'webdrivers'
end
8 changes: 6 additions & 2 deletions gemfiles/rails_edge.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gem 'grape-swagger'
gem 'importmap-rails'
gem 'jbuilder'
gem 'pg', '~> 1.1'
gem 'puma', '~> 5.0'
gem 'puma', '~> 6.4.2'
gem 'rails', git: 'https://github.com/rails/rails.git'
gem 'sprockets-rails'
gem 'stimulus-rails'
Expand All @@ -28,7 +28,11 @@ group :test do
gem 'capybara'
gem 'rspec'
gem 'rspec-rails'
gem 'rubocop'
gem 'rubocop', '1.62.1'
gem 'rubocop-capybara'
gem 'rubocop-rails'
gem 'rubocop-rake'
gem 'rubocop-rspec'
gem 'selenium-webdriver'
gem 'webdrivers'
end
10 changes: 4 additions & 6 deletions spec/api/headers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
describe Acme::Headers do
it 'returns all headers' do
get '/api/headers'
expect(JSON.parse(response.body)).to eq(
expect(JSON.parse(response.body)).to include(
'Accept' => 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5',
'Cookie' => '',
'Host' => 'www.example.com',
'Version' => 'HTTP/1.0'
'Host' => 'www.example.com'
)
end

Expand All @@ -27,13 +26,12 @@
'Something' => 1,
'SOMETHING_ELSE' => 1
}
expect(JSON.parse(response.body)).to eq(
expect(JSON.parse(response.body)).to include(
'Accept' => 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5',
'Cookie' => '',
'Host' => 'www.example.com',
'Reticulated-Spline' => 42,
'Something' => 1,
'Version' => 'HTTP/1.0'
'Something' => 1
)
end
end
1 change: 1 addition & 0 deletions spec/api/ping_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
get '/api/ping'
expect(response.body).to eq({ ping: 'pong' }.to_json)
end

it 'ping with a parameter' do
get '/api/ping?pong=test'
expect(response.body).to eq({ ping: 'test' }.to_json)
Expand Down
Loading
Loading