Skip to content

Commit

Permalink
Merge pull request #26 from RadiusNetworks/cupakromer-rubocop-updates…
Browse files Browse the repository at this point in the history
…-part-2

More Rubocop configuration updates
  • Loading branch information
cupakromer authored Aug 26, 2021
2 parents 095f9d0 + bac5d17 commit d87d90a
Show file tree
Hide file tree
Showing 16 changed files with 884 additions and 85 deletions.
12 changes: 6 additions & 6 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ inherit_mode:

inherit_from: common_rubocop_rails.yml

# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Layout/LineLength:
Exclude:
- 'radius-spec.gemspec'

# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
Exclude:
- 'benchmarks/**/*'
- 'lib/radius/spec/rspec.rb'

# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Exclude:
- 'radius-spec.gemspec'

Style/Documentation:
Exclude:
- 'benchmarks/**/*'
22 changes: 17 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@

### Enhancements

- TODO
- Upgrade to Rubocop 0.82.x (Aaron Hill, Aaron Kromer, Ben Reynolds, Chris
Hoffman, James Nebeker, JC Avena #26)
- Upgrade to Rubocop Rails 2.5.x (Aaron Hill, Aaron Kromer, Ben Reynolds, Chris
Hoffman, James Nebeker, JC Avena #26)
- Adjust common Rubocop configuration (Aaron Hill, Aaron Kromer, Ben Reynolds,
Chris Hoffman, James Nebeker, JC Avena #26)
- Rename metrics/configuration parameters per version upgrade requirements
- Use the stricter `always_true` check for `Style/FrozenStringLiteralComment`
- Opt-in to new cops/checks behaving per their default settings
- Adjust common Rubocop Rails configuration (Aaron Hill, Aaron Kromer, Ben
Reynolds, Chris Hoffman, James Nebeker, JC Avena #26)
- Disable `Rails/IndexBy` by default
- Disable `Rails/IndexWith` by default

### Bug Fixes

Expand All @@ -17,19 +29,19 @@

### Enhancements

- Upgrade to Rubocop 0.73.x (Aaron Hill, Aaron Kromer, Ben Reynold, Chris
- Upgrade to Rubocop 0.73.x (Aaron Hill, Aaron Kromer, Ben Reynolds, Chris
Hoffman, James Nebeker #24)
- Upgrade to Rubocop Rails 2.2.x (Aaron Hill, Aaron Kromer, Ben Reynold, Chris
- Upgrade to Rubocop Rails 2.2.x (Aaron Hill, Aaron Kromer, Ben Reynolds, Chris
Hoffman, James Nebeker #24)
- Adjust common Rubocop configuration (Aaron Hill, Aaron Kromer, Ben Reynold,
- Adjust common Rubocop configuration (Aaron Hill, Aaron Kromer, Ben Reynolds,
Chris Hoffman, James Nebeker #24)
- Target Ruby 2.7 by default
- Enable `Lint/HeredocMethodCallPosition` by default
- Use `StandardError` for the suggested parent classes of errors
- Bump metric check maximums to provide a little more wiggle room
- Disable `Naming/RescuedExceptionsVariableName` by default
- Adjust common Rubocop Rails configuration (Aaron Hill, Aaron Kromer, Ben
Reynold, Chris Hoffman, James Nebeker #24)
Reynolds, Chris Hoffman, James Nebeker #24)
- Disable `Rails/IgnoredSkipActionFilterOption` by default

### Bug Fixes
Expand Down
4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ gemspec
group :benchmark, optional: true do
gem 'activesupport', require: false
gem 'benchmark-ips', require: false
# TODO: See if this gem has an update in the future as it's gemspec is too
# strict and it was blocking other gems from installing / updating
gem 'kalibera', require: false, git: 'https://github.com/cupakromer/libkalibera.git'
gem 'kalibera', require: false
end

group :debug do
Expand Down
2 changes: 0 additions & 2 deletions benchmarks/call_vs_yield.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

display_benchmark_header

# rubocop:disable Performance/RedundantBlockCall
def block_call(&block)
block.call
end
Expand Down Expand Up @@ -77,7 +76,6 @@ def pass_through(&block)
end
end
end
# rubocop:enable Performance/RedundantBlockCall

__END__

Expand Down
4 changes: 2 additions & 2 deletions benchmarks/cover_vs_include.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

display_benchmark_header

INT_RANGE = (0..15)
INT_RANGE = (0..15).freeze
INT_VAR = 10

section "Integer ranges" do |bench|
Expand All @@ -30,7 +30,7 @@
END_OF_JULY = Time.utc(2015, 7, 31)
DAY_IN_JULY = Time.utc(2015, 7, 15)

TIME_RANGE = (BEGIN_OF_JULY..END_OF_JULY)
TIME_RANGE = (BEGIN_OF_JULY..END_OF_JULY).freeze

section "Time ranges" do |bench|
bench.report('range#cover?') do
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/format_string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
# rubocop:disable Style/FormatString
section "Format String" do |bench|
bench.report("String#%") do
'%10s' % 'hoge'
'%10s' % 'hoge' # rubocop:disable Style/FormatStringToken
end

bench.report("format") do
format '%10s', 'hoge'
format '%10s', 'hoge' # rubocop:disable Style/FormatStringToken
end

bench.report("sprintf") do
sprintf '%10s', 'hoge'
sprintf '%10s', 'hoge' # rubocop:disable Style/FormatStringToken
end
end
# rubocop:enable Style/FormatString
Expand Down
Loading

0 comments on commit d87d90a

Please sign in to comment.