From cacb774ea4502b8ff5d8d815c6c45d874fe6d539 Mon Sep 17 00:00:00 2001 From: zachary_sabin Date: Fri, 8 Nov 2019 16:15:53 -0800 Subject: [PATCH 01/18] bump gem versions, add new gems that have been spun out --- rubocop-airbnb/rubocop-airbnb.gemspec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rubocop-airbnb/rubocop-airbnb.gemspec b/rubocop-airbnb/rubocop-airbnb.gemspec index 569c8aa..9a4b2c3 100644 --- a/rubocop-airbnb/rubocop-airbnb.gemspec +++ b/rubocop-airbnb/rubocop-airbnb.gemspec @@ -25,7 +25,9 @@ Gem::Specification.new do |spec| 'Gemfile', ] - spec.add_dependency('rubocop', '~> 0.58.0') + spec.add_dependency('rubocop', '~> 0.76.0') + spec.add_dependency('rubocop-performance', '~> 1.5.0') + spec.add_dependency('rubocop-rails', '~> 2.3.2') spec.add_dependency('rubocop-rspec', '~> 1.30.0') spec.add_development_dependency('rspec', '~> 3.5') end From 72066c174f4f5c3750c51bebf711ca831df5b83a Mon Sep 17 00:00:00 2001 From: zachary_sabin Date: Fri, 8 Nov 2019 16:17:42 -0800 Subject: [PATCH 02/18] require new gems in config file --- rubocop-airbnb/.rubocop.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rubocop-airbnb/.rubocop.yml b/rubocop-airbnb/.rubocop.yml index e72544e..d3c7896 100644 --- a/rubocop-airbnb/.rubocop.yml +++ b/rubocop-airbnb/.rubocop.yml @@ -1,3 +1,6 @@ +require: + - rubocop-performance + - rubocop-rails inherit_from: - .rubocop_airbnb.yml - ./config/default.yml From 9d2dd27d98b0fcabe7fc740d8129c6a8e70a3375 Mon Sep 17 00:00:00 2001 From: zachary_sabin Date: Fri, 8 Nov 2019 16:19:51 -0800 Subject: [PATCH 03/18] fix ruby compilation --- rubocop-airbnb/lib/rubocop/cop/airbnb/continuation_slash.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rubocop-airbnb/lib/rubocop/cop/airbnb/continuation_slash.rb b/rubocop-airbnb/lib/rubocop/cop/airbnb/continuation_slash.rb index 2d7ae1e..e5fdd85 100644 --- a/rubocop-airbnb/lib/rubocop/cop/airbnb/continuation_slash.rb +++ b/rubocop-airbnb/lib/rubocop/cop/airbnb/continuation_slash.rb @@ -14,7 +14,7 @@ def enforce_violation(node) alias on_send enforce_violation alias on_if enforce_violation - Util::ASGN_NODES.each do |type| + RuboCop::AST::Node::ASSIGNMENTS.each do |type| define_method("on_#{type}") do |node| enforce_violation(node) end From 72bfac7a3911f4d5dfc5e2dd65553b2efa47cdf0 Mon Sep 17 00:00:00 2001 From: zachary_sabin Date: Fri, 8 Nov 2019 16:20:41 -0800 Subject: [PATCH 04/18] migrate cop names --- rubocop-airbnb/config/rubocop-layout.yml | 8 +++----- rubocop-airbnb/config/rubocop-lint.yml | 8 ++++---- rubocop-airbnb/config/rubocop-style.yml | 13 +++++-------- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/rubocop-airbnb/config/rubocop-layout.yml b/rubocop-airbnb/config/rubocop-layout.yml index cb6eb34..12678ce 100644 --- a/rubocop-airbnb/config/rubocop-layout.yml +++ b/rubocop-airbnb/config/rubocop-layout.yml @@ -227,7 +227,7 @@ Layout/FirstMethodParameterLineBreak: Enabled: false # Supports --auto-correct -Layout/FirstParameterIndentation: +Layout/IndentFirstArgument: Description: Checks the indentation of the first parameter in a method call. Enabled: true EnforcedStyle: consistent @@ -238,7 +238,7 @@ Layout/FirstParameterIndentation: - special_for_inner_method_call_in_parentheses # Supports --auto-correct -Layout/IndentArray: +Layout/IndentFirstArrayElement: Description: Checks the indentation of the first element in an array literal. Enabled: true EnforcedStyle: consistent @@ -248,10 +248,9 @@ Layout/IndentAssignment: Description: Checks the indentation of the first line of the right-hand-side of a multi-line assignment. Enabled: true - IndentationWidth: # Supports --auto-correct -Layout/IndentHash: +Layout/IndentFirstHashElement: Description: Checks the indentation of the first key in a hash literal. Enabled: true EnforcedStyle: consistent @@ -344,7 +343,6 @@ Layout/MultilineMethodCallIndentation: SupportedStyles: - aligned - indented - IndentationWidth: Layout/MultilineMethodDefinitionBraceLayout: Description: >- diff --git a/rubocop-airbnb/config/rubocop-lint.yml b/rubocop-airbnb/config/rubocop-lint.yml index 30863fe..b688796 100644 --- a/rubocop-airbnb/config/rubocop-lint.yml +++ b/rubocop-airbnb/config/rubocop-lint.yml @@ -237,20 +237,20 @@ Lint/UnderscorePrefixedVariableName: Lint/UnifiedInteger: Enabled: false -Lint/UnneededCopDisableDirective: +Lint/RedundantCopDisableDirective: Description: >- Checks for rubocop:disable comments that can be removed. Note: this cop is not disabled when disabling all cops. It must be explicitly disabled. Enabled: true -Lint/UnneededCopEnableDirective: +Lint/RedundantCopEnableDirective: Description: Checks for rubocop:enable comments that can be removed. Enabled: true -Lint/UnneededRequireStatement: +Lint/RedundantRequireStatement: Enabled: false -Lint/UnneededSplatExpansion: +Lint/RedundantSplatExpansion: Enabled: false Lint/UnreachableCode: diff --git a/rubocop-airbnb/config/rubocop-style.yml b/rubocop-airbnb/config/rubocop-style.yml index 43f0844..00fa8c0 100644 --- a/rubocop-airbnb/config/rubocop-style.yml +++ b/rubocop-airbnb/config/rubocop-style.yml @@ -360,10 +360,7 @@ Style/FrozenStringLiteralComment: Description: Add the frozen_string_literal comment to the top of files to help transition from Ruby 2.3.0 to Ruby 3.0. Enabled: false - EnforcedStyle: when_needed - SupportedStyles: - - when_needed - - always + EnforcedStyle: always Style/GlobalVars: Description: Do not introduce global variables. @@ -922,20 +919,20 @@ Style/UnlessElse: Enabled: true # Supports --auto-correct -Style/UnneededCapitalW: +Style/RedundantCapitalW: Description: Checks for %W when interpolation is not needed. Enabled: false -Style/UnneededCondition: +Style/RedundantCondition: Enabled: false # Supports --auto-correct -Style/UnneededInterpolation: +Style/RedundantInterpolation: Description: Checks for strings that are just an interpolated expression. Enabled: false # Supports --auto-correct -Style/UnneededPercentQ: +Style/RedundantPercentQ: Description: Checks for %q/%Q when single quotes or double quotes would do. StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#percent-q Enabled: false From 784a4c8c6270ec1097ddda1fdead8ff929614ed0 Mon Sep 17 00:00:00 2001 From: zachary_sabin Date: Fri, 8 Nov 2019 16:21:45 -0800 Subject: [PATCH 05/18] remove duplicate rule --- rubocop-airbnb/config/rubocop-layout.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/rubocop-airbnb/config/rubocop-layout.yml b/rubocop-airbnb/config/rubocop-layout.yml index 12678ce..794405b 100644 --- a/rubocop-airbnb/config/rubocop-layout.yml +++ b/rubocop-airbnb/config/rubocop-layout.yml @@ -472,11 +472,6 @@ Layout/SpaceInsideBlockBraces: EnforcedStyleForEmptyBraces: no_space SpaceBeforeBlockParameters: true -Layout/SpaceInsideParens: - Description: 'No spaces after ( or before ).' - StyleGuide: '#spaces-braces' - Enabled: true - Layout/SpaceInsideArrayLiteralBrackets: EnforcedStyle: no_space SupportedStyles: From 1421a32c006150b49ba84e15d81b4028a425236c Mon Sep 17 00:00:00 2001 From: zachary_sabin Date: Fri, 8 Nov 2019 16:23:16 -0800 Subject: [PATCH 06/18] move flip flop to correct file --- rubocop-airbnb/config/rubocop-lint.yml | 5 +++++ rubocop-airbnb/config/rubocop-style.yml | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rubocop-airbnb/config/rubocop-lint.yml b/rubocop-airbnb/config/rubocop-lint.yml index b688796..db48dd6 100644 --- a/rubocop-airbnb/config/rubocop-lint.yml +++ b/rubocop-airbnb/config/rubocop-lint.yml @@ -80,6 +80,11 @@ Lint/EnsureReturn: Lint/ErbNewArguments: Enabled: false +Lint/FlipFlop: + Description: Checks for flip flops + StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-flip-flops + Enabled: false + Lint/FloatOutOfRange: Description: Catches floating-point literals too large or small for Ruby to represent. Enabled: false diff --git a/rubocop-airbnb/config/rubocop-style.yml b/rubocop-airbnb/config/rubocop-style.yml index 00fa8c0..435fa43 100644 --- a/rubocop-airbnb/config/rubocop-style.yml +++ b/rubocop-airbnb/config/rubocop-style.yml @@ -328,11 +328,6 @@ Style/ExpandPathArguments: Description: "Use `expand_path(__dir__)` instead of `expand_path('..', __FILE__)`." Enabled: false -Style/FlipFlop: - Description: Checks for flip flops - StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-flip-flops - Enabled: false - Style/For: Description: Checks use of for or each in multiline loops. StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-for-loops From 2bfe2db32803021b92e2570bb9477e95d290e027 Mon Sep 17 00:00:00 2001 From: zachary_sabin Date: Fri, 8 Nov 2019 16:26:09 -0800 Subject: [PATCH 07/18] transfer cops from performance.yml to style.yml --- rubocop-airbnb/config/rubocop-performance.yml | 19 ------------------- rubocop-airbnb/config/rubocop-style.yml | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/rubocop-airbnb/config/rubocop-performance.yml b/rubocop-airbnb/config/rubocop-performance.yml index c372ab5..067f3ba 100644 --- a/rubocop-airbnb/config/rubocop-performance.yml +++ b/rubocop-airbnb/config/rubocop-performance.yml @@ -56,11 +56,6 @@ Performance/FlatMap: Performance/InefficientHashSearch: Enabled: false -# Supports --auto-correct -Performance/LstripRstrip: - Description: Use `strip` instead of `lstrip.rstrip`. - Enabled: false - # Supports --auto-correct Performance/RangeInclude: Description: Use `Range#cover?` instead of `Range#include?`. @@ -85,11 +80,6 @@ Performance/RedundantMerge: Reference: https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code Enabled: false -# Supports --auto-correct -Performance/RedundantSortBy: - Description: Use `sort` instead of `sort_by { |x| x }`. - Enabled: false - Performance/RegexpMatch: Enabled: false @@ -99,12 +89,6 @@ Performance/ReverseEach: Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code Enabled: false -# Supports --auto-correct -Performance/Sample: - Description: Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[Fixnum]`. - Reference: https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code - Enabled: false - # Supports --auto-correct Performance/Size: Description: Use `size` instead of `count` for counting the number of elements in @@ -133,9 +117,6 @@ Performance/TimesMap: Performance/UnfreezeString: Enabled: false -Performance/UnneededSort: - Enabled: false - Performance/UriDefaultParser: Enabled: false diff --git a/rubocop-airbnb/config/rubocop-style.yml b/rubocop-airbnb/config/rubocop-style.yml index 435fa43..626ae87 100644 --- a/rubocop-airbnb/config/rubocop-style.yml +++ b/rubocop-airbnb/config/rubocop-style.yml @@ -727,6 +727,11 @@ Style/RedundantSelf: StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-self-unless-required Enabled: true +# Supports --auto-correct +Style/RedundantSortBy: + Description: Use `sort` instead of `sort_by { |x| x }`. + Enabled: false + # Supports --auto-correct Style/RegexpLiteral: Description: Use / or %r around regular expressions. @@ -755,6 +760,12 @@ Style/ReturnNil: Style/SafeNavigation: Enabled: false +# Supports --auto-correct +Style/Sample: + Description: Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[Fixnum]`. + Reference: https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code + Enabled: false + # Supports --auto-correct Style/SelfAssignment: Description: Checks for places where self-assignment shorthand should have been used. @@ -848,6 +859,11 @@ Style/StringMethods: PreferredMethods: intern: to_sym +# Supports --auto-correct +Style/Strip: + Description: Use `strip` instead of `lstrip.rstrip`. + Enabled: false + Style/StructInheritance: Description: Checks for inheritance from Struct.new. StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-extend-struct-new @@ -932,6 +948,9 @@ Style/RedundantPercentQ: StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#percent-q Enabled: false +Style/RedundantSort: + Enabled: false + Style/UnpackFirst: Enabled: false From b0a5edf645d2f893751651384fff81acd7595202 Mon Sep 17 00:00:00 2001 From: zachary_sabin Date: Fri, 8 Nov 2019 16:27:47 -0800 Subject: [PATCH 08/18] don't freeze since file has frozen string comment --- rubocop-airbnb/lib/rubocop/airbnb/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rubocop-airbnb/lib/rubocop/airbnb/version.rb b/rubocop-airbnb/lib/rubocop/airbnb/version.rb index 33db4c3..2f6d64e 100644 --- a/rubocop-airbnb/lib/rubocop/airbnb/version.rb +++ b/rubocop-airbnb/lib/rubocop/airbnb/version.rb @@ -3,6 +3,6 @@ module RuboCop module Airbnb # Version information for the the Airbnb RuboCop plugin. - VERSION = '2.0.0'.freeze + VERSION = '2.0.0' end end From 4a190d29669fa1c1560ee8bef3a5c153e02fd055 Mon Sep 17 00:00:00 2001 From: zachary_sabin Date: Fri, 8 Nov 2019 16:28:55 -0800 Subject: [PATCH 09/18] remove 2.2 from CI, add 2.6 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index de8b8d1..3826c47 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,10 @@ cache: bundler: true sudo: false rvm: - - 2.2 - 2.3 - 2.4 - 2.5 + - 2.6 install: - cd rubocop-airbnb - bundle install From 7a94864d5508416c093cbcf3757c290a78361be9 Mon Sep 17 00:00:00 2001 From: zachary_sabin Date: Fri, 8 Nov 2019 16:37:50 -0800 Subject: [PATCH 10/18] add Rails/IgnoredSkipActionFilterOption cop --- rubocop-airbnb/config/rubocop-rails.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rubocop-airbnb/config/rubocop-rails.yml b/rubocop-airbnb/config/rubocop-rails.yml index 1ba76e8..e6aebc9 100644 --- a/rubocop-airbnb/config/rubocop-rails.yml +++ b/rubocop-airbnb/config/rubocop-rails.yml @@ -206,3 +206,6 @@ Rails/Validation: Enabled: false Include: - app/models/**/*.rb + +Rails/IgnoredSkipActionFilterOption: + Enabled: true From 5493a81ec7b9cce7bd83d07d6329aeec1b3485f3 Mon Sep 17 00:00:00 2001 From: zachary_sabin Date: Fri, 8 Nov 2019 16:40:58 -0800 Subject: [PATCH 11/18] Remove Airbnb/ClassName cop, since that functionality is now included in RuboCop::Cop::Rails::ReflectionClassName --- rubocop-airbnb/config/rubocop-airbnb.yml | 5 -- rubocop-airbnb/config/rubocop-rails.yml | 3 + .../lib/rubocop/cop/airbnb/class_name.rb | 47 ----------- .../rubocop/cop/airbnb/class_name_spec.rb | 78 ------------------- 4 files changed, 3 insertions(+), 130 deletions(-) delete mode 100644 rubocop-airbnb/lib/rubocop/cop/airbnb/class_name.rb delete mode 100644 rubocop-airbnb/spec/rubocop/cop/airbnb/class_name_spec.rb diff --git a/rubocop-airbnb/config/rubocop-airbnb.yml b/rubocop-airbnb/config/rubocop-airbnb.yml index 01d342e..dbe7170 100644 --- a/rubocop-airbnb/config/rubocop-airbnb.yml +++ b/rubocop-airbnb/config/rubocop-airbnb.yml @@ -2,11 +2,6 @@ # They are custom built for use inside Airbnb and address issues that we have experienced in # testing and production. -Airbnb/ClassName: - Description: Use :class_name => "Model" instead of :class_name => Model.name - to avoid a long cascade of autoloading. - Enabled: true - Airbnb/ClassOrModuleDeclaredInWrongFile: Description: Declare a class or module in the file that matches its namespace and name. Enabled: true diff --git a/rubocop-airbnb/config/rubocop-rails.yml b/rubocop-airbnb/config/rubocop-rails.yml index e6aebc9..d19e331 100644 --- a/rubocop-airbnb/config/rubocop-rails.yml +++ b/rubocop-airbnb/config/rubocop-rails.yml @@ -209,3 +209,6 @@ Rails/Validation: Rails/IgnoredSkipActionFilterOption: Enabled: true + +Rails/ReflectionClassName: + Enabled: true diff --git a/rubocop-airbnb/lib/rubocop/cop/airbnb/class_name.rb b/rubocop-airbnb/lib/rubocop/cop/airbnb/class_name.rb deleted file mode 100644 index bf2dd65..0000000 --- a/rubocop-airbnb/lib/rubocop/cop/airbnb/class_name.rb +++ /dev/null @@ -1,47 +0,0 @@ -module RuboCop - module Cop - module Airbnb - # Cop to prevent cross-model references, which result in a cascade of autoloads. E.g., - # belongs_to :user, :class_name => User.name - class ClassName < Cop - MSG = 'Use "Model" instead of Model.name at class scope to avoid cross-model references. ' \ - 'They cause a long cascade of autoloading, slowing down app startup and slowing down ' \ - 'reloading of zeus after changing a model.'.freeze - - # Is this a has_many, has_one, or belongs_to with a :class_name arg? Make sure the - # class name is a hardcoded string. If not, add an offense and return true. - def on_send(node) - association_statement = - node.command?(:has_many) || - node.command?(:has_one) || - node.command?(:belongs_to) - - return unless association_statement - - class_pair = class_name_node(node) - - if class_pair && !string_class_name?(class_pair) - add_offense(class_pair) - end - end - - private - - # Return the descendant node that is a hash pair (:key => value) whose key - # is :class_name. - def class_name_node(node) - node.descendants.detect do |e| - e.is_a?(Parser::AST::Node) && - e.pair_type? && - e.children[0].children[0] == :class_name - end - end - - # Given a hash pair :class_name => value, is the value a hardcoded string? - def string_class_name?(class_pair) - class_pair.children[1].str_type? - end - end - end - end -end diff --git a/rubocop-airbnb/spec/rubocop/cop/airbnb/class_name_spec.rb b/rubocop-airbnb/spec/rubocop/cop/airbnb/class_name_spec.rb deleted file mode 100644 index 789ddea..0000000 --- a/rubocop-airbnb/spec/rubocop/cop/airbnb/class_name_spec.rb +++ /dev/null @@ -1,78 +0,0 @@ -describe RuboCop::Cop::Airbnb::ClassName do - subject(:cop) { described_class.new } - - describe "belongs_to" do - it 'rejects with Model.name' do - source = [ - 'class Coupon', - ' belongs_to :user, :class_name => User.name', - 'end', - ].join("\n") - inspect_source(source) - - expect(cop.offenses.size).to eq(1) - expect(cop.offenses.map(&:line).sort).to eq([2]) - end - - it 'passes with "Model"' do - source = [ - 'class Coupon', - ' belongs_to :user, :class_name => "User"', - 'end', - ].join("\n") - inspect_source(source) - - expect(cop.offenses).to be_empty - end - end - - describe "has_many" do - it 'rejects with Model.name' do - source = [ - 'class Coupon', - ' has_many :reservations, :class_name => Reservation2.name', - 'end', - ].join("\n") - inspect_source(source) - - expect(cop.offenses.size).to eq(1) - expect(cop.offenses.map(&:line)).to eq([2]) - end - - it 'passes with "Model"' do - source = [ - 'class Coupon', - ' has_many :reservations, :class_name => "Reservation2"', - 'end', - ].join("\n") - inspect_source(source) - - expect(cop.offenses).to be_empty - end - end - - describe "has_one" do - it 'rejects with Model.name' do - source = [ - 'class Coupon', - ' has_one :loss, :class_name => Payments::Loss.name', - 'end', - ].join("\n") - inspect_source(source) - - expect(cop.offenses.size).to eq(1) - expect(cop.offenses.map(&:line)).to eq([2]) - end - - it 'passes with "Model"' do - source = [ - 'class Coupon', - ' has_one :loss, :class_name => "Payments::Loss"', - 'end', - ].join("\n") - inspect_source(source) - - expect(cop.offenses).to be_empty - end - end -end From 81df1759d29ab82a57483ffce1f48064d33a3570 Mon Sep 17 00:00:00 2001 From: zachary_sabin Date: Fri, 8 Nov 2019 16:42:06 -0800 Subject: [PATCH 12/18] Disable Naming/RescuedExceptionsVariableName --- rubocop-airbnb/config/rubocop-naming.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rubocop-airbnb/config/rubocop-naming.yml b/rubocop-airbnb/config/rubocop-naming.yml index b447018..937cace 100644 --- a/rubocop-airbnb/config/rubocop-naming.yml +++ b/rubocop-airbnb/config/rubocop-naming.yml @@ -83,3 +83,6 @@ Naming/VariableName: Naming/VariableNumber: Enabled: false + +Naming/RescuedExceptionsVariableName: + Enabled: false From cb67d63237c88453812b6d0cf1e922537322360f Mon Sep 17 00:00:00 2001 From: zachary_sabin Date: Fri, 8 Nov 2019 16:45:39 -0800 Subject: [PATCH 13/18] add Layout/IndentFirstParameter cop --- rubocop-airbnb/config/rubocop-layout.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rubocop-airbnb/config/rubocop-layout.yml b/rubocop-airbnb/config/rubocop-layout.yml index 794405b..c41c16a 100644 --- a/rubocop-airbnb/config/rubocop-layout.yml +++ b/rubocop-airbnb/config/rubocop-layout.yml @@ -551,3 +551,6 @@ Layout/TrailingWhitespace: Description: Avoid trailing whitespace. StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-trailing-whitespace Enabled: true + +Layout/IndentFirstParameter: + Enabled: true From cb8d5997ec02cb021d588ddbc073e74321d618be Mon Sep 17 00:00:00 2001 From: zachary_sabin Date: Fri, 8 Nov 2019 16:48:32 -0800 Subject: [PATCH 14/18] explicitly enable Gemspec/RubyVersionGlobalsUsage --- rubocop-airbnb/config/rubocop-gemspec.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rubocop-airbnb/config/rubocop-gemspec.yml b/rubocop-airbnb/config/rubocop-gemspec.yml index 631a131..17cb6d8 100644 --- a/rubocop-airbnb/config/rubocop-gemspec.yml +++ b/rubocop-airbnb/config/rubocop-gemspec.yml @@ -7,3 +7,6 @@ Gemspec/RequiredRubyVersion: Enabled: false Include: - '**/*.gemspec' + +Gemspec/RubyVersionGlobalsUsage: + Enabled: true From c04fccff63dee6594484cd65f0b690af9437f785 Mon Sep 17 00:00:00 2001 From: zachary_sabin Date: Wed, 13 Nov 2019 08:49:39 -0800 Subject: [PATCH 15/18] show supported styles --- rubocop-airbnb/config/rubocop-style.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rubocop-airbnb/config/rubocop-style.yml b/rubocop-airbnb/config/rubocop-style.yml index 626ae87..c1f8a9c 100644 --- a/rubocop-airbnb/config/rubocop-style.yml +++ b/rubocop-airbnb/config/rubocop-style.yml @@ -355,6 +355,9 @@ Style/FrozenStringLiteralComment: Description: Add the frozen_string_literal comment to the top of files to help transition from Ruby 2.3.0 to Ruby 3.0. Enabled: false + SupportedStyles: + - always + - never EnforcedStyle: always Style/GlobalVars: From 944aac14339f1c7924ba360728a352eac58230e1 Mon Sep 17 00:00:00 2001 From: zachary_sabin Date: Wed, 13 Nov 2019 09:55:32 -0800 Subject: [PATCH 16/18] bump version --- rubocop-airbnb/lib/rubocop/airbnb/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rubocop-airbnb/lib/rubocop/airbnb/version.rb b/rubocop-airbnb/lib/rubocop/airbnb/version.rb index 2f6d64e..30c7ca6 100644 --- a/rubocop-airbnb/lib/rubocop/airbnb/version.rb +++ b/rubocop-airbnb/lib/rubocop/airbnb/version.rb @@ -3,6 +3,6 @@ module RuboCop module Airbnb # Version information for the the Airbnb RuboCop plugin. - VERSION = '2.0.0' + VERSION = '3.0.0' end end From 4591307364782f5e04f09ad7f4c1c8d751b4543e Mon Sep 17 00:00:00 2001 From: zachary_sabin Date: Wed, 13 Nov 2019 10:02:10 -0800 Subject: [PATCH 17/18] update changelog and readme --- rubocop-airbnb/CHANGELOG.md | 8 ++++++++ rubocop-airbnb/README.md | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/rubocop-airbnb/CHANGELOG.md b/rubocop-airbnb/CHANGELOG.md index f45b6cc..7d7fc95 100644 --- a/rubocop-airbnb/CHANGELOG.md +++ b/rubocop-airbnb/CHANGELOG.md @@ -1,3 +1,11 @@ +# 3.0.0 +* Update to rubocop 0.76 +* Enable Rails/IgnoredSkipActionFilterOption +* Enable Rails/ReflectionClassName +* Disable and delete Airbnb/ClassName +* Enable Layout/IndentFirstParameter +* Drop support for Ruby 2.2 + # 2.0.0 * Upgrade to rubocop-rspec 1.30.0, use ~> to allow for PATCH version flexibility * Upgrade to rubocop 0.58.0, use ~> to allow for PATCH version flexibility diff --git a/rubocop-airbnb/README.md b/rubocop-airbnb/README.md index d9b3be1..d30d4c5 100644 --- a/rubocop-airbnb/README.md +++ b/rubocop-airbnb/README.md @@ -15,6 +15,11 @@ Just put this in your `Gemfile` it depends on the appropriate version of rubocop gem 'rubocop-airbnb' ``` +Note: If you want to run with Ruby 2.2 you will need to set your version to 2 +``` +gem 'rubocop-airbnb' '~> 2' +``` + ## Usage You need to tell RuboCop to load the Airbnb extension. There are three From 39f16ea280c9d56eefa5141894ae8a69737dbdd1 Mon Sep 17 00:00:00 2001 From: zachary_sabin Date: Wed, 13 Nov 2019 10:11:57 -0800 Subject: [PATCH 18/18] add comma to readme --- rubocop-airbnb/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rubocop-airbnb/README.md b/rubocop-airbnb/README.md index d30d4c5..9a3cbe5 100644 --- a/rubocop-airbnb/README.md +++ b/rubocop-airbnb/README.md @@ -17,7 +17,7 @@ gem 'rubocop-airbnb' Note: If you want to run with Ruby 2.2 you will need to set your version to 2 ``` -gem 'rubocop-airbnb' '~> 2' +gem 'rubocop-airbnb', '~> 2' ``` ## Usage