From c75b867f0b626e255e99675700ff980e081384ec Mon Sep 17 00:00:00 2001 From: Lucca Kaiser Date: Wed, 24 Aug 2022 16:29:55 +0200 Subject: [PATCH] update rubocop and run rubocop --auto-gen-config --- infopark_reactor/.rubocop_todo.yml | 315 +++++++++++++++------- infopark_reactor/infopark_reactor.gemspec | 4 +- 2 files changed, 218 insertions(+), 101 deletions(-) diff --git a/infopark_reactor/.rubocop_todo.yml b/infopark_reactor/.rubocop_todo.yml index e2147ec..dae21ce 100644 --- a/infopark_reactor/.rubocop_todo.yml +++ b/infopark_reactor/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by -# `rubocop --auto-gen-config --auto-gen-only-exclude` -# on 2022-05-05 11:51:54 UTC using RuboCop version 0.89.1. +# `rubocop --auto-gen-config` +# on 2022-08-24 14:28:25 UTC using RuboCop version 1.35.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 @@ -14,17 +14,34 @@ Gemspec/RequiredRubyVersion: - 'infopark_reactor.gemspec' # Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyleAlignWith, AutoCorrect, Severity. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyleAlignWith, Severity. +# SupportedStylesAlignWith: start_of_line, begin +Layout/BeginEndAlignment: + Exclude: + - 'app/models/rails_connector/abstract_obj.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyleAlignWith, Severity. # SupportedStylesAlignWith: start_of_line, def Layout/DefEndAlignment: Exclude: - 'lib/reactor/cm/user.rb' - 'lib/reactor/plans/create_group.rb' +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines. +Layout/EmptyLineBetweenDefs: + Exclude: + - 'lib/reactor/attributes.rb' + - 'lib/reactor/legacy.rb' + - 'lib/reactor/persistence.rb' + # Offense count: 4 -# 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: @@ -33,6 +50,40 @@ Layout/EndAlignment: - 'lib/reactor/tools/smart_xml_logger.rb' - 'lib/reactor/tools/workflow_generator.rb' +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment. +Layout/LeadingCommentSpace: + Exclude: + - 'lib/reactor/permission.rb' + - 'lib/reactor/persistence.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Layout/RescueEnsureAlignment: + Exclude: + - 'app/models/rails_connector/abstract_obj.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Lint/AmbiguousOperatorPrecedence: + Exclude: + - 'lib/reactor/tools/migrator.rb' + - 'lib/reactor/tools/smart_xml_logger.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Lint/ElseLayout: + Exclude: + - 'lib/reactor/cm/xml_markup.rb' + +# Offense count: 2 +# Configuration parameters: AllowComments, AllowEmptyLambdas. +Lint/EmptyBlock: + Exclude: + - 'config/routes.rb' + - 'lib/reactor/persistence.rb' + # Offense count: 9 Lint/IneffectiveAccessModifier: Exclude: @@ -55,6 +106,12 @@ Lint/MissingSuper: - 'lib/reactor/cm/object_base.rb' - 'lib/reactor/workflow/empty.rb' +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Lint/RedundantDirGlobSort: + Exclude: + - 'lib/reactor/tools/migrator.rb' + # Offense count: 2 Lint/ShadowingOuterLocalVariable: Exclude: @@ -62,7 +119,7 @@ Lint/ShadowingOuterLocalVariable: - 'lib/reactor/cm/obj_class.rb' # Offense count: 2 -# Configuration parameters: AllowComments. +# Configuration parameters: AllowComments, AllowNil. Lint/SuppressedException: Exclude: - 'lib/reactor/tools/sower.rb' @@ -79,75 +136,47 @@ Lint/UselessAssignment: - 'lib/reactor/plans/update_attribute.rb' - 'lib/reactor/plans/update_obj_class.rb' +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Lint/UselessMethodDefinition: + Exclude: + - 'lib/reactor/attributes.rb' + # Offense count: 43 -# Configuration parameters: IgnoredMethods. +# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes. Metrics/AbcSize: - Max: 60 + Max: 58 # Offense count: 5 -# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods. -# ExcludedMethods: refine +# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods. +# AllowedMethods: refine Metrics/BlockLength: - Exclude: - - '**/*.gemspec' - - 'lib/reactor/attributes/link_list_extender.rb' - - 'lib/reactor/attributes_handlers.rb' - - 'lib/reactor/cm/obj_class.rb' - - 'lib/tasks/cm_seeds.rake' + Max: 44 # Offense count: 7 -# Configuration parameters: CountComments, Max, CountAsOne. +# Configuration parameters: CountComments, CountAsOne. Metrics/ClassLength: - Exclude: - - 'lib/reactor/attributes_handlers.rb' - - 'lib/reactor/cm/group.rb' - - 'lib/reactor/cm/link.rb' - - 'lib/reactor/cm/obj.rb' - - 'lib/reactor/cm/obj_class.rb' - - 'lib/reactor/cm/object_base.rb' - - 'lib/reactor/tools/workflow_generator.rb' + Max: 397 # Offense count: 11 -# Configuration parameters: IgnoredMethods, Max. +# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods. Metrics/CyclomaticComplexity: - Exclude: - - 'lib/reactor/attributes/link_list_extender.rb' - - 'lib/reactor/attributes_handlers.rb' - - 'lib/reactor/cm/obj.rb' - - 'lib/reactor/cm/obj_class.rb' - - 'lib/reactor/legacy.rb' - - 'lib/reactor/link/temporary_link.rb' - - 'lib/reactor/persistence.rb' - - 'lib/reactor/tools/response_handler/xml_attribute.rb' - - 'lib/reactor/tools/smart_xml_logger.rb' - - 'lib/reactor/tools/where_query.rb' - - 'lib/reactor/validations.rb' + Max: 17 # Offense count: 55 -# Configuration parameters: CountComments, CountAsOne, ExcludedMethods. +# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods. Metrics/MethodLength: Max: 79 # Offense count: 2 -# Configuration parameters: CountComments, Max, CountAsOne. +# Configuration parameters: CountComments, CountAsOne. Metrics/ModuleLength: - Exclude: - - 'lib/reactor/attributes.rb' - - 'lib/reactor/persistence.rb' + Max: 264 # Offense count: 10 -# Configuration parameters: IgnoredMethods, Max. +# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods. Metrics/PerceivedComplexity: - Exclude: - - 'lib/reactor/attributes/date_serializer.rb' - - 'lib/reactor/attributes/link_list_extender.rb' - - 'lib/reactor/attributes_handlers.rb' - - 'lib/reactor/cm/obj.rb' - - 'lib/reactor/cm/obj_class.rb' - - 'lib/reactor/legacy.rb' - - 'lib/reactor/persistence.rb' - - 'lib/reactor/tools/smart_xml_logger.rb' - - 'lib/reactor/validations.rb' + Max: 17 # Offense count: 7 Naming/AccessorMethodName: @@ -159,6 +188,15 @@ Naming/AccessorMethodName: - 'lib/reactor/cm/xml_markup.rb' - 'lib/reactor/persistence.rb' +# Offense count: 11 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, BlockForwardingName. +# SupportedStyles: anonymous, explicit +Naming/BlockForwarding: + Exclude: + - 'lib/reactor/migration.rb' + - 'lib/reactor/tools/sower.rb' + # Offense count: 1 Naming/ConstantName: Exclude: @@ -206,7 +244,7 @@ Naming/PredicateName: - 'lib/reactor/persistence.rb' # Offense count: 15 -# Configuration parameters: EnforcedStyle. +# Configuration parameters: EnforcedStyle, AllowedIdentifiers, AllowedPatterns. # SupportedStyles: snake_case, camelCase Naming/VariableName: Exclude: @@ -216,37 +254,49 @@ Naming/VariableName: - 'lib/reactor/tools/sower.rb' # Offense count: 1 -# Cop supports --auto-correct. -Security/YAMLLoad: +# This cop supports safe autocorrection (--autocorrect). +Performance/BindCall: Exclude: - - 'lib/reactor/tools/versioner.rb' + - 'lib/reactor/attributes/link_list_extender.rb' -# Offense count: 5 -# Cop supports --auto-correct. -Style/ArrayCoercion: +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +Performance/BlockGivenWithExplicitBlock: Exclude: - - 'lib/reactor/cm/bridge.rb' - - 'lib/reactor/cm/log_entry.rb' - - 'lib/reactor/cm/obj_class.rb' - - 'lib/reactor/cm/xml_single_request_error.rb' - - 'lib/reactor/tools/where_query.rb' + - 'lib/reactor/migration.rb' + - 'lib/reactor/tools/sower.rb' # Offense count: 1 -# Configuration parameters: AllowedChars. -Style/AsciiComments: +# This cop supports unsafe autocorrection (--autocorrect-all). +Performance/MapCompact: Exclude: - - 'lib/reactor/cm/language.rb' + - 'lib/reactor/attributes/link_list_extender.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Performance/RedundantEqualityComparisonBlock: + Exclude: + - 'lib/reactor/attributes/link_list_extender.rb' + +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +Performance/StringIdentifierArgument: + Exclude: + - 'lib/reactor/attributes.rb' + - 'lib/reactor/cm/attribute.rb' + - 'lib/reactor/cm/obj.rb' + - 'lib/reactor/persistence.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). Style/CaseLikeIf: Exclude: - 'lib/reactor/attributes/date_serializer.rb' - 'lib/reactor/cm/xml_markup.rb' # Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, EnforcedStyle. +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. # SupportedStyles: nested, compact Style/ClassAndModuleChildren: Exclude: @@ -261,37 +311,68 @@ Style/ClassVars: - 'lib/reactor/cache/user.rb' # Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). Style/CommentedKeyword: Exclude: - 'lib/reactor/cm/obj.rb' - 'lib/reactor/validations.rb' +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions. +# SupportedStyles: assign_to_condition, assign_inside_condition +Style/ConditionalAssignment: + Exclude: + - 'lib/reactor/attributes_handlers.rb' + +# Offense count: 2 +Style/DocumentDynamicEvalDefinition: + Exclude: + - 'lib/reactor/attributes_handlers.rb' + - 'lib/reactor/cm/object_base.rb' + # Offense count: 118 +# Configuration parameters: AllowedConstants. Style/Documentation: Enabled: false # Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). Style/EvalWithLocation: Exclude: - 'lib/reactor/attributes_handlers.rb' - 'lib/reactor/cm/object_base.rb' # Offense count: 7 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Style/ExplicitBlockArgument: Exclude: - 'lib/reactor/cm/multi_xml_request.rb' - 'lib/reactor/cm/xml_markup.rb' +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowedVars. +Style/FetchEnvVar: + Exclude: + - 'lib/reactor/support/link_matcher.rb' + - 'lib/tasks/cm_migrate.rake' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/FileWrite: + Exclude: + - 'Rakefile' + # Offense count: 115 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: always, always_true, never Style/FrozenStringLiteralComment: Enabled: false # Offense count: 4 -# Configuration parameters: MinBodyLength. +# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. Style/GuardClause: Exclude: - 'lib/reactor/attributes/link_list_extender.rb' @@ -300,7 +381,8 @@ Style/GuardClause: - 'lib/reactor/tools/uploader.rb' # Offense count: 8 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowedReceivers. Style/HashEachMethods: Exclude: - 'lib/reactor/permission.rb' @@ -312,14 +394,32 @@ Style/HashEachMethods: - 'lib/reactor/plans/common_obj_class.rb' - 'lib/reactor/tools/workflow_generator.rb' +# Offense count: 16 +# 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: + Exclude: + - 'lib/reactor/cm/attribute_group.rb' + - 'lib/reactor/cm/channel.rb' + - 'lib/reactor/cm/group.rb' + - 'lib/reactor/cm/obj.rb' + - 'lib/reactor/cm/user.rb' + - 'lib/reactor/cm/workflow.rb' + - 'lib/reactor/persistence.rb' + - 'lib/reactor/tools/response_handler/xml_attribute.rb' + - 'lib/reactor/tools/sower.rb' + # Offense count: 4 +# This cop supports unsafe autocorrection (--autocorrect-all). Style/IdenticalConditionalBranches: Exclude: - 'lib/reactor/tools/workflow_generator.rb' - 'lib/reactor/tools/xml_attributes.rb' # Offense count: 9 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Style/IfUnlessModifier: Exclude: - 'lib/reactor/attributes.rb' @@ -331,7 +431,7 @@ Style/IfUnlessModifier: - 'lib/reactor/validations.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: InverseMethods, InverseBlocks. Style/InverseMethods: Exclude: @@ -343,28 +443,53 @@ Style/MissingRespondToMissing: - 'lib/reactor/migration.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). +Style/NegatedIfElseCondition: + Exclude: + - 'lib/reactor/permission.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: IncludeSemanticChanges. Style/NonNilCheck: Exclude: - 'lib/reactor/permission.rb' # Offense count: 6 +# Configuration parameters: AllowedMethods. +# AllowedMethods: respond_to_missing? Style/OptionalBooleanParameter: Exclude: - 'lib/reactor/cm/obj.rb' - 'lib/reactor/persistence.rb' - 'lib/reactor/session/observers.rb' +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowComments. +Style/RedundantInitialize: + Exclude: + - 'lib/reactor/cm/link.rb' + - 'lib/reactor/migration.rb' + +# Offense count: 5 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantSelfAssignmentBranch: + Exclude: + - 'lib/reactor/cm/group.rb' + - 'lib/reactor/cm/permissions.rb' + - 'lib/reactor/tools/response_handler/xml_attribute.rb' + # Offense count: 1 -# 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: 5 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Mode. Style/StringConcatenation: Exclude: - 'lib/reactor/attributes_handlers.rb' @@ -373,9 +498,9 @@ Style/StringConcatenation: - 'lib/reactor/tools/versioner.rb' # Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: IgnoredMethods. -# IgnoredMethods: respond_to, define_method +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, IgnoredMethods, AllowComments. +# AllowedMethods: respond_to, define_method Style/SymbolProc: Exclude: - 'lib/reactor/cm/obj.rb' @@ -383,23 +508,15 @@ Style/SymbolProc: - 'lib/reactor/tools/smart_xml_logger.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: Exclude: - 'lib/reactor/cm/obj.rb' -# Offense count: 2 -# Cop supports --auto-correct. -# 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: - Exclude: - - 'lib/reactor/plans/common_attribute_group.rb' - # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: forbid_for_all_comparison_operators, forbid_for_equality_operators_only, require_for_all_comparison_operators, require_for_equality_operators_only Style/YodaCondition: @@ -407,8 +524,8 @@ Style/YodaCondition: - 'lib/reactor/validations.rb' # Offense count: 29 -# Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns. # URISchemes: http, https Layout/LineLength: Max: 248 diff --git a/infopark_reactor/infopark_reactor.gemspec b/infopark_reactor/infopark_reactor.gemspec index 9d9f79e..68c505a 100644 --- a/infopark_reactor/infopark_reactor.gemspec +++ b/infopark_reactor/infopark_reactor.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |s| s.add_dependency "rails", [">= 5.0", "< 7.0"] s.add_development_dependency "rspec", "~> 3" - s.add_development_dependency "rubocop", "~> 0.89.1" - s.add_development_dependency "rubocop-performance", "~> 1" + s.add_development_dependency "rubocop" + s.add_development_dependency "rubocop-performance" s.add_development_dependency "yard", ">= 0" end