Skip to content

Commit 16dbf5b

Browse files
committed
Fix rubocop failures
1 parent 2033681 commit 16dbf5b

7 files changed

Lines changed: 35 additions & 29 deletions

File tree

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ Style/FrozenStringLiteralComment:
2525
Naming/FileName:
2626
Exclude:
2727
- lib/flatware-*.rb
28+
Naming/PredicateMethod:
29+
Exclude:
30+
- lib/flatware/sink.rb
2831
Style/Documentation:
2932
Enabled: false
3033
Metrics/BlockLength:

lib/flatware/cucumber/formatters/console/summary.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module Formatters
77
class Console
88
class Summary
99
include ::Cucumber::Formatter::Console
10+
1011
attr_reader :io, :steps, :scenarios
1112

1213
def initialize(steps, scenarios = [], io = StringIO.new)

lib/flatware/pid.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ def self.ps
2727
.popen(['ps', *args])
2828
.readlines
2929
.map do |row|
30-
fields = row.strip.split(/\s+/, 4)
31-
new(*fields.take(3).map(&:to_i), fields.last)
32-
end
30+
fields = row.strip.split(/\s+/, 4)
31+
new(*fields.take(3).map(&:to_i), fields.last)
32+
end
3333
end
3434

3535
def pids_of_group(group_pid)

lib/flatware/rspec/formatters/console.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ def spec_list(remaining)
6363
remaining
6464
.flat_map(&:id).sort.each_with_index
6565
.map do |example, index|
66-
format(
67-
'%<index>4d) %<example>s',
68-
index: index.next,
69-
example: example
70-
)
71-
end.join("\n")
66+
format(
67+
'%<index>4d) %<example>s',
68+
index: index.next,
69+
example: example
70+
)
71+
end.join("\n")
7272
end
7373

7474
def colorizer

lib/flatware/rspec/job_builder.rb

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module RSpec
99
# and attempts to ballence the jobs accordingly.
1010
class JobBuilder
1111
extend Forwardable
12+
1213
attr_reader :args, :workers, :configuration
1314

1415
def_delegators(
@@ -54,12 +55,12 @@ def timed_and_untimed_files(seconds_per_file)
5455
files_to_run
5556
.map(&method(:normalize_path))
5657
.reduce([[], []]) do |(timed, untimed), file|
57-
if (time = seconds_per_file[file])
58-
[timed + [[file, time]], untimed]
59-
else
60-
[timed, untimed + [file]]
58+
if (time = seconds_per_file[file])
59+
[timed + [[file, time]], untimed]
60+
else
61+
[timed, untimed + [file]]
62+
end
6163
end
62-
end
6364
end
6465

6566
def normalize_path(path)
@@ -73,14 +74,15 @@ def load_persisted_example_statuses
7374
end
7475

7576
def sum_seconds(statuses)
76-
statuses.select(&passing)
77-
.map { |example| parse_example(**example) }
78-
.reduce({}) do |times, example|
79-
times.merge(
80-
example.fetch(:file_name) => example.fetch(:seconds)
81-
) do |_, old = 0, new|
82-
old + new
83-
end
77+
statuses
78+
.select(&passing)
79+
.map { |example| parse_example(**example) }
80+
.reduce({}) do |times, example|
81+
times.merge(
82+
example.fetch(:file_name) => example.fetch(:seconds)
83+
) do |_, old = 0, new|
84+
old + new
85+
end
8486
end
8587
end
8688

@@ -109,10 +111,10 @@ def balance_by(count, items, &block)
109111
.sort_by(&block)
110112
.reverse
111113
.each do |entry|
112-
groups.min_by do |group|
113-
group.map(&block).reduce(:+) || 0
114-
end.push(entry)
115-
end
114+
groups.min_by do |group|
115+
group.map(&block).reduce(:+) || 0
116+
end.push(entry)
117+
end
116118
end
117119
end
118120
end

lib/flatware/sink.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ def group_jobs(jobs, worker_count)
117117
.with_index { |_, i| i % worker_count }
118118
.values
119119
.map do |job_group|
120-
Job.new(job_group.map(&:id).flatten, jobs.first.args)
121-
end
120+
Job.new(job_group.map(&:id).flatten, jobs.first.args)
121+
end
122122
end
123123
end
124124
end

spec/flatware/sink/signal_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def send_signal(signal)
5353
end
5454

5555
it 'tells the formatter to emit the signal message' do
56-
expect(messages).to match([include(expected_message), 'done.'])
56+
expect(messages).to match([match(expected_message), 'done.'])
5757
end
5858

5959
it 'calls on_interrupt' do

0 commit comments

Comments
 (0)