rubocop-rails

A RuboCop extension focused on enforcing Rails best practices and coding conventions.

MIT License

Downloads
167.6M
Stars
790
Committers
252

Bot releases are visible (Hide)

rubocop-rails - RuboCop Rails 2.17.1

Published by koic almost 2 years ago

Bug fixes

  • #829: Revert "Extends Rails/HttpStatus cop to check routes.rb" introduced in 2.17.0. (@jdufresne)
  • #831: Fix a false positive for Rails/Pluck when using block argument in []. (@koic)
rubocop-rails - RuboCop Rails 2.17.0

Published by koic almost 2 years ago

New features

Bug fixes

  • #786: Fix a false negative for Rails/ActionControllerTestCase when extending ActionController::TestCase and having a method definition. (@koic)
  • #792: Fix a false negative for Rails/RedundantPresenceValidationOnBelongsTo when belongs_to at least one block and one hash like belongs_to :company, -> { where(foo: true) }, inverse_of: :employee. (@PedroAugustoRamalhoDuarte)
  • #781: Make Rails/DynamicFindBy aware of find_by_token_for. (@koic)
  • #809: Fix an error for Rails/FreezeTime when using travel_to without argument. (@koic)
  • #794: Fix an error for Rails/RedundantReceiverInWithOptions when calling a method with a receiver in with_options without block arguments. (@koic)
  • #782: Fix an incorrect autocorrect for Rails/EagerEvaluationLogMessage when using Style/MethodCallWithArgsParentheses's autocorrection together. (@koic)
  • #776: Fix an incorrect autocorrect for Rails/Presence when using arithmetic operation in else branch. (@koic)
  • #813: Fix errors that occur when unrelated tag is investigated by Rails/ContentTag. (@r7kamura)
  • #808: Fix false positive for Rails/ActionControllerFlashBeforeRender when render call precedes flash call. (@americodls)
  • #778: Fix a false positive for Rails/DynamicFindBy when using page.find_by_id as a Capybara testing API. (@koic)
  • #816: Fix an incorrect autocorrect for Rails/Presence when a right-hand side of the relational operator. (@ydah)

Changes

  • #779: Add mail to AllowedMethods of Style/SymbolProc. (@koic)
  • #796: Add several directories to Exclude to prevent slow investigation. (@koic)
  • #822: Extends Rails/HttpStatus cop to check routes.rb. (@anthony-robin)
  • #787: Make Rails/Pluck aware of all keys. (@koic)
  • #800: Make Rails/TimeZone aware of timezone UTF offset. (@inkstak)
rubocop-rails - RuboCop Rails 2.16.1

Published by koic about 2 years ago

Bug fixes

  • #769: Fix a false positive for Rails/FreezeTime when using travel_to with an argument of DateTime.new with arguments. (@koic)
  • #772: Fix a false positive for Rails/TopLevelHashWithIndifferentAccess when using HashWithIndifferentAccess under namespace module. (@koic)
  • #762: Fix an error for Rails/FreezeTime when using travel_to with an argument of current method without receiver. (@koic)
  • #764: Fix an incorrect autocorrect for Rails/FreezeTime when using travel_to with an argument of the current time and proc argument. (@koic)
  • #763: Mark Rails/RootPathnameMethods as unsafe and fix an incorrect autocorrect when using Dir.glob. (@koic)
rubocop-rails - RuboCop Rails 2.16.0

Published by koic about 2 years ago

New features

Bug fixes

  • #757: Fix a false positive for Rails/ReflectionClassName when using Ruby 3.1's hash shorthand syntax. (@koic)
  • #741: Fix a bad autocorrection for errors.details[:name] << value in Rails/DeprecatedActiveModelErrorsMethods. (@BrianHawley)
  • #742: Rails/DeprecatedActiveModelErrorsMethods was missing the deprecated values, to_h, and to_xml methods. (@BrianHawley)
  • #740: Fix a NoMethodError on nil for errors.keys in a model in Rails/DeprecatedActiveModelErrorsMethods. (@BrianHawley)
  • #753: Fix Rails/CompactBlank bug when offense is found in block. (@r7kamura)
  • #756: Fix incorrect documentation URLs when using rubocop --show-docs-url. (@r7kamura)
  • #754: Make Rails/RedundantReceiverInWithOptions and Rails/ReversibleMigration cops aware of numbered block parameter. (@koic)

Changes

  • #750: Deprecate IgnoredMethods option in integrate to AllowedMethods and AllowedPatterns option. (@koic)
  • #729: Change the minimum required rubocop dependency version to 1.31.0. (@pirj)
rubocop-rails - RuboCop Rails 2.15.2

Published by koic over 2 years ago

