From: Andy Allan Date: Wed, 19 Sep 2018 13:25:31 +0000 (+0100) Subject: Set the rubocop target version to 2.3 X-Git-Tag: live~3431^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/071d7619c54f70d2278a9ea7d6e7d96187cc649c?hp=1ebd7ca9b00949ab13bd151f5eedeee3d34b34b0 Set the rubocop target version to 2.3 This allows rubocop to run additional cops that would not apply to older ruby versions --- diff --git a/.rubocop.yml b/.rubocop.yml index 24d57fb37..aacaf2d53 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,8 @@ inherit_from: .rubocop_todo.yml +AllCops: + TargetRubyVersion: 2.3 + Rails: Enabled: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 653d7e157..fbae24baa 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2018-06-19 09:02:55 +0100 using RuboCop version 0.57.2. +# on 2018-09-19 14:24:02 +0100 using RuboCop version 0.58.2. # 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 @@ -30,14 +30,15 @@ Lint/HandleExceptions: - 'app/controllers/amf_controller.rb' - 'app/controllers/user_controller.rb' -# Offense count: 690 +# Offense count: 692 Metrics/AbcSize: Max: 280 -# Offense count: 41 +# Offense count: 40 # Configuration parameters: CountComments, ExcludedMethods. +# ExcludedMethods: refine Metrics/BlockLength: - Max: 261 + Max: 259 # Offense count: 11 # Configuration parameters: CountBlocks. @@ -53,7 +54,7 @@ Metrics/ClassLength: Metrics/CyclomaticComplexity: Max: 20 -# Offense count: 688 +# Offense count: 691 # Configuration parameters: CountComments. Metrics/MethodLength: Max: 179 @@ -68,7 +69,7 @@ Metrics/ModuleLength: Metrics/ParameterLists: Max: 9 -# Offense count: 71 +# Offense count: 72 Metrics/PerceivedComplexity: Max: 23 @@ -161,10 +162,17 @@ Style/AsciiComments: Exclude: - 'test/models/message_test.rb' -# Offense count: 229 +# Offense count: 230 Style/Documentation: Enabled: false +# Offense count: 462 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: when_needed, always, never +Style/FrozenStringLiteralComment: + Enabled: false + # Offense count: 2 # Cop supports --auto-correct. Style/IfUnlessModifier: @@ -177,7 +185,50 @@ Style/IfUnlessModifier: Style/NumericLiterals: MinDigits: 11 -# Offense count: 3064 +# Offense count: 21 +# Cop supports --auto-correct. +# Configuration parameters: AutoCorrect, EnforcedStyle. +# SupportedStyles: predicate, comparison +Style/NumericPredicate: + Exclude: + - 'spec/**/*' + - 'app/controllers/amf_controller.rb' + - 'app/controllers/changeset_controller.rb' + - 'app/controllers/notes_controller.rb' + - 'app/helpers/banner_helper.rb' + - 'app/helpers/issues_helper.rb' + - 'app/models/relation.rb' + - 'app/models/trace.rb' + - 'app/models/way.rb' + - 'db/migrate/021_move_to_innodb.rb' + - 'lib/classic_pagination/pagination.rb' + - 'lib/daemons/gpx_import.rb' + - 'lib/gpx.rb' + - 'test/controllers/amf_controller_test.rb' + +# Offense count: 30 +# Cop supports --auto-correct. +# Configuration parameters: ConvertCodeThatCanStartToReturnNil, Whitelist. +# Whitelist: present?, blank?, presence, try, try! +Style/SafeNavigation: + Exclude: + - 'app/controllers/amf_controller.rb' + - 'app/controllers/application_controller.rb' + - 'app/controllers/browse_controller.rb' + - 'app/controllers/issues_controller.rb' + - 'app/controllers/notes_controller.rb' + - 'app/controllers/old_controller.rb' + - 'app/controllers/traces_controller.rb' + - 'app/controllers/user_controller.rb' + - 'app/helpers/user_roles_helper.rb' + - 'app/models/changeset.rb' + - 'app/models/client_application.rb' + - 'app/models/notifier.rb' + - 'app/models/relation.rb' + - 'app/models/way.rb' + - 'script/deliver-message' + +# Offense count: 3080 # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https Metrics/LineLength: