Releases: rubocop/rubocop-rails
Releases · rubocop/rubocop-rails
RuboCop Rails 2.30.1
RuboCop Rails 2.30.0
New features
Bug fixes
- #1071: Fix
Rails/FilePathcop to correctly handleFile.joinwith variables and ignore leading and multiple slashes in string literal arguments forRails.root.joinandFile.join. (@ydakuka) - #912: Enhance
Rails/Delegateby adding delegation detection forself.class, constants, class variables, global variables, and instance variables. (@ydakuka)
RuboCop Rails 2.29.1
Bug fixes
- #1423: Fix an error for
Rails/StrongParametersExpectwhen usingpermitwith no arguments. (@koic) - #1417: Fix an incorrect autocorrect for
Rails/StrongParametersExpectwhen using a leading dot multiline call torequirewithpermit. (@koic) - #1356: Enhance
Rails/DuplicateAssociationto handle alias. (@ydakuka) - #1389: Handle
TypeErrorcaused by passing array literals as arguments toFilemethods inRails/FilePathcop. (@ydakuka) - #1389: Handle
TypeErrorcaused by passing array literals as arguments toFilemethods inRails/RootPathnameMethodscop. (@ydakuka) - #1228: Enhance
Rails/SaveBangto properly handle instance variables. (@ydakuka)
RuboCop Rails 2.29.0
New features
- #1407: Add new
Rails/MultipleRoutePathscop. (@koic) - #1358: Add new
Rails/StrongParametersExpectcop. (@koic)
Bug fixes
- #1409: Fix an error for
Rails/ReversibleMigrationwhen callingdrop_tablewithout any arguments. (@earlopain) - #1397: Fix an incorrect autocorrect for
Rails/TimeZonewhen Time.new has a string argument. (@mterada1228) - #1406: Fix autocorrection for
Rails/IndexByandRails/IndexWithwhenmap { ... }.to_his enclosed in another block. (@franzliedke, @eugeneius) - #1404: Update
Rails/IndexByandRails/IndexWithto support numbered block parameters. (@eugeneius) - #1405: Fix autocorrection for
Rails/IndexWithwhen the value is a hash literal without braces. (@koic, @eugeneius) - #1414: Fix
Rails/HttpPositionalArgumentscop false positives with arguments forwarding. (@viralpraxis)
Changes
RuboCop Rails 2.28.0
New features
Bug fixes
- #1390: Fix an incorrect autocorrect for
Rails/SelectMapwhenselecthas no receiver and method chains are used. (@masato-bkn) - #1382: Fix false negatives for
Rails/RedundantActiveRecordAllMethodwhen usingallmethod in block. (@masato-bkn) - #1397: Fix
Rails/FilePathcop error onjoinmethod with implicit receiver. (@viralpraxis) - #1398: Fix
Rails/FilePathcop error in case of extra operations inRails.rootinterpolation. (@viralpraxis) - #1392: Fix
Rails/FilePathcop error with rescuedRails.root. (@viralpraxis)
Changes
- #1388: Modify
Rails/Pluckto ignoremap/collectwhen used inside blocks to prevent potential N+1 queries. (@masato-bkn)
RuboCop Rails 2.27.0
Bug fixes
- #1377: Fix an error for
Rails/EnumSyntaxwhen positional arguments are used and options are not passed as keyword arguments. (@koic) - #1367: Fix
Rails/TimeZoneshould not report offense onString#to_timewith timezone specifier. (@armandmgt)
Changes
- #727: Disable
Rails/TransactionExitStatementon Rails >= 7.2. (@earlopain) - #1374: Change
Rails/EnvLocalto handle negated conditions. (@fatkodima) - #1195: Change
Rails/SelectMapto handle safe navigation operators. (@fatkodima)
RuboCop Rails 2.26.2
Bug fixes
- #1362: Fix false positives for
Rails/EnumSyntaxwhen using Ruby 2.7. (@koic) - #1269: Fix false positives for
Rails/ActionControllerFlashBeforeRenderin combination with implicit returns. (@earlopain) - #1326: Fix wrong autocorrect for
Rails/FilePathwhen passing an array toFile.join. (@earlopain)
Changes
- #1359: Support
filterinRails/CompactBlank. (@masato-bkn)
RuboCop Rails 2.26.1
Bug fixes
- #1343: Fix false negatives for
Rails/EnumSyntaxfor non-literal mappings. (@earlopain) - #1340: Fix a false positive for
Rails/WhereEquals,Rails/WhereNot, andRails/WhereRangewhen qualifying the database name. (@earlopain)
Changes
- #1342: Change
Rails/ApplicationRecordto ignore migrations. (@fatkodima) - #1350: Change
Rails/EnumSyntaxto autocorrect underscored options. (@fatkodima)
RuboCop Rails 2.26.0
New features
- #1238: Add new
Rails/EnumSyntaxcop. (@maxprokopiev, @koic) - #1309: Support Rails 7 syntax for
Rails/EnumHashcop. (@ytjmt) - #1298: Support Rails 7 syntax for
Rails/EnumUniquenesscop. (@ytjmt)
Bug fixes
- #1335: Fix an error for
Rails/BulkChangeTablewhen the block forchange_tableis empty. (@earlopain) - #1325: Fix an error for
Rails/RenderPlainTextwhen the content type is passed as a constant. (@earlopain) - #1337: Fix an error for
Rails/Validationwhen passing no arguments. (@earlopain) - #1330: Fix an error for
Rails/WhereNotwhen using placeholder without second argument. (@earlopain) - #1311: Fix false negatives for
Rails/ActionControllerFlashBeforeRenderwhen using implicit render or rescue blocks. (@tldn0718) - #1313: Fix false positives for
Rails/CompactBlankwhen usingcollection.reject!. (@koic) - #1319: Fix a false positive for
Rails/RedundantPresenceValidationOnBelongsTowhen removingpresencewould leave other non-validation options likeallow_blankwithout validations. (@earlopain) - #1306: Make
Rails/PluralizationGrammaraware of byte methods. (@earlopain) - #1302: Allow
paramsreceiver by default forStyle/CollectionMethods. (@koic) - #1321: Fix an error for
Rails/WhereEqualswhen the second argument is not yet typed (where("foo = ?", )). (@earlopain)
Changes
- #1308: Change
Rails/CompactBlankto handleselect(&:present?). (@fatkodima) - #1303: Change
Rails/IgnoredSkipActionFilterOptionto handle multiple callbacks. (@fatkodima) - #1199: Make
Rails/WhereEqualsaware ofwhere.not(...). (@earlopain) - #1003: Change
Rails/RootPathnameMethodsto detect offenses onDir.[]. (@r7kamura)
RuboCop Rails 2.25.1
Bug fixes
- #1280: Look for change_column_null for
Rails/BulkChangeTable. (@ccutrer) - #1299: Fix an error for
Rails/NotNullColumnwhen the block forchange_tableis empty. (@earlopain) - #1281: Fix
Rails/WhereRangeautocorrect for complex expressions. (@fatkodima) - #1282: Fix
Rails/WhereRangeto correctly handle template strings with extra spaces. (@fatkodima)
Changes
- #1295: Cover validates_comparison_of in
Rails/Validation. (@ChaelCodes) - #1288: Let
Rails/LinkToBlanklook intolink_to_ifandlink_to_unless, too. (@fwolfst) - #1286: Mark
Rails/SkipsModelValidationsas unsafe. (@koic) - #1283: Mark
Rails/WhereRangeas unsafe autocorrect. (@fatkodima)