diff --git a/.gitignore b/.gitignore index b04a8c8..32a5b90 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ # rspec failure tracking .rspec_status + +.rubocop-* diff --git a/.rubocop.yml b/.rubocop.yml index e3462a7..3ae2458 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,13 +1,18 @@ -AllCops: - TargetRubyVersion: 2.6 - -Style/StringLiterals: - Enabled: true - EnforcedStyle: double_quotes +inherit_from: + - https://raw.githubusercontent.com/cookpad/guides/master/.rubocop.yml -Style/StringLiteralsInInterpolation: - Enabled: true - EnforcedStyle: double_quotes +AllCops: + TargetRubyVersion: 3.0 + NewCops: enable + Exclude: + - vendor/**/* + - vendor/**/.* -Layout/LineLength: - Max: 120 +Style/TrailingCommaInHashLiteral: + EnforcedStyleForMultiline: comma +Style/TrailingCommaInArguments: + EnforcedStyleForMultiline: comma +RSpec/DescribedClass: + Enabled: false +Gemspec/DevelopmentDependencies: + Enabled: false diff --git a/Gemfile b/Gemfile index fde5caf..8f80798 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,8 @@ source "https://rubygems.org" gemspec gem "rake", "~> 13.0" - gem "rspec", "~> 3.0" - gem "rubocop", "~> 1.21" +gem "rubocop-performance" +gem "rubocop-rails" +gem "rubocop-rspec" diff --git a/Gemfile.lock b/Gemfile.lock index e47fb11..eef14c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,15 +6,35 @@ PATH GEM remote: https://rubygems.org/ specs: + activesupport (7.1.3.3) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + mutex_m + tzinfo (~> 2.0) ast (2.4.2) + base64 (0.2.0) + bigdecimal (3.1.8) + concurrent-ruby (1.3.1) + connection_pool (2.4.1) diff-lcs (1.5.1) + drb (2.2.1) + i18n (1.14.5) + concurrent-ruby (~> 1.0) json (2.7.2) language_server-protocol (3.17.0.3) + minitest (5.23.1) + mutex_m (0.2.0) parallel (1.24.0) parser (3.3.1.0) ast (~> 2.4.1) racc racc (1.7.3) + rack (3.0.11) rainbow (3.1.1) rake (13.2.1) regexp_parser (2.9.0) @@ -46,8 +66,29 @@ GEM unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.31.3) parser (>= 3.3.1.0) + rubocop-capybara (2.20.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.25.1) + rubocop (~> 1.41) + rubocop-performance (1.21.0) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.25.0) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rspec (2.29.2) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + rubocop-rspec_rails (~> 2.28) + rubocop-rspec_rails (2.28.3) + rubocop (~> 1.40) ruby-progressbar (1.13.0) strscan (3.1.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) PLATFORMS @@ -59,6 +100,9 @@ DEPENDENCIES rake (~> 13.0) rspec (~> 3.0) rubocop (~> 1.21) + rubocop-performance + rubocop-rails + rubocop-rspec BUNDLED WITH 2.5.7 diff --git a/Rakefile b/Rakefile index cca7175..9a7fd8d 100644 --- a/Rakefile +++ b/Rakefile @@ -9,4 +9,4 @@ require "rubocop/rake_task" RuboCop::RakeTask.new -task default: %i[spec rubocop] +task default: %i(spec rubocop) diff --git a/millrace.gemspec b/millrace.gemspec index 7b2361e..de3f05c 100644 --- a/millrace.gemspec +++ b/millrace.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |spec| spec.description = "Leaky bucket rate limiting for Action Controller before filters" spec.homepage = "https://github.com/errm/millrace" spec.license = "MIT" - spec.required_ruby_version = ">= 2.6.0" + spec.required_ruby_version = ">= 3.0.0" spec.metadata["allowed_push_host"] = "https://rubygems.org" @@ -25,7 +25,7 @@ Gem::Specification.new do |spec| spec.files = Dir.chdir(__dir__) do `git ls-files -z`.split("\x0").reject do |f| (File.expand_path(f) == __FILE__) || - f.start_with?(*%w[bin/ test/ spec/ features/ .git .github Gemfile]) + f.start_with?(*%w(bin/ test/ spec/ features/ .git .github Gemfile)) end end spec.bindir = "exe" @@ -37,4 +37,5 @@ Gem::Specification.new do |spec| # For more information and examples about making a new gem, check out our # guide at: https://bundler.io/guides/creating_gem.html + spec.metadata["rubygems_mfa_required"] = "true" end