Bug fixes

  • #712: Fix false negative in Rails/Delegate when preceding nested class declares private or protected methods. (@Darhazer)
  • #737: Fix a false positive for Rails/DeprecatedActiveModelErrorsMethods when using keys method with Rails 6.0. (@koic)
  • #737: Make Rails/ExpandedDateRange aware beginning_of_week with an argument. (@koic)
  • #731: Fix an incorrect autocorrect for Rails/StripHeredoc. (@kazarin)
rubocop-rails - RuboCop Rails 2.15.1

Published by koic over 2 years ago

Bug fixes

  • #723: Fix include value in Rails/AttributeDefaultBlockValue. (@kkitadate)
  • #717: Fix an error for Rails/DeprecatedActiveModelErrorsMethods when root receiver is a variable. (@koic)
  • #719: Fix a false negative for Rails/FormattedS when using safe navigation operator. (@koic)
  • #725: Fix an incorrect autocorrect for Rails/DotSeparatedKeys when a key starts with dot. (@koic)
rubocop-rails - RuboCop Rails 2.15.0

Published by koic over 2 years ago

New features

  • #325: Add new Rails/DotSeparatedKeys cop. (@fatkodima)
  • #704: Add new Rails/StripHeredoc cop. (@koic)
  • #691: Add new Rails/ToFormattedS cop. (@koic)
  • #588: Add new Rails/RootPublicPath cop. (@leoarnold)
  • #702: Make keys method aware of Rails/DeprecatedActiveModelErrorsMethods cop. (@koic)
  • #688: Support autocorrection for Rails/DeprecatedActiveModelErrorsMethods. (@koic)

Bug fixes

  • #696: Fix a false negative for Rails/TransactionExitStatement when return is used in rescue. (@koic)
  • #700: Fix a false positive for Rails/FilePath when a list of paths separated by colon including Rails.root. (@tk0miya)
  • #680: Fix a false positive for Rails/ReversibleMigrationMethodDefinition when using an inner class. (@koic)
  • #692: Fix an error for Rails/UnusedIgnoredColumns when using no tables db/schema.rb. (@koic)
  • #707: Fix an error when a variable is passed to has_many or has_one with double splat. (@nobuyo)
  • #695: Fixes a false negative where the in_rescue? check would bypass situations where the return was inside a transaction but outside of a rescue. (@dorkrawk)
  • #703: Fix not autocorrected for Rails/DuplicateAssociation. (@ydah)
  • #708: Recover Ruby 2.2 code analysis using TargetRubyVersion: 2.2. (@koic)

Changes

  • #697: (Compatibility) Drop Ruby 2.5 support. (@koic)
  • #705: Add mailers to default filter/action callbacks cops. (@ojab)
  • #710: Rails/TransactionExitStatement - Inspect ActiveRecord::Locking::Pessimistic#with_lock too, as #with_lock opens a transaction. (@FunnyHector)
rubocop-rails - RuboCop Rails 2.14.2

Published by koic over 2 years ago

Bug fixes

  • #660: Fix a false positive for Rails/MigrationClassName when defining another class. (@koic)
  • #664: Fix a false positive for Rails/MigrationClassName when ActiveSupport::Inflector is applied to the class name and the case is different. (@koic)
  • #658: Fix a false positive for Rails/TransactionExitStatement when break is used in loop in transactions. (@koic)
  • #666: Fix an error for Rails/TransactionExitStatement when transaction block is empty. (@koic)
  • #673: Fix a false negative for Rails/TransactionExitStatement when return or throw is used in a block in transactions. (@Tietew)
  • #669: Fix a false positive for Rails/TransactionExitStatement when return is used in rescue. (@koic)
rubocop-rails - RuboCop Rails 2.14.1

Published by koic over 2 years ago

Bug fixes

  • #656: Ignore gem name in paths for Rails/MigrationClassName. (@sunny)
  • #657: Only consider migration classes for Rails/MigrationClassName. (@sunny)
rubocop-rails - RuboCop Rails 2.14.0

Published by koic over 2 years ago

New features

Bug fixes

  • #636: Fix a false positive for Rails/ContentTag when using tag method in config/puma.rb. (@koic)
  • #635: Handle t.remove with multiple columns in Rails/BulkChangeTable. (@eugeneius)

Changes

  • #646: Exclude db/schema.rb and db/[CONFIGURATION_NAMESPACE]_schema.rb by default. (@koic)
  • #650: Make Rails/CompactBlank aware of delete_if(&:blank). (@koic)
  • #631: Update Rails/Pluck to be aware of numblocks. (@sammiya)
rubocop-rails - RuboCop Rails 2.13.2

Published by koic almost 3 years ago

New features

Bug fixes

  • #620: Fix a false positive for Rails/RedundantPresenceValidationOnBelongsTo using presence with a message. (@koic)
  • #626: Fix a false positive for Rails/CompactBlank when using the receiver of blank? is not a block variable. (@koic)
  • #622: Add month(s) and year(s) to Rails/DurationArithmetic cop. (@agrobbin)
  • #623: Fix method shadowing check for Rails/ReadWriteAttribute cop. (@nvasilevski)

