Releases: rubocop/rubocop-rails
Releases · rubocop/rubocop-rails
RuboCop Rails v2.35.3
Bug fixes
- #1630: Fix a false positive in
Rails/StrongParametersExpectwhen negatingparams[:key]with!, such as!params[:key]. (@koic) - #1629: Fix false positives in
Rails/StrongParametersExpectwhen using the safe navigation operator (&.) onparams[:key]. Autocorrectingparams[:key]&.downcasetoparams.expect(:key).downcasesilently changes behavior — a missing param goes from returningnilto raisingActionController::ParameterMissing. (@lucasmazza)
RuboCop Rails v2.35.2
Bug fixes
- #1625: Fix false positives in
Rails/StrongParametersExpectwhen using collection methods (such asdelete,keys,merge,slice,dig,fetch, ortransform_values) onparams[:key], as well as block-style calls such asparams[:key].each { ... }orparams[:key].map(&:to_s). (@koic) - #1627: Fix false positives in
Rails/StrongParametersExpectfor usages likeparams[:key].try(:method)andparams[:key].try!(:method). (@nicholasdower)
RuboCop Rails v2.35.1
Bug fixes
- #1616: Fix false positives in
Rails/StrongParametersExpectwhen using nil-safe conversion methods such asto_i,to_s,to_a,to_f, andto_honparams[:key]. (@koic) - #1622: Fix false positives in
Rails/StrongParametersExpectwhen using key-check methods such askey?,has_key?,include?, andmember?onparams[:key]. (@koic) - #1620: Fix false positives in
Rails/StrongParametersExpectwhen using type-check methods such asis_a?,kind_of?, andinstance_of?onparams[:key]. (@koic)
RuboCop Rails v2.35.0
Bug fixes
- #1595: Fix a false negative for
Rails/I18nLocaleTextswhen usingredirect_back_or_towith a flash message. (@55728) - #1587: Fix false positives for
Rails/Presencewith operator methods like<<,=~, and others. (@eugeneius) - #1586: Don't add unnecessary parentheses in
Rails/Presence. (@eugeneius) - #1602: Fix an error in
Rails/SelectMapwhen.selectappears inside a subquery in an argument. (@koic) - #1604: Allow
DatabaseTypeResolvableto fall back to anadapterconfiguration specified in asharedkey. (@codergeek121) - #1582: Fix a false negative where
localwas incorrectly treated as a known environment name when using==comparison inRails/UnknownEnv. (@lovro-bikic)
Changes
- #1571: Add more detection patterns on
Rails/ResponseParsedBody. (@r7kamura) - #1583: Extend
Rails/StrongParametersExpectto detectparams[:key]in method calls and raising finder methods. (@koic) - #1584: Add support for
casestatements toRails/UnknownEnv. (@lovro-bikic) - #1592: Fix false negative for
!=comparison inRails/UnknownEnv. (@lovro-bikic) - #1598: Use glob patterns compatible with Engine or Packwerk for cops targeting
spec/andtest/directories. (@y-yagi)
RuboCop Rails v2.34.3
RuboCop Rails v2.34.2
RuboCop Rails v2.34.1
Bug fixes
- #1556: Fix an error for
Rails/Envwhen assigningRails.env. (@koic) - #1557: Fix false positives for
Rails/Presencewith comparison and assignment operators. (@davidenglishmusic) - #1558: This PR fixes incorrect autocorrect for
Rails/RedirectBackOrTowhen additional options as double splat are used. (@koic) - #1561: Fix incorrect autocorrect for
Rails/RedirectBackOrTowhenfallback_locationargument is a hash and the call has no argument parentheses. (@koic)
RuboCop Rails v2.34.0
New features
- #1520: New
Rails/HttpStatusNameConsistencycop. (@tuxagon) - #1376: Add new
Rails/Envcop. (@cdudas17) - #1541: Add new
Rails/RedirectBackOrTocop to suggest usingredirect_back_or_toinstead ofredirect_backwithfallback_location. (@davidenglishmusic)
Bug fixes
- #1539: Fix an error in
Rails/ActionControllerFlashBeforeRenderwhenflashis used inside a block followed by method chaining. (@koic) - #1553: Fix false positives for
Rails/OutputSafetywhen using non-interpolated multiline heredoc. (@koic) - #1532: Fix false positives for
Rails/FindByOrAssignmentMemoizationwhen assigning a memoization instance variable atinitializemethod. (@koic) - #1549: Fix
Rails/InverseOfcop false positives when using dynamic association options. (@viralpraxis)
Changes
- #1537: Add
abortto theRails/Exitcop. (@adamstegman) - #932: Add support for chained method calls in
Rails/Presence. (@vlad-pisanov) - #1525: Change
Rails::HelperInstanceVariablenot to detect offenses for instance variables within classes. (@viralpraxis) - #1481: Recognize
Rails.env.to_syminRails/EnvironmentComparison. (@lovro-bikic)
RuboCop Rails v2.33.4
Bug fixes
- #1530: Fix an incorrect autocorrect for
Rails/FindByOrAssignmentMemoizationwhen using endless method definition. (@koic) - #1522: Fix an error for
Rails/FindBywhenwheretakes a block. (@earlopain) - #1182: Fix a false positive for
Rails/ActionControllerFlashBeforeRenderwhen flash is called in a block. (@5hun-s)
RuboCop Rails v2.33.3
Bug fixes
- #1516: Fix wrong autocorrect for
Rails/FindByOrAssignmentMemoization. (@earlopain)