Skip to content

Commit

Permalink
lib: resolve rubocop issues with rubocop 0.50.0
Browse files Browse the repository at this point in the history
Signed-off-by: Philip Li <philip.li@intel.com>
  • Loading branch information
rli9 committed Jan 14, 2024
1 parent 6714fb4 commit ca275f7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/dmesg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def fixup_dmesg(line)

# break up mixed messages
case line
when /^<[0-9]>|^(kern |user |daemon):......: /
when /^<[0-9]>|^(kern |user |daemon):......: / # rubocop:disable Lint/EmptyWhen
# line keeps no change
when /(.+)(\[ *[0-9]{1,6}\.[0-9]{6}\] .*)/
line = "#{$1}\n#{$2}"
Expand Down
7 changes: 4 additions & 3 deletions lib/hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ def lookup_hash(hash, path, create_missing: false)
end

ACCUMULATIVE_KEYS = %w(
mail_to
mail_cc
constraints
mail_to
mail_cc
constraints
).freeze

def accumulative_key?(k)
return true if ACCUMULATIVE_KEYS.include? k
return true if k =~ /^need_/ && k !~ /^need_(memory|cpu|modules)$/
Expand Down
10 changes: 5 additions & 5 deletions lib/matrix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,11 @@ def merge_matrixes(matrixes)

def check_warn_test_error(matrix, _result_root)
ids = %w(
last_state.is_incomplete_run
last_state.exit_fail
stderr.has_stderr
phoronix-test-suite.has_failure
)
last_state.is_incomplete_run
last_state.exit_fail
stderr.has_stderr
phoronix-test-suite.has_failure
)

ids.each do |errid|
samples = matrix[errid]
Expand Down
2 changes: 1 addition & 1 deletion programs/kernel-selftests/parse
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ end
class TimensStater < Stater
def stat(line, stats)
case line
when /# SKIP CLOCK_BOOTTIME_ALARM isn't supported/
when /# SKIP CLOCK_BOOTTIME_ALARM isn't supported/ # rubocop:disable Lint/EmptyWhen
# ignore below skip, cause there's no test name when it skipped,
# thus it's meaningless for auto-bisect
# selftests: timens: timens
Expand Down
2 changes: 1 addition & 1 deletion spec/local_run_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
FileUtils.cp "#{LKP_SRC}/lib/run_env.rb", @tmp_file
s = ''
File.open(@tmp_file, 'r') do |f|
f.each_line { |l| s += l.gsub(/\#{LKP_SRC}\/hosts\//, "#{@tmp_dir}/") }
f.each_line { |l| s += l.gsub(/\#{LKP_SRC}\/hosts\//, "#{@tmp_dir}/") } # rubocop:disable Lint/InterpolationCheck
f.rewind
end
File.open(@tmp_file, 'w') { |f| f.write s }
Expand Down

0 comments on commit ca275f7

Please sign in to comment.