Skip to content

Commit

Permalink
Regenerate rubocop todo; more auto correct; fix rubocop version to 2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
mullermp committed Jun 13, 2024
1 parent da5f1d1 commit f10eeec
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea/
Gemfile.lock
15 changes: 15 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
inherit_from: .rubocop_todo.yml

AllCops:
NewCops: enable
SuggestExtensions: false
TargetRubyVersion: 2.5
Exclude:
- 'vendor/bundle/**/*' # see https://github.com/rubocop/rubocop/issues/9832

Gemspec/RequireMFA:
Enabled: false

Metrics/BlockLength:
Exclude:
- 'spec/**/*.rb'
115 changes: 115 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-06-13 02:18:15 UTC using RuboCop version 1.28.0.
# 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: AllowedMethods.
# AllowedMethods: enums
Lint/ConstantDefinitionInBlock:
Exclude:
- 'spec/emitter_spec.rb'

# Offense count: 3
# Configuration parameters: AllowComments, AllowEmptyLambdas.
Lint/EmptyBlock:
Exclude:
- 'spec/client_spec.rb'
- 'spec/emitter_spec.rb'
- 'spec/server_spec.rb'

# Offense count: 3
# Configuration parameters: AllowComments, AllowNil.
Lint/SuppressedException:
Exclude:
- 'Rakefile'

# Offense count: 26
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 172

# Offense count: 7
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
# IgnoredMethods: refine
Metrics/BlockLength:
Max: 82

# Offense count: 19
# Configuration parameters: CountBlocks.
Metrics/BlockNesting:
Max: 6

# Offense count: 6
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 516

# Offense count: 14
# Configuration parameters: IgnoredMethods.
Metrics/CyclomaticComplexity:
Max: 60

# Offense count: 32
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
Metrics/MethodLength:
Max: 132

# Offense count: 1
# Configuration parameters: CountComments, CountAsOne.
Metrics/ModuleLength:
Max: 113

# Offense count: 1
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
Metrics/ParameterLists:
Max: 7

# Offense count: 12
# Configuration parameters: IgnoredMethods.
Metrics/PerceivedComplexity:
Max: 48

# Offense count: 6
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
Naming/MethodParameterName:
Exclude:
- 'lib/http/2/connection.rb'
- 'lib/http/2/extensions.rb'
- 'lib/http/2/header/compressor.rb'
- 'lib/http/2/header/decompressor.rb'

# Offense count: 1
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
# SupportedStyles: snake_case, normalcase, non_integer
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
Naming/VariableNumber:
Exclude:
- 'example/server.rb'

# Offense count: 10
# Configuration parameters: AllowedConstants.
Style/Documentation:
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'example/helper.rb'
- 'example/upgrade_server.rb'
- 'lib/http/2/base64.rb'
- 'lib/http/2/error.rb'
- 'lib/http/2/extensions.rb'
- 'lib/http/2/flow_buffer.rb'
- 'lib/http/2/header/decompressor.rb'
- 'lib/http/2/header/encoding_context.rb'
- 'lib/tasks/generate_huffman_table.rb'

# Offense count: 1
# Configuration parameters: AllowedMethods.
# AllowedMethods: respond_to_missing?
Style/OptionalBooleanParameter:
Exclude:
- 'lib/http/2/flow_buffer.rb'
17 changes: 8 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ gem 'yard'

gem 'pry'
gem 'pry-byebug', platform: :mri
gem 'rspec', '~> 3.4.0'
gem 'rspec'

if RUBY_VERSION >= '3.0'
gem 'rubocop'
gem 'rubocop-performance'
platform :mri do
gem 'rbs'
gem 'steep'
gem 'typeprof'
end
gem 'rubocop', '1.28'
gem 'rubocop-performance'

platform :mri do
gem 'rbs'
gem 'steep'
gem 'typeprof'
end

# gem "memory_profiler"
Expand Down
2 changes: 0 additions & 2 deletions lib/http/2/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ module HTTP2
# Note that this class should not be used directly. Instead, you want to
# use either Client or Server class to drive the HTTP 2.0 exchange.
#
# rubocop:disable Metrics/ClassLength
class Connection
include FlowBuffer
include Emitter
Expand Down Expand Up @@ -795,5 +794,4 @@ def manage_state(_)
yield
end
end
# rubocop:enable Metrics/ClassLength
end
2 changes: 1 addition & 1 deletion lib/http/2/stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def verify_trailers(frame)
trailers = frame[:payload]
return unless trailers.respond_to?(:each)

trailers.each do |field, _| # rubocop:disable Style/HashEachMethods
trailers.each do |field, _|
@_trailers.delete(field)
break if @_trailers.empty?
end
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/generate_huffman_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def self.generate_machine

next if node.transitions

node.transitions = Array[1 << BITS_AT_ONCE]
node.transitions = [1 << BITS_AT_ONCE]

(1 << BITS_AT_ONCE).times do |input|
n = node
Expand Down

0 comments on commit f10eeec

Please sign in to comment.