Skip to content

Commit

Permalink
[correct] lambda usage related offense
Browse files Browse the repository at this point in the history
  • Loading branch information
julienemo committed Apr 5, 2020
1 parent 36c210a commit 99f44e3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
9 changes: 0 additions & 9 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ Style/HashSyntax:
Exclude:
- 'Rakefile'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: line_count_dependent, lambda, literal
Style/Lambda:
Exclude:
- 'test/fixtures/on_calculation.ru'
- 'test/fixtures/pre_term.ru'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, Autocorrect.
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/on_calculation.ru
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
load File.expand_path('fixture_helper.rb', __dir__)

PumaWorkerKiller.config do |config|
config.on_calculation = lambda { |usage| puts("Current memory footprint: #{usage} mb") }
config.on_calculation = ->(usage) { puts("Current memory footprint: #{usage} mb") }
end
PumaWorkerKiller.start

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/pre_term.ru
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
load File.expand_path('fixture_helper.rb', __dir__)

PumaWorkerKiller.config do |config|
config.pre_term = lambda { |worker| puts("About to terminate worker: #{worker.inspect}") }
config.pre_term = ->(worker) { puts("About to terminate worker: #{worker.inspect}") }
end
PumaWorkerKiller.start

Expand Down

0 comments on commit 99f44e3

Please sign in to comment.