Commit e35638dd authored by Takuya Noguchi's avatar Takuya Noguchi 💖
Browse files

Update RuboCop to 0.93.1

parent bc4964dc
Loading
Loading
Loading
Loading
Loading
+4 −226
Original line number Diff line number Diff line
inherit_from: .rubocop_todo.yml

inherit_gem:
  gitlab-styles:
    - rubocop-default.yml

AllCops:
  TargetRubyVersion: 2.7

require:
  - rubocop-rspec

Style/HashSyntax:
  EnforcedStyle: no_mixed_keys

@@ -33,9 +34,6 @@ Style/StringLiteralsInInterpolation:
Style/Lambda:
  Enabled: false

Layout/MultilineMethodCallIndentation:
  Enabled: No

Layout/LineLength:
  Enabled: false

@@ -48,66 +46,6 @@ Layout/SpaceInsideBlockBraces:
Layout/FirstParameterIndentation:
  Enabled: No

Metrics/AbcSize:
  Enabled: true
  Max: 54.28

Metrics/BlockLength:
  Enabled: false

Metrics/BlockNesting:
  Enabled: true
  Max: 4

Metrics/ClassLength:
  Enabled: false

Metrics/CyclomaticComplexity:
  Enabled: true
  Max: 13

Metrics/MethodLength:
  Enabled: false

Metrics/ModuleLength:
  Enabled: false

Metrics/ParameterLists:
  Enabled: true
  Max: 8

Metrics/PerceivedComplexity:
  Enabled: true
  Max: 14

RSpec/AnyInstance:
  Enabled: false

RSpec/BeEql:
  Enabled: true

RSpec/BeforeAfterAll:
  Enabled: false

RSpec/DescribeClass:
  Enabled: false

RSpec/DescribeMethod:
  Enabled: false

RSpec/DescribeSymbol:
  Enabled: true

RSpec/DescribedClass:
  Enabled: true

RSpec/EmptyExampleGroup:
  Enabled: true

RSpec/ExampleLength:
  Enabled: false
  Max: 5

RSpec/ExampleWording:
  Enabled: false
  CustomTransform:
@@ -116,169 +54,9 @@ RSpec/ExampleWording:
    not: does not
  IgnoredWords: []

RSpec/ExpectActual:
  Enabled: true

RSpec/ExpectOutput:
  Enabled: true

RSpec/FilePath:
  Enabled: true
  IgnoreMethods: true

RSpec/Focus:
  Enabled: true

RSpec/HookArgument:
  Enabled: true
  EnforcedStyle: implicit

RSpec/ImplicitExpect:
  Enabled: true
  EnforcedStyle: is_expected

RSpec/InstanceVariable:
  Enabled: false

RSpec/LeadingSubject:
  Enabled: false

RSpec/LetSetup:
  Enabled: false

RSpec/MessageChain:
  Enabled: false

RSpec/MessageSpies:
  Enabled: false

RSpec/MultipleDescribes:
  Enabled: false

RSpec/MultipleExpectations:
  Enabled: false

RSpec/NamedSubject:
  Enabled: false

RSpec/NestedGroups:
  Enabled: false

RSpec/NotToNot:
  EnforcedStyle: not_to
  Enabled: true

RSpec/RepeatedDescription:
  Enabled: false

RSpec/SubjectStub:
  Enabled: false

RSpec/VerifiedDoubles:
  Enabled: false

Layout/BeginEndAlignment: # (new in 0.91)
  Enabled: true
Layout/EmptyLinesAroundAttributeAccessor: # (new in 0.83)
  Enabled: true
Layout/SpaceAroundMethodCallOperator: # (new in 0.82)
  Enabled: true
Lint/BinaryOperatorWithIdenticalOperands: # (new in 0.89)
  Enabled: true
Lint/ConstantDefinitionInBlock: # (new in 0.91)
  Enabled: true
Lint/DeprecatedOpenSSLConstant: # (new in 0.84)
  Enabled: true
Lint/DuplicateElsifCondition: # (new in 0.88)
  Enabled: true
Lint/DuplicateRequire: # (new in 0.90)
  Enabled: true
Lint/DuplicateRescueException: # (new in 0.89)
  Enabled: true
Lint/EmptyConditionalBody: # (new in 0.89)
  Enabled: true
Lint/EmptyFile: # (new in 0.90)
  Enabled: true
Lint/FloatComparison: # (new in 0.89)
  Enabled: true
Lint/HashCompareByIdentity: # (new in 0.93)
  Enabled: true
Lint/IdentityComparison: # (new in 0.91)
  Enabled: true
Lint/MissingSuper: # (new in 0.89)
  Enabled: true
Lint/MixedRegexpCaptureTypes: # (new in 0.85)
  Enabled: true
Lint/OutOfRangeRegexpRef: # (new in 0.89)
  Enabled: true
Lint/RaiseException: # (new in 0.81)
  Enabled: true
Lint/RedundantSafeNavigation: # (new in 0.93)
  Enabled: true
Lint/SelfAssignment: # (new in 0.89)
  Enabled: true
