diff --git a/Gemfile.lock b/Gemfile.lock index 43ed0519..77a4874c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,9 +2,9 @@ PATH remote: . specs: rubocop-github (0.27.0) - rubocop (>= 1.76) + rubocop (>= 1.91) rubocop-performance (>= 1.24) - rubocop-rails (>= 2.23) + rubocop-rails (>= 2.34) GEM remote: https://rubygems.org/ diff --git a/config/default.yml b/config/default.yml index 4c36733a..0a22d612 100644 --- a/config/default.yml +++ b/config/default.yml @@ -412,6 +412,9 @@ Lint/ConstantOverwrittenInRescue: Lint/ConstantResolution: Enabled: false +Lint/CopDirectiveSyntax: + Enabled: false + Lint/Debugger: Enabled: true @@ -1149,9 +1152,6 @@ Style/Documentation: Style/DocumentationMethod: Enabled: false -Style/DoubleCopDisableDirective: - Enabled: false - Style/DoubleNegation: Enabled: false diff --git a/config/default_pending.yml b/config/default_pending.yml index 5ae412d3..40b7f14e 100644 --- a/config/default_pending.yml +++ b/config/default_pending.yml @@ -112,5 +112,89 @@ Style/SendWithLiteralMethodName: # new in 1.64 Enabled: false Style/SuperArguments: # new in 1.64 Enabled: false +Gemspec/AttributeAssignment: # new in 1.77 + Enabled: true +Layout/EmptyLinesAfterModuleInclusion: # new in 1.79 + Enabled: true +Lint/ArgumentMismatch: # new in 1.90 + Enabled: true +Lint/ArrayLiteralInRegexp: # new in 1.71 + Enabled: true +Lint/DataDefineOverride: # new in 1.85 + Enabled: true +Lint/DeprecatedReference: # new in 1.89 + Enabled: true +Lint/MisplacedMagicComment: # new in 1.91 + Enabled: true +Lint/NameTypo: # new in 1.89 + Enabled: true +Lint/RedundantTypeConversion: # new in 1.72 + Enabled: true +Lint/SuperArgumentMismatch: # new in 1.90 + Enabled: true +Lint/SuppressedExceptionInNumberConversion: # new in 1.72 + Enabled: true +Lint/UnreachablePatternBranch: # new in 1.85 + Enabled: true +Lint/UselessConstantScoping: # new in 1.72 + Enabled: true +Lint/UselessDefaultValueArgument: # new in 1.76 + Enabled: true +Lint/UselessOr: # new in 1.76 + Enabled: true +Naming/PredicateMethod: # new in 1.76 + Enabled: true +Style/ArrayIntersectWithSingleElement: # new in 1.81 + Enabled: true +Style/CollectionQuerying: # new in 1.77 + Enabled: true +Style/ComparableBetween: # new in 1.74 + Enabled: true +Style/DirectiveScope: # new in 1.90 + Enabled: true +Style/EmptyClassDefinition: # new in 1.84 + Enabled: true +Style/EmptyStringInsideInterpolation: # new in 1.76 + Enabled: true +Style/FileOpen: # new in 1.85 + Enabled: true +Style/HashFetchChain: # new in 1.75 + Enabled: true +Style/HashSlice: # new in 1.71 + Enabled: true +Style/ItBlockParameter: # new in 1.75 + Enabled: true +Style/MapJoin: # new in 1.85 + Enabled: true +Style/ModuleMemberExistenceCheck: # new in 1.82 + Enabled: true +Style/NegativeArrayIndex: # new in 1.84 + Enabled: true +Style/OneClassPerFile: # new in 1.85 + Enabled: true +Style/PartitionInsteadOfDoubleSelect: # new in 1.85 + Enabled: true +Style/PredicateWithKind: # new in 1.85 + Enabled: true +Style/ReduceToHash: # new in 1.85 + Enabled: true +Style/RedundantArrayFlatten: # new in 1.76 + Enabled: true +Style/RedundantFormat: # new in 1.72 + Enabled: true +Style/RedundantMinMaxBy: # new in 1.85 + Enabled: true +Style/ReverseFind: # new in 1.84 + Enabled: true +Style/SelectByKind: # new in 1.85 + Enabled: true +Style/SelectByRange: # new in 1.85 + Enabled: true +Style/TallyMethod: # new in 1.85 + Enabled: true +Style/TimeNow: # new in 1.90 + Enabled: true Performance/StringBytesize: # new in 1.23 Enabled: false +Performance/ZipWithoutBlock: # new in 1.24 + Enabled: true diff --git a/config/rails_pending.yml b/config/rails_pending.yml index 941a743c..9d45fc23 100644 --- a/config/rails_pending.yml +++ b/config/rails_pending.yml @@ -100,3 +100,15 @@ Rails/EnumSyntax: # new in 2.26 Enabled: false Rails/WhereRange: # new in 2.25 Enabled: false +Rails/FindByOrAssignmentMemoization: # new in 2.33 + Enabled: true +Rails/HttpStatusNameConsistency: # new in 2.34 + Enabled: true +Rails/MultipleRoutePaths: # new in 2.29 + Enabled: true +Rails/OrderArguments: # new in 2.33 + Enabled: true +Rails/RedirectBackOrTo: # new in 2.34 + Enabled: true +Rails/StrongParametersExpect: # new in 2.29 + Enabled: true diff --git a/lib/rubocop/cop/github/rails_view_render_literal.rb b/lib/rubocop/cop/github/rails_view_render_literal.rb index 357b2ee1..15d57d5d 100644 --- a/lib/rubocop/cop/github/rails_view_render_literal.rb +++ b/lib/rubocop/cop/github/rails_view_render_literal.rb @@ -52,7 +52,10 @@ def on_send(node) return end + # `many?` is an ActiveSupport extension, but this cop runs without ActiveSupport. + # rubocop:disable Style/CollectionQuerying if render_literal?(node) && node.arguments.count > 1 + # rubocop:enable Style/CollectionQuerying locals = node.arguments[1] elsif option_pairs = render_with_options?(node) locals = option_pairs.map { |pair| locals_key?(pair) }.compact.first diff --git a/rubocop-github.gemspec b/rubocop-github.gemspec index 65050d08..60da692e 100644 --- a/rubocop-github.gemspec +++ b/rubocop-github.gemspec @@ -18,11 +18,11 @@ Gem::Specification.new do |s| s.files = Dir["README.md", "STYLEGUIDE.md", "LICENSE", "config/*.yml", "lib/**/*.rb", "guides/*.md"] - s.required_ruby_version = ">= 3.3.0" + s.required_ruby_version = ">= 3.4.2" - s.add_dependency "rubocop", ">= 1.76" + s.add_dependency "rubocop", ">= 1.91" s.add_dependency "rubocop-performance", ">= 1.24" - s.add_dependency "rubocop-rails", ">= 2.23" + s.add_dependency "rubocop-rails", ">= 2.34" s.add_development_dependency "actionview", "~> 8.1.3" s.add_development_dependency "minitest"