Releases: rubocop/rubocop-rails
Releases · rubocop/rubocop-rails
RuboCop Rails 2.17.1
Bug fixes
- #829: Revert "Extends
Rails/HttpStatuscop to checkroutes.rb" introduced in 2.17.0. (@jdufresne) - #831: Fix a false positive for
Rails/Pluckwhen using block argument in[]. (@koic)
RuboCop Rails 2.17.0
New features
- #547: Add new
Rails/ActionOrdercop. (@mollerhoj) - #565: Add cop Rails/WhereNotWithMultipleConditions. (@niklas-hasselmeyer)
- #771: Add new
Rails/IgnoredColumnsAssignmentcop. (@fsateler, @kkitadate) - #790: Make
Style/HashExceptaware of TargetRubyVersion: 2.x because Rails hasHash#except. (@koic)
Bug fixes
- #786: Fix a false negative for
Rails/ActionControllerTestCasewhen extendingActionController::TestCaseand having a method definition. (@koic) - #792: Fix a false negative for
Rails/RedundantPresenceValidationOnBelongsTowhen belongs_to at least one block and one hash likebelongs_to :company, -> { where(foo: true) }, inverse_of: :employee. (@PedroAugustoRamalhoDuarte) - #781: Make
Rails/DynamicFindByaware offind_by_token_for. (@koic) - #809: Fix an error for
Rails/FreezeTimewhen usingtravel_towithout argument. (@koic) - #794: Fix an error for
Rails/RedundantReceiverInWithOptionswhen calling a method with a receiver inwith_optionswithout block arguments. (@koic) - #782: Fix an incorrect autocorrect for
Rails/EagerEvaluationLogMessagewhen usingStyle/MethodCallWithArgsParentheses's autocorrection together. (@koic) - #776: Fix an incorrect autocorrect for
Rails/Presencewhen using arithmetic operation inelsebranch. (@koic) - #813: Fix errors that occur when unrelated
tagis investigated byRails/ContentTag. (@r7kamura) - #808: Fix false positive for
Rails/ActionControllerFlashBeforeRenderwhenrendercall precedesflashcall. (@americodls) - #778: Fix a false positive for
Rails/DynamicFindBywhen usingpage.find_by_idas a Capybara testing API. (@koic) - #816: Fix an incorrect autocorrect for
Rails/Presencewhen a right-hand side of the relational operator. (@ydah)
Changes
- #779: Add
mailtoAllowedMethodsofStyle/SymbolProc. (@koic) - #796: Add several directories to
Excludeto prevent slow investigation. (@koic) - #822: Extends
Rails/HttpStatuscop to checkroutes.rb. (@anthony-robin) - #787: Make
Rails/Pluckaware of all keys. (@koic) - #800: Make
Rails/TimeZoneaware of timezone UTF offset. (@inkstak)
RuboCop Rails 2.16.1
Bug fixes
- #769: Fix a false positive for
Rails/FreezeTimewhen usingtravel_towith an argument ofDateTime.newwith arguments. (@koic) - #772: Fix a false positive for
Rails/TopLevelHashWithIndifferentAccesswhen usingHashWithIndifferentAccessunder namespace module. (@koic) - #762: Fix an error for
Rails/FreezeTimewhen usingtravel_towith an argument ofcurrentmethod without receiver. (@koic) - #764: Fix an incorrect autocorrect for
Rails/FreezeTimewhen usingtravel_towith an argument of the current time and proc argument. (@koic) - #763: Mark
Rails/RootPathnameMethodsas unsafe and fix an incorrect autocorrect when usingDir.glob. (@koic)
RuboCop Rails 2.16.0
New features
- #714: Add new
Rails/FreezeTimecop. (@ydah) - #744: Add new
Rails/WhereMissingcop. (@ydah) - #587: Add new
Rails/RootPathnameMethodscop. (@leoarnold) - #752: Add
Rails/TopLevelHashWithIndifferentAccesscop. (@r7kamura) - #759: Add new
Rails/ActionControllerFlashBeforeRendercop. (@americodls) - #749: Add new
Rails/ActiveSupportOnLoadcop. (@bdewater) - #747: Add
Rails/ToSWithArgumentcop. (@r7kamura) - #746: Enable
ActiveSupportExtensionsEnabledoption by default. (@koic)
Bug fixes
- #757: Fix a false positive for
Rails/ReflectionClassNamewhen using Ruby 3.1's hash shorthand syntax. (@koic) - #741: Fix a bad autocorrection for
errors.details[:name] << valuein Rails/DeprecatedActiveModelErrorsMethods. (@BrianHawley) - #742: Rails/DeprecatedActiveModelErrorsMethods was missing the deprecated
values,to_h, andto_xmlmethods. (@BrianHawley) - #740: Fix a NoMethodError on nil for
errors.keysin a model in Rails/DeprecatedActiveModelErrorsMethods. (@BrianHawley) - #753: Fix
Rails/CompactBlankbug when offense is found in block. (@r7kamura) - #756: Fix incorrect documentation URLs when using
rubocop --show-docs-url. (@r7kamura) - #754: Make
Rails/RedundantReceiverInWithOptionsandRails/ReversibleMigrationcops aware of numbered block parameter. (@koic)
Changes
RuboCop Rails 2.15.2
Bug fixes
- #712: Fix false negative in
Rails/Delegatewhen preceding nested class declares private or protected methods. (@Darhazer) - #737: Fix a false positive for
Rails/DeprecatedActiveModelErrorsMethodswhen usingkeysmethod with Rails 6.0. (@koic) - #737: Make
Rails/ExpandedDateRangeawarebeginning_of_weekwith an argument. (@koic) - #731: Fix an incorrect autocorrect for
Rails/StripHeredoc. (@kazarin)
RuboCop Rails 2.15.1
Bug fixes
- #723: Fix include value in
Rails/AttributeDefaultBlockValue. (@kkitadate) - #717: Fix an error for
Rails/DeprecatedActiveModelErrorsMethodswhen root receiver is a variable. (@koic) - #719: Fix a false negative for
Rails/FormattedSwhen using safe navigation operator. (@koic) - #725: Fix an incorrect autocorrect for
Rails/DotSeparatedKeyswhen a key starts with dot. (@koic)
RuboCop Rails 2.15.0
New features
- #325: Add new
Rails/DotSeparatedKeyscop. (@fatkodima) - #704: Add new
Rails/StripHeredoccop. (@koic) - #691: Add new
Rails/ToFormattedScop. (@koic) - #588: Add new
Rails/RootPublicPathcop. (@leoarnold) - #702: Make
keysmethod aware ofRails/DeprecatedActiveModelErrorsMethodscop. (@koic) - #688: Support autocorrection for
Rails/DeprecatedActiveModelErrorsMethods. (@koic)
Bug fixes
- #696: Fix a false negative for
Rails/TransactionExitStatementwhenreturnis used inrescue. (@koic) - #700: Fix a false positive for
Rails/FilePathwhen a list of paths separated by colon including Rails.root. (@tk0miya) - #680: Fix a false positive for
Rails/ReversibleMigrationMethodDefinitionwhen using an inner class. (@koic) - #692: Fix an error for
Rails/UnusedIgnoredColumnswhen 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
RuboCop Rails 2.14.2
Bug fixes
- #660: Fix a false positive for
Rails/MigrationClassNamewhen defining another class. (@koic) - #664: Fix a false positive for
Rails/MigrationClassNamewhenActiveSupport::Inflectoris applied to the class name and the case is different. (@koic) - #658: Fix a false positive for
Rails/TransactionExitStatementwhenbreakis used inloopin transactions. (@koic) - #666: Fix an error for
Rails/TransactionExitStatementwhen transaction block is empty. (@koic) - #673: Fix a false negative for
Rails/TransactionExitStatementwhenreturnorthrowis used in a block in transactions. (@Tietew) - #669: Fix a false positive for
Rails/TransactionExitStatementwhenreturnis used inrescue. (@koic)
RuboCop Rails 2.14.1
RuboCop Rails 2.14.0
New features
- #624: Add new
Rails/I18nLocaleTextscop. (@fatkodima) - #326: Add new
Rails/I18nLazyLookupcop. (@fatkodima) - #644: Add new
Rails/MigrationClassNamecop. (@johnny-miyake) - #599: Add new
Rails/DuplicateAssociationcop. (@natematykiewicz) - #427: Add
Rails/DuplicateScopecop. (@natematykiewicz) - #642: New cop
Rails/TransactionExitStatementto disallowreturn,breakandthrowin transactions. (@teckwan) - #491: New
Rails/DeprecatedActiveModelErrorsMethodscop. (@lulalala) - #638: Add new
Rails/ActionControllerTestCasecop. (@gmcgibbon) - #574: Add new
Rails/TableNameAssignmentcop. (@MaximeDucheneS)
Bug fixes
- #636: Fix a false positive for
Rails/ContentTagwhen usingtagmethod in config/puma.rb. (@koic) - #635: Handle
t.removewith multiple columns inRails/BulkChangeTable. (@eugeneius)