Skip to content

Commit

Permalink
Merge pull request #558 from crystal-ameba/add-additional-call-names-…
Browse files Browse the repository at this point in the history
…to-chained-call-with-no-bang-rule
  • Loading branch information
Sija authored Jan 31, 2025
2 parents 59c11ff + 3ab67ec commit c973211
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ameba/rule/performance/chained_call_with_no_bang.cr
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module Ameba::Rule::Performance
# Enabled: true
# CallNames:
# - uniq
# - unstable_sort
# - sort
# - sort_by
# - shuffle
Expand All @@ -46,7 +47,7 @@ module Ameba::Rule::Performance
# All of those have bang method variants returning `self`
# and are not modifying the receiver type (like `compact` does),
# thus are safe to switch to the bang variant.
call_names %w[uniq sort sort_by shuffle reverse]
call_names %w[uniq unstable_sort sort sort_by shuffle reverse]
end

MSG = "Use bang method variant `%s!` after chained `%s` call"
Expand Down

0 comments on commit c973211

Please sign in to comment.