Lint/StructNewOverride: # (new in 0.81)
  Enabled: true
Lint/TopLevelReturnWithArgument: # (new in 0.89)
  Enabled: true
Lint/TrailingCommaInAttributeDeclaration: # (new in 0.90)
  Enabled: true
Lint/UnreachableLoop: # (new in 0.89)
  Enabled: true
Lint/UselessMethodDefinition: # (new in 0.90)
  Enabled: true
Lint/UselessTimes: # (new in 0.91)
  Enabled: true
Style/AccessorGrouping: # (new in 0.87)
  Enabled: true
Style/BisectedAttrAccessor: # (new in 0.87)
  Enabled: true
Style/CaseLikeIf: # (new in 0.88)
  Enabled: true
Style/ClassEqualityComparison: # (new in 0.93)
  Enabled: true
Style/CombinableLoops: # (new in 0.90)
  Enabled: true
Style/ExplicitBlockArgument: # (new in 0.89)
  Enabled: true
Style/ExponentialNotation: # (new in 0.82)
  Enabled: true
Style/GlobalStdStream: # (new in 0.89)
  Enabled: true
Style/HashAsLastArrayItem: # (new in 0.88)
  Enabled: true
Style/HashEachMethods: # (new in 0.80)
  Enabled: true
Style/HashLikeCase: # (new in 0.88)
  Enabled: true
Style/HashTransformKeys: # (new in 0.80)
  Enabled: true
Style/HashTransformValues: # (new in 0.80)
  Enabled: true
Style/KeywordParametersOrder: # (new in 0.90)
  Enabled: true
Style/OptionalBooleanParameter: # (new in 0.89)
  Enabled: true
Style/RedundantAssignment: # (new in 0.87)
  Enabled: true
Style/RedundantFetchBlock: # (new in 0.86)
  Enabled: true
Style/RedundantFileExtensionInRequire: # (new in 0.88)
  Enabled: true
Style/RedundantRegexpCharacterClass: # (new in 0.85)
  Enabled: true
Style/RedundantRegexpEscape: # (new in 0.85)
  Enabled: true
Style/RedundantSelfAssignment: # (new in 0.90)
  Enabled: true
Style/SingleArgumentDig: # (new in 0.89)
  Enabled: true
Style/SlicingWithRange: # (new in 0.83)
  Enabled: true
Style/SoleNestedConditional: # (new in 0.89)
  Enabled: true
Style/StringConcatenation: # (new in 0.89)
  Enabled: true

RSpec/StubbedMock: # (new in 1.44)
  Enabled: true
+57 −44
Original line number Diff line number Diff line
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2021-04-14 00:00:00 UTC using RuboCop version 0.93.1.
# on 2021-04-16 00:00:00 UTC using RuboCop version 0.93.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: 1
# Offense count: 51
# Cop supports --auto-correct.
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
# Include: **/*.gemspec
Gemspec/OrderedDependencies:
CodeReuse/ActiveRecord:
  Exclude:
    - 'gitlab-labkit.gemspec'
    - 'spec/labkit/correlation/grpc/client_interceptor_spec.rb'
    - 'spec/labkit/correlation/grpc/server_interceptor_spec.rb'
    - 'spec/labkit/middleware/rack_spec.rb'
    - 'spec/labkit/middleware/sidekiq/client_spec.rb'
    - 'spec/labkit/middleware/sidekiq/context/server_spec.rb'
    - 'spec/labkit/middleware/sidekiq/server_spec.rb'
    - 'spec/labkit/middleware/sidekiq/tracing/client_spec.rb'
    - 'spec/labkit/middleware/sidekiq/tracing/server_spec.rb'
    - 'spec/labkit/tracing/factory_spec.rb'
    - 'spec/labkit/tracing/grpc/client_interceptor_spec.rb'
    - 'spec/labkit/tracing/grpc/server_interceptor_spec.rb'
    - 'spec/labkit/tracing_spec.rb'
    - 'spec/support/tracing/shared_examples.rb'

# Offense count: 2
# Cop supports --auto-correct.
Cop/LineBreakAroundConditionalBlock:
  Exclude:
    - 'lib/labkit/excon_publisher.rb'
    - 'lib/labkit/tracing/external_http/request_instrumenter.rb'

# Offense count: 1
# Configuration parameters: Include.
@@ -44,6 +61,15 @@ Lint/ConstantDefinitionInBlock:
    - 'spec/labkit/middleware/sidekiq/context/server_spec.rb'
    - 'spec/labkit/middleware/sidekiq/server_spec.rb'

# Offense count: 4
# Cop supports --auto-correct.
Lint/RedundantCopDisableDirective:
  Exclude:
    - 'lib/labkit/correlation/grpc/client_interceptor.rb'
    - 'lib/labkit/correlation/grpc/server_interceptor.rb'
    - 'lib/labkit/tracing/grpc/client_interceptor.rb'
    - 'lib/labkit/tracing/grpc/server_interceptor.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowedMethods.