Changes

  • #615: Change Rails/RedundantPresenceValidationOnBelongsTo to SafeAutoCorrect: false. (@TonyArra)
  • #463: Support multiple databases for ReversibleMigration and ReversibleMigrationMethodDefinition cops. (@fatkodima)
rubocop-rails - RuboCop Rails 2.13.1

Published by koic almost 3 years ago

Bug fixes

  • #601: Handle ignored_columns from mixins for Rails/UnusedIgnoredColumns cop. (@tachyons)
  • #603: Fix autocorrection of multiple attributes for Rails/RedundantPresenceValidationOnBelongsTo cop. (@pirj)
  • #608: Fix autocorrection of strict validation for Rails/RedundantPresenceValidationOnBelongsTo cop. (@pirj)

Changes

  • #585: Make Rails/ReadWriteAttribute cop aware of shadowing methods. (@drenmi)
  • #604: Remove remove_reference and remove_belongs_to methods from Rails/ReversibleMigration cop offenses. (@TonyArra)
rubocop-rails - RuboCop Rails 2.13.0

Published by koic almost 3 years ago

New features

Changes

  • #591: Add change_column check to Rails/ReversibleMigration. (@mattmccormick)
  • Add remove_reference check to Rails/ReversibleMigration. (@mattmccormick)
  • #576: Mark Rails/TimeZone as unsafe auto-correction from unsafe. (@koic)
  • #582: Unmark AutoCorrect: false from Rails/RelativeDateConstant. (@koic)
  • #580: Unmark AutoCorrect: false from Rails/UniqBeforePluck. (@koic)
rubocop-rails - RuboCop Rails 2.12.4

Published by koic about 3 years ago

Bug fixes

  • #573: Fix an error for Rails/FindEach when using where with no receiver. (@koic)
rubocop-rails - RuboCop Rails 2.12.3

Published by koic about 3 years ago

Bug fixes

  • #556: Fix a false positive for Rails/ContentTag when using using the tag method with 3 or more arguments. (@koic)
  • #551: Fix a false positive for Rails/FindEach when using model.errors.where in Rails 6.1. (@koic)
  • #543: Fix an error for Rails/ContentTag when tag is not a top-level method. (@koic)
  • #559: Fix an error for Rails/RelativeDateConstant when using multiple assignment. (@koic)
  • #553: Fix a false positive for Rails/ReversibleMigration when using t.remove with type option in Rails 6.1. (@koic)

Changes

  • #546: Exclude app/models by default for Rails/ContentTag. (@koic)
  • #570: Make Rails/CreateTableWithTimestamps respect active_storage_variant_records table of db/migrate/*_create_active_storage_tables.active_storage.rb auto-generated by bin/rails active_storage:install even if created_at is not specified. (@koic)
rubocop-rails - RuboCop Rails 2.12.2

Published by koic about 3 years ago

Bug fixes

  • #541: Fix an error for Rails/HasManyOrHasOneDependent when using lambda argument and specifying :dependent strategy. (@koic)
rubocop-rails - RuboCop Rails 2.12.1

Published by koic about 3 years ago

Bug fixes

  • #535: Fix an error for Rails/HasManyOrHasOneDependent when using lambda argument and not specifying any options. (@koic)
rubocop-rails - RuboCop Rails 2.12.0

Published by koic about 3 years ago

New features

  • #521: Support auto-correction for Rails/Output. (@koic)
  • #520: Support auto-correction for Rails/ScopeArgs. (@koic)
  • #524: Add new Rails/RedundantTravelBack cop. (@koic)

Bug fixes

  • #528: Fix a false positive for Rails/HasManyOrHasOneDependent when specifying :dependent strategy with double splat. (@koic)
  • #529: Fix a false positive for Rails/LexicallyScopedActionFilter when action method is aliased by alias_method. (@koic)
  • #532: Fix a false positive for Rails/HttpPositionalArguments when defining get in Rails.application.routes.draw block. (@koic)

Changes

  • #260: Change target of Rails/ContentTag from content_tag method to tag method. (@tabuchi0919)
rubocop-rails - RuboCop Rails 2.11.3

Published by koic over 3 years ago

Bug fixes

  • #517: Fix an issue for Rails/UniqueValidationWithoutIndex when validating uniqueness with a polymorphic scope. (@theunraveler)
rubocop-rails - RuboCop Rails 2.11.2

Published by koic over 3 years ago

Bug fixes

  • #515: Fix an error for Rails/BulkChangeTable when using Psych 4.0. (@koic)
  • #512: Fix a false positive for Rails/FindBy when using take with arguments. (@koic)