From 479f8b0fe0adbfd327969ef7788b285c539c7424 Mon Sep 17 00:00:00 2001 From: Takuya Noguchi Date: Sat, 24 Jun 2023 06:21:46 +0000 Subject: [PATCH] Activate RuboCop linting more effectively Signed-off-by: Takuya Noguchi --- .rubocop.yml | 5 + .rubocop_todo.yml | 299 +++++++++++++++++++++------------------------- Gemfile | 4 +- 3 files changed, 140 insertions(+), 168 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 9e74055b..16d5ad5b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,8 @@ inherit_from: .rubocop_todo.yml AllCops: + NewCops: disable + SuggestExtensions: false Exclude: - 'bin/**/*' - 'example/**/*' @@ -16,8 +18,11 @@ Metrics/AbcSize: - 'lib/bugsnag/configuration.rb' Metrics/ClassLength: + Max: 150 Exclude: + - 'lib/bugsnag.rb' - 'lib/bugsnag/configuration.rb' + - 'lib/bugsnag/report.rb' Style/RescueModifier: Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index af75a280..d8a9810f 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,21 +1,21 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2020-10-20 13:10:28 UTC using RuboCop version 0.89.1. +# on 2023-06-20 00:00:00 UTC using RuboCop version 1.53.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: 4 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, IndentOneStep, IndentationWidth. # SupportedStyles: case, end Layout/CaseIndentation: Exclude: - 'lib/bugsnag/cleaner.rb' -# Offense count: 15 -# Cop supports --auto-correct. +# Offense count: 14 +# This cop supports safe autocorrection (--autocorrect). Layout/EmptyLineAfterGuardClause: Exclude: - 'lib/bugsnag.rb' @@ -25,14 +25,14 @@ Layout/EmptyLineAfterGuardClause: - 'lib/bugsnag/session_tracker.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Layout/EmptyLines: Exclude: - 'lib/bugsnag/helpers.rb' - 'lib/bugsnag/integrations/mailman.rb' # Offense count: 3 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: around, only_before Layout/EmptyLinesAroundAccessModifier: @@ -42,29 +42,28 @@ Layout/EmptyLinesAroundAccessModifier: - 'lib/bugsnag/session_tracker.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: empty_lines, no_empty_lines Layout/EmptyLinesAroundBlockBody: Exclude: - 'lib/bugsnag/middleware/classify_error.rb' -# Offense count: 7 -# Cop supports --auto-correct. +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only Layout/EmptyLinesAroundClassBody: Exclude: - 'lib/bugsnag/integrations/mailman.rb' - 'lib/bugsnag/integrations/rack.rb' - - 'lib/bugsnag/integrations/railtie.rb' - 'lib/bugsnag/integrations/resque.rb' - 'lib/bugsnag/integrations/shoryuken.rb' - 'lib/bugsnag/integrations/sidekiq.rb' - 'lib/bugsnag/middleware/suggestion_data.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines Layout/EmptyLinesAroundModuleBody: @@ -72,15 +71,15 @@ Layout/EmptyLinesAroundModuleBody: - 'lib/bugsnag/integrations/rails/controller_methods.rb' # Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyleAlignWith, AutoCorrect, Severity. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyleAlignWith, Severity. # SupportedStylesAlignWith: keyword, variable, start_of_line Layout/EndAlignment: Exclude: - 'lib/bugsnag/cleaner.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: special_inside_parentheses, consistent, align_brackets Layout/FirstArrayElementIndentation: @@ -88,57 +87,41 @@ Layout/FirstArrayElementIndentation: - 'lib/bugsnag/middleware/classify_error.rb' # Offense count: 10 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: IndentationWidth. # SupportedStyles: special_inside_parentheses, consistent, align_braces Layout/FirstHashElementIndentation: EnforcedStyle: consistent # Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. -# SupportedHashRocketStyles: key, separator, table -# SupportedColonStyles: key, separator, table -# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit -Layout/HashAlignment: - Exclude: - - 'lib/bugsnag/delivery/synchronous.rb' - -# Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Layout/HeredocIndentation: Exclude: - 'lib/generators/bugsnag/bugsnag_generator.rb' # Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: Width, IgnoredPatterns. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Width, AllowedPatterns. Layout/IndentationWidth: Exclude: - 'lib/bugsnag/cleaner.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Layout/MultilineBlockLayout: Exclude: - 'lib/bugsnag/middleware/classify_error.rb' # Offense count: 3 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: aligned, indented Layout/MultilineOperationIndentation: Exclude: - 'lib/bugsnag/middleware/clearance_user.rb' -# Offense count: 1 -# Cop supports --auto-correct. -Layout/SpaceAfterComma: - Exclude: - - 'lib/bugsnag/integrations/rack.rb' - # Offense count: 9 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: space, no_space Layout/SpaceAroundEqualsInParameterDefault: @@ -149,17 +132,8 @@ Layout/SpaceAroundEqualsInParameterDefault: - 'lib/bugsnag/integrations/rake.rb' - 'lib/bugsnag/report.rb' -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. -# SupportedStyles: space, no_space -# SupportedStylesForEmptyBraces: space, no_space -Layout/SpaceBeforeBlockBraces: - Exclude: - - 'lib/bugsnag/middleware/suggestion_data.rb' - -# Offense count: 25 -# Cop supports --auto-correct. +# Offense count: 24 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters. # SupportedStyles: space, no_space # SupportedStylesForEmptyBraces: space, no_space @@ -173,25 +147,22 @@ Layout/SpaceInsideBlockBraces: - 'lib/bugsnag/middleware/warden_user.rb' - 'lib/bugsnag/middleware_stack.rb' - 'lib/bugsnag/report.rb' - - 'lib/bugsnag/stacktrace.rb' -# Offense count: 18 -# Cop supports --auto-correct. +# Offense count: 12 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. # SupportedStyles: space, no_space, compact # SupportedStylesForEmptyBraces: space, no_space Layout/SpaceInsideHashLiteralBraces: Exclude: - - 'lib/bugsnag/integrations/resque.rb' - 'lib/bugsnag/middleware/exception_meta_data.rb' - 'lib/bugsnag/middleware/mailman.rb' - - 'lib/bugsnag/middleware/suggestion_data.rb' - 'lib/bugsnag/middleware/warden_user.rb' - 'lib/bugsnag/report.rb' - 'lib/bugsnag/session_tracker.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: final_newline, final_blank_line Layout/TrailingEmptyLines: @@ -199,30 +170,21 @@ Layout/TrailingEmptyLines: - 'lib/bugsnag/tasks.rb' - 'lib/bugsnag/version.rb' -# Offense count: 1 -Lint/AmbiguousBlockAssociation: - Exclude: - - 'lib/bugsnag/middleware/suggestion_data.rb' - # Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowSafeAssignment. Lint/AssignmentInCondition: Exclude: - 'lib/bugsnag/delivery/thread_queue.rb' - 'lib/bugsnag/helpers.rb' -# Offense count: 15 +# Offense count: 16 Lint/IneffectiveAccessModifier: Exclude: - 'lib/bugsnag/helpers.rb' -# Offense count: 1 -Lint/MissingSuper: - Exclude: - - 'lib/bugsnag/middleware_stack.rb' - # Offense count: 3 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Lint/RedundantRequireStatement: Exclude: - 'lib/bugsnag.rb' @@ -230,20 +192,20 @@ Lint/RedundantRequireStatement: - 'lib/bugsnag/session_tracker.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Lint/SendWithMixinArgument: Exclude: - 'lib/bugsnag/integrations/rake.rb' # Offense count: 2 -# Configuration parameters: AllowComments. +# Configuration parameters: AllowComments, AllowNil. Lint/SuppressedException: Exclude: - 'lib/bugsnag.rb' - 'lib/bugsnag/tasks/bugsnag.rake' -# Offense count: 5 -# Cop supports --auto-correct. +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. Lint/UnusedBlockArgument: Exclude: @@ -253,7 +215,7 @@ Lint/UnusedBlockArgument: - 'lib/bugsnag/report.rb' # Offense count: 3 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods. Lint/UnusedMethodArgument: Exclude: @@ -262,20 +224,20 @@ Lint/UnusedMethodArgument: - 'lib/bugsnag/integrations/sidekiq.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: ContextCreatingMethods, MethodCreatingMethods. Lint/UselessAccessModifier: Exclude: - 'lib/bugsnag/helpers.rb' -# Offense count: 30 -# Configuration parameters: IgnoredMethods. +# Offense count: 32 +# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. Metrics/AbcSize: - Max: 69 + Max: 68 # Offense count: 1 -# Configuration parameters: CountComments, CountAsOne, ExcludedMethods. -# ExcludedMethods: refine +# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. +# AllowedMethods: refine Metrics/BlockLength: Max: 26 @@ -284,28 +246,23 @@ Metrics/BlockLength: Metrics/BlockNesting: Max: 4 -# Offense count: 4 -# Configuration parameters: CountComments, CountAsOne. -Metrics/ClassLength: - Max: 185 - -# Offense count: 12 -# Configuration parameters: IgnoredMethods. +# Offense count: 15 +# Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/CyclomaticComplexity: Max: 18 -# Offense count: 48 -# Configuration parameters: CountComments, CountAsOne, ExcludedMethods. +# Offense count: 60 +# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. Metrics/MethodLength: - Max: 53 + Max: 51 -# Offense count: 2 +# Offense count: 1 # Configuration parameters: CountComments, CountAsOne. Metrics/ModuleLength: - Max: 146 + Max: 111 -# Offense count: 13 -# Configuration parameters: IgnoredMethods. +# Offense count: 14 +# Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/PerceivedComplexity: Max: 19 @@ -316,12 +273,13 @@ Naming/AccessorMethodName: # Offense count: 1 # Configuration parameters: ForbiddenDelimiters. -# ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$)) +# ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$)) Naming/HeredocDelimiterNaming: Exclude: - 'lib/generators/bugsnag/bugsnag_generator.rb' # Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyleForLeadingUnderscores. # SupportedStylesForLeadingUnderscores: disallowed, required, optional Naming/MemoizedInstanceVariableName: @@ -340,7 +298,7 @@ Naming/PredicateName: - 'lib/bugsnag/helpers.rb' # Offense count: 10 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: PreferredName. Naming/RescuedExceptionsVariableName: Exclude: @@ -354,7 +312,7 @@ Naming/RescuedExceptionsVariableName: - 'lib/bugsnag/middleware/rack_request.rb' # Offense count: 6 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: prefer_alias, prefer_alias_method Style/Alias: @@ -364,7 +322,7 @@ Style/Alias: - 'lib/bugsnag/session_tracker.rb' # Offense count: 3 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: always, conditionals Style/AndOr: @@ -373,25 +331,42 @@ Style/AndOr: - 'lib/bugsnag/helpers.rb' # Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods. # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object # FunctionalMethods: let, let!, subject, watch -# IgnoredMethods: lambda, proc, it +# AllowedMethods: lambda, proc, it Style/BlockDelimiters: Exclude: - 'lib/bugsnag/middleware/classify_error.rb' -# Offense count: 24 -# Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, EnforcedStyle. +# Offense count: 31 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. # SupportedStyles: nested, compact Style/ClassAndModuleChildren: Enabled: false +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowedMethods, AllowedPatterns. +# AllowedMethods: ==, equal?, eql? +Style/ClassEqualityComparison: + Exclude: + - 'lib/bugsnag/delivery/synchronous.rb' + - 'lib/bugsnag/middleware_stack.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Keywords, RequireColon. +# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE +Style/CommentAnnotation: + Exclude: + - 'lib/bugsnag/middleware/exception_meta_data.rb' + # Offense count: 6 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions. # SupportedStyles: assign_to_condition, assign_inside_condition Style/ConditionalAssignment: @@ -402,45 +377,49 @@ Style/ConditionalAssignment: - 'lib/bugsnag/middleware_stack.rb' - 'lib/bugsnag/report.rb' -# Offense count: 21 +# Offense count: 27 +# Configuration parameters: AllowedConstants. Style/Documentation: Enabled: false # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Style/ExpandPathArguments: Exclude: - 'lib/generators/bugsnag/bugsnag_generator.rb' -# Offense count: 51 -# Cop supports --auto-correct. +# Offense count: 64 +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: always, always_true, never Style/FrozenStringLiteralComment: Enabled: false # Offense count: 2 -# Configuration parameters: MinBodyLength. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. Style/GuardClause: Exclude: - 'lib/bugsnag.rb' - 'lib/bugsnag/integrations/resque.rb' -# Offense count: 150 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. +# Offense count: 142 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys +# SupportedShorthandSyntax: always, never, either, consistent Style/HashSyntax: Enabled: false # Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowIfModifier. Style/IfInsideElse: Exclude: - 'lib/bugsnag/session_tracker.rb' # Offense count: 10 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Style/IfUnlessModifier: Exclude: - 'lib/bugsnag/delivery/synchronous.rb' @@ -451,15 +430,12 @@ Style/IfUnlessModifier: - 'lib/bugsnag/middleware/callbacks.rb' - 'lib/bugsnag/middleware/rack_request.rb' - 'lib/bugsnag/session_tracker.rb' - - 'lib/bugsnag/stacktrace.rb' -# Offense count: 6 -# Cop supports --auto-correct. -# Configuration parameters: IgnoredMethods. +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowedMethods, AllowedPatterns. Style/MethodCallWithoutArgsParentheses: Exclude: - - 'lib/bugsnag/delivery/synchronous.rb' - - 'lib/bugsnag/report.rb' - 'lib/bugsnag/session_tracker.rb' # Offense count: 1 @@ -473,13 +449,13 @@ Style/MultilineBlockChain: - 'lib/bugsnag/middleware/classify_error.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Style/MultilineIfModifier: Exclude: - 'lib/bugsnag/integrations/rails/controller_methods.rb' -# Offense count: 2 -# Cop supports --auto-correct. +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: both, prefix, postfix Style/NegatedIf: @@ -487,7 +463,7 @@ Style/NegatedIf: - 'lib/bugsnag/session_tracker.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, MinBodyLength. # SupportedStyles: skip_modifier_ifs, always Style/Next: @@ -496,21 +472,21 @@ Style/Next: - 'lib/bugsnag/middleware/exception_meta_data.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: IncludeSemanticChanges. Style/NonNilCheck: Exclude: - 'lib/bugsnag/report.rb' # Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: Strict. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Strict, AllowedNumbers, AllowedPatterns. Style/NumericLiterals: MinDigits: 7 # Offense count: 5 -# Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods. +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns. # SupportedStyles: predicate, comparison Style/NumericPredicate: Exclude: @@ -520,27 +496,27 @@ Style/NumericPredicate: - 'lib/bugsnag/utility/circular_buffer.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Style/ParallelAssignment: Exclude: - 'lib/bugsnag/stacktrace.rb' # Offense count: 6 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Style/PerlBackrefs: Exclude: - 'lib/bugsnag/stacktrace.rb' # Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, AllowedCompactTypes. # SupportedStyles: compact, exploded Style/RaiseArgs: Exclude: - 'lib/bugsnag/tasks/bugsnag.rake' -# Offense count: 11 -# Cop supports --auto-correct. +# Offense count: 12 +# This cop supports safe autocorrection (--autocorrect). Style/RedundantBegin: Exclude: - 'lib/bugsnag.rb' @@ -553,38 +529,30 @@ Style/RedundantBegin: - 'lib/bugsnag/integrations/railtie.rb' - 'lib/bugsnag/integrations/shoryuken.rb' - 'lib/bugsnag/tasks/bugsnag.rake' + - 'lib/bugsnag/utility/duplicator.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Style/RedundantException: Exclude: - 'lib/bugsnag/tasks/bugsnag.rake' # Offense count: 14 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Style/RedundantSelf: Exclude: - 'lib/bugsnag/configuration.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, AllowInnerSlashes. # SupportedStyles: slashes, percent_r, mixed Style/RegexpLiteral: Exclude: - 'lib/bugsnag/stacktrace.rb' -# Offense count: 5 -# Cop supports --auto-correct. -Style/RescueModifier: - Exclude: - - 'lib/bugsnag/middleware/rack_request.rb' - - 'lib/bugsnag/middleware/rails3_request.rb' - - 'lib/bugsnag/middleware/warden_user.rb' - - 'lib/bugsnag/stacktrace.rb' - # Offense count: 4 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: implicit, explicit Style/RescueStandardError: @@ -594,53 +562,52 @@ Style/RescueStandardError: - 'lib/bugsnag/tasks/bugsnag.rake' # Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods. +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength. # AllowedMethods: present?, blank?, presence, try, try! Style/SafeNavigation: Exclude: - 'lib/bugsnag/middleware/callbacks.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowAsExpressionSeparator. Style/Semicolon: Exclude: - 'lib/bugsnag/configuration.rb' # Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: . -# SupportedStyles: use_perl_names, use_english_names +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: RequireEnglish. +# SupportedStyles: use_perl_names, use_english_names, use_builtin_english_names Style/SpecialGlobalVars: EnforcedStyle: use_perl_names -# Offense count: 249 -# Cop supports --auto-correct. +# Offense count: 281 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. # SupportedStyles: single_quotes, double_quotes Style/StringLiterals: Enabled: false # Offense count: 13 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: MinSize. # SupportedStyles: percent, brackets Style/SymbolArray: EnforcedStyle: brackets -# Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: IgnoredMethods. -# IgnoredMethods: respond_to, define_method +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments. +# AllowedMethods: define_method Style/SymbolProc: Exclude: - 'lib/bugsnag/middleware/classify_error.rb' - 'lib/bugsnag/middleware/rack_request.rb' - - 'lib/bugsnag/middleware/suggestion_data.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, AllowSafeAssignment. # SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex Style/TernaryParentheses: @@ -648,7 +615,7 @@ Style/TernaryParentheses: - 'lib/bugsnag/report.rb' # Offense count: 5 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, AllowedMethods. # AllowedMethods: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym Style/TrivialAccessors: @@ -656,21 +623,21 @@ Style/TrivialAccessors: - 'lib/bugsnag/configuration.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: MinSize, WordRegex. # SupportedStyles: percent, brackets Style/WordArray: EnforcedStyle: brackets # Offense count: 3 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). Style/ZeroLengthPredicate: Exclude: - 'lib/bugsnag/session_tracker.rb' -# Offense count: 22 -# Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# Offense count: 16 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. # URISchemes: http, https Layout/LineLength: Max: 162 diff --git a/Gemfile b/Gemfile index 6a736ccc..0f4b4833 100644 --- a/Gemfile +++ b/Gemfile @@ -40,9 +40,9 @@ group :coverage, optional: true do gem 'coveralls' end -if ruby_version >= Gem::Version.new('2.4.0') +if ruby_version >= Gem::Version.new('2.6.0') group :rubocop, optional: true do - gem 'rubocop', '~> 1.0.0' + gem 'rubocop', '~> 1.50.0' end end