@@ -52,18 +78,6 @@ Lint/RedundantSafeNavigation:
  Exclude:
    - 'lib/labkit/tracing.rb'

# Offense count: 8
# Cop supports --auto-correct.
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
Lint/UnusedMethodArgument:
  Exclude:
    - 'lib/labkit/logging/grpc/server_interceptor.rb'
    - 'lib/labkit/tracing/rails/active_support/cache_delete_instrumenter.rb'
    - 'lib/labkit/tracing/rails/active_support/cache_fetch_hit_instrumenter.rb'
    - 'lib/labkit/tracing/rails/active_support/cache_generate_instrumenter.rb'
    - 'lib/labkit/tracing/rails/active_support/cache_read_instrumenter.rb'
    - 'lib/labkit/tracing/rails/active_support/cache_write_instrumenter.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: PreferredName.
@@ -71,6 +85,11 @@ Naming/RescuedExceptionsVariableName:
  Exclude:
    - 'lib/labkit/logging/grpc/server_interceptor.rb'

# Offense count: 2
Performance/MethodObjectAsBlock:
  Exclude:
    - 'lib/labkit/context.rb'

# Offense count: 6
# Cop supports --auto-correct.
RSpec/BeEql:
@@ -94,6 +113,13 @@ RSpec/DescribedClass:
  Exclude:
    - 'spec/labkit/tracing_spec.rb'

# Offense count: 4
# Cop supports --auto-correct.
RSpec/EmptyLineAfterLetBlock:
  Exclude:
    - 'spec/labkit/tracing/external_http/request_instrumenter_spec.rb'
    - 'spec/labkit/tracing/rails/active_record/sql_instrumenter_spec.rb'

# Offense count: 2
# Configuration parameters: CustomTransform, IgnoreMethods, SpecSuffixOnly.
RSpec/FilePath:
@@ -136,16 +162,20 @@ RSpec/ScatteredLet:
    - 'spec/labkit/httpclient_publisher_spec.rb'
    - 'spec/labkit/net_http_publisher_spec.rb'

# Offense count: 20
RSpec/StubbedMock:
# Offense count: 1
# Cop supports --auto-correct.
Rails/NegateInclude:
  Exclude:
    - 'spec/labkit/middleware/rack_spec.rb'
    - 'spec/labkit/middleware/sidekiq/client_spec.rb'
    - 'spec/labkit/middleware/sidekiq/server_spec.rb'
    - 'spec/labkit/middleware/sidekiq/tracing/client_spec.rb'
    - 'spec/labkit/middleware/sidekiq/tracing/server_spec.rb'
    - 'spec/labkit/tracing/factory_spec.rb'
    - 'spec/labkit/tracing_spec.rb'
    - 'spec/labkit/correlation/grpc/client_interceptor_spec.rb'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: Include.
# Include: **/Rakefile, **/*.rake
Rails/RakeEnvironment:
  Exclude:
    - 'lib/capistrano/tasks/**/*.rake'
    - 'Rakefile'

# Offense count: 1
# Configuration parameters: AllowedChars.
@@ -167,17 +197,6 @@ Style/CommandLiteral:
  Exclude:
    - 'tools/update-changelog.rb'

# Offense count: 5
Style/Documentation:
  Exclude:
    - 'spec/**/*'
    - 'test/**/*'
    - 'lib/labkit/logging/grpc.rb'
    - 'lib/labkit/logging/grpc/server_interceptor.rb'
    - 'lib/labkit/tracing/rails/action_view.rb'
    - 'lib/labkit/tracing/rails/active_record.rb'
    - 'lib/labkit/tracing/rails/active_support.rb'

# Offense count: 23
# Cop supports --auto-correct.
Style/ExplicitBlockArgument:
@@ -247,12 +266,6 @@ Style/RedundantBegin:
    - 'Rakefile'
    - 'spec/labkit/net_http_publisher_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantPercentQ:
  Exclude:
    - 'spec/logging/sanitizer_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantRegexpEscape:
+1 −2
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
  # Please maintain alphabetical order for dev dependencies
  spec.add_development_dependency "excon", "~> 0.78.1"
  spec.add_development_dependency "faraday", "~> 1.2.0"
  spec.add_development_dependency "gitlab-styles", "~> 6.2.0"
  spec.add_development_dependency "grpc-tools", "~> 1.19"
  spec.add_development_dependency "httparty", "~> 0.17.3"
  spec.add_development_dependency "httpclient", "~> 2.8.3"
@@ -39,8 +40,6 @@ Gem::Specification.new do |spec|
  spec.add_development_dependency "rest-client", "~> 2.1.0"
  spec.add_development_dependency "rspec", "~> 3.8.0"
  spec.add_development_dependency "rspec-parameterized", "~> 0.4"
  spec.add_development_dependency "rubocop", "~> 0.93.1"
  spec.add_development_dependency "rubocop-rspec", "~> 1.44.1"
  spec.add_development_dependency "rufo", "0.9.0"
  spec.add_development_dependency "sidekiq", "~> 5.2.7"
end