Releases: rubocop/rubocop-rails
Releases · rubocop/rubocop-rails
RuboCop Rails 2.17.4
Bug fixes
- #870: Fix an error for
Rails/RootPathnameMethodswhen usingRails.envargument withinDir.glob. (@koic) - #881: Fix a false positive for
Rails/ActionControllerFlashBeforeRenderwhen usingflashin multilinerescuebranch beforeredirect_to. (@gurix) - #871: Fix a false positive for
Rails/WhereMissingwhenleft_joins(:foo)andwhere(foos: {id: nil})separated byor,and. (@ydah) - #875: Make
Rails/RootPathnameMethodsaware of enforced style ofStyle/StringLiterals. (@koic) - #882: Fix false positive for
Rails/UniqueValidationWithoutIndexwith :conditions option. (@etiennebarrie) - #821: Enhance
Rails/TimeZoneto accept methods with the:intimezone option. (@fatkodima)
Changes
- #880: Add Rails/I18nLocaleTexts match for redirect_back. (@bensheldon)
RuboCop Rails 2.17.3
% cat relnotes/v2.17.3.md
Bug fixes
- #843: Fix a false positive for
Rails/ActionControllerFlashBeforeRenderwhen usingflashin multilineifbranch beforeredirect_to. (@koic) - #841: Fix an error for
Rails/ActionOrderwhen using unconventional order of multiple actions. (@koic) - #838: Fix an incorrect autocorrect for
Rails/ActionOrderwhen using unconventional order of actions in conditions. (@koic) - #867: Fix autocorrection bug when
::Hashis used onRails/IndexByandRails/IndexWith. (@r7kamura) - #848: Fix a false positive for
Rails/FreezeTimewhen usingtravel_towith an argument ofTime.new(...).in_time_zone. (@koic) - #869: Fix false-positives that non Rails formats are offended on
Rails/ToSWithArgument. (@r7kamura) - #866: Fix false-positives when constant is used with receiver on
Rails/DurationArithmetic,Rails/IndexBy,Rails/IndexWIth, andRails/RequireDependency. (@r7kamura) - #850: Fix default configuration for
Rails/I18nLazyLookup. (@vlad-pisanov) - #837: Fix incorrect autocorrection of
Rails/ActionOrderabout comments. (@r7kamura) - #855: Fix Rails/RootPathnameMethods autocorrection for Pathname calls without parens. (@gsamokovarov)
- #868: Support
::prefixed constants onRails/ActionControllerFlashBeforeRender,Rails/ActionControllerTestCase,Rails/ApplicationController,Rails/ApplicationJob,Rails/ApplicationMailer,Rails/ApplicationRecord,Rails/DotSeparatedKeys,Rails/DynamicFindBy,Rails/FindEach,Rails/FreezeTime,Rails/HasManyOrHasOneDependent,Rails/HelperInstanceVariable,Rails/MailerName,Rails/MigrationClassName,Rails/Output,Rails/ReversibleMigrationMethodDefinition,Rails/ReversibleMigration,Rails/ShortI18n,Rails/SkipsModelValidations, andRails/TimeZoneAssignment. (@r7kamura) - #865: Support
::Railsand::FileonRails/FilePathcop. (@r7kamura)
Changes
RuboCop Rails 2.17.2
Bug fixes
- #825: Fix a false positive for
Rails/ActionControllerFlashBeforeRenderwhen using condition beforeredirect_to. (@koic) - #833: Fix a false positive for
Rails/Pluckwhen receiver is not block argument for[]. (@koic) - #834: Fix an error for
Rails/WhereNotWithMultipleConditionswhen usingwhere.notwith empty hash literal. (@koic) - #833: Fix a false positive for
Rails/Pluckwhen using multiple block arguments. (@koic)
Changes
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)