Skip to content

Releases: rubocop/rubocop-rails

RuboCop Rails 2.19.0

07 Apr 04:00
Compare
Choose a tag to compare

New features

  • #337: Add new Rails/ThreeStateBooleanColumn cop. (@fatkodima)
  • #45: Make Rails/Delegate aware of self. (@koic)

Bug fixes

  • #934: Fix a false negative for Rails/Output when print methods without arguments. (@koic)
  • #99: Fix a false positive for Rails/HttpPositionalArguments when using include Rack::Test::Methods. (@koic)
  • #501: Fix a false positive for Rails/OutputSafety when using html_safe for I18n methods. (@koic)
  • #860: Fix a false positive for Rails/Pluck when using regexp literal key for String#[]. (@koic)
  • #938: Fix an error for Rails/WhereNotWithMultipleConditions when using where.not.lt(condition) as a Mongoid API'. (@koic)
  • #941: Remove redundant config for Style/InverseMethods. (@koic)

Changes

  • #299: Add autocorrection for Rails/ReflectionClassName. (@tejasbubane)
  • #34: Allow CreateTableWithTimestamps when using id: false and not include timestamps. (@koic)
  • #694: Mark Rails/FindEach as unsafe. (@koic)
  • #940: Mark Rails/ResponseParsedBody as unsafe. (@koic)

RuboCop Rails 2.18 (a.k.a. Ruby 30th Anniversary Edition)

25 Feb 08:56
Compare
Choose a tag to compare

New features

Bug fixes

  • #824: Fix a false negative for Rails/ActionControllerTestCase when the class is namespaced. (@vlad-pisanov)
  • #909: Fix a false positive for Rails/ActionControllerFlashBeforeRender when using flash before redirect_to in if branch. (@koic)
  • #898: Fix a false positive for Rails/ActiveRecordAliases when arguments of update_attributes is empty. (@koic)
  • #920: Fix an error for Rails/NegateInclude when there is no receiver. (@fatkodima)
  • #931: Fix error in Rails/Presence when ternary operators are used in multiple lines. (@r7kamura)
  • #687: Fix Rails/HasManyOrHasOneDependent to correctly handle association methods with receiver. (@fatkodima)
  • #929: Prevent Rails/SquishedSQLHeredocs applying when single-line comments are present. (@john-h-k)
  • #887: Fix a false positive for Rails/NotNullColumn when adding a :virtual column. (@fatkodima)
  • #918: Fix Rails/FreezeTime running against Rails < 5.2 apps. (@DRBragg)
  • #895: Fix Rails/UnusedIgnoredColumns not recognizing columns added via +=. (@lucthev)

Changes

  • #263: Accept actions defined via alias in Rails/LexicallyScopedActionFilter. (@fatkodima)
  • #902: Ignore redirect method for Style/FormatStringToken by default. (@javierjulio)
  • #935: Make Style/InverseMethods aware of Active Support's present?, blank?, include?, and exclude? methods. (@koic)
  • #914: Make Style/InverseMethods aware of valid? and invalid? methods. (@koic)
  • #826: Mark Rails/Pluck as unsafe. (@fatkodima)
  • #896: Raise severity of Rails/ActiveRecordOverride, Rails/DeprecatedActiveModelErrorsMethods, Rails/DuplicateAssociation, Rails/DuplicateScope, Rails/TopLevelHashWithIndifferentAccess, and Rails/WhereNotWithMultipleConditions cops to warning. (@koic)

RuboCop Rails 2.17.4

25 Dec 06:15
Compare
Choose a tag to compare

Bug fixes

  • #870: Fix an error for Rails/RootPathnameMethods when using Rails.env argument within Dir.glob. (@koic)
  • #881: Fix a false positive for Rails/ActionControllerFlashBeforeRender when using flash in multiline rescue branch before redirect_to. (@gurix)
  • #871: Fix a false positive for Rails/WhereMissing when left_joins(:foo) and where(foos: {id: nil}) separated by or, and. (@ydah)
  • #875: Make Rails/RootPathnameMethods aware of enforced style of Style/StringLiterals. (@koic)
  • #882: Fix false positive for Rails/UniqueValidationWithoutIndex with :conditions option. (@etiennebarrie)
  • #821: Enhance Rails/TimeZone to accept methods with the :in timezone option. (@fatkodima)

Changes

RuboCop Rails 2.17.3

20 Nov 06:34
Compare
Choose a tag to compare

% cat relnotes/v2.17.3.md

Bug fixes

  • #843: Fix a false positive for Rails/ActionControllerFlashBeforeRender when using flash in multiline if branch before redirect_to. (@koic)
  • #841: Fix an error for Rails/ActionOrder when using unconventional order of multiple actions. (@koic)
  • #838: Fix an incorrect autocorrect for Rails/ActionOrder when using unconventional order of actions in conditions. (@koic)
  • #867: Fix autocorrection bug when ::Hash is used on Rails/IndexBy and Rails/IndexWith. (@r7kamura)
  • #848: Fix a false positive for Rails/FreezeTime when using travel_to with an argument of Time.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, and Rails/RequireDependency. (@r7kamura)
  • #850: Fix default configuration for Rails/I18nLazyLookup. (@vlad-pisanov)
  • #837: Fix incorrect autocorrection of Rails/ActionOrder about comments. (@r7kamura)
  • #855: Fix Rails/RootPathnameMethods autocorrection for Pathname calls without parens. (@gsamokovarov)
  • #868: Support :: prefixed constants on Rails/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, and Rails/TimeZoneAssignment. (@r7kamura)
  • #865: Support ::Rails and ::File on Rails/FilePath cop. (@r7kamura)

Changes

  • #862: Ignore if number of arguments does not match on Rails/DynamicFindBy. (@r7kamura)

RuboCop Rails 2.17.2

27 Oct 03:11
Compare
Choose a tag to compare

Bug fixes

  • #825: Fix a false positive for Rails/ActionControllerFlashBeforeRender when using condition before redirect_to. (@koic)
  • #833: Fix a false positive for Rails/Pluck when receiver is not block argument for []. (@koic)
  • #834: Fix an error for Rails/WhereNotWithMultipleConditions when using where.not with empty hash literal. (@koic)
  • #833: Fix a false positive for Rails/Pluck when using multiple block arguments. (@koic)

Changes

  • #832: Mark Rails/ActionControllerFlashBeforeRender, Rails/ActionControllerTestCase, and Rails/RootPathnameMethods cops as unsafe autocorrection. (@koic)

RuboCop Rails 2.17.1

25 Oct 03:30
Compare
Choose a tag to compare

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 2.17.0

22 Oct 03:59
Compare
Choose a tag to compare

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 2.16.1

17 Sep 06:54
Compare
Choose a tag to compare

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 2.16.0

09 Sep 09:51
Compare
Choose a tag to compare

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 2.15.2

07 Jul 01:50
Compare
Choose a tag to compare

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)