Be better about looking for warnings on Travis
This commit is contained in:
parent
ab08fef63e
commit
b4082877fd
|
@ -13,9 +13,7 @@ class WarningsSpy
|
||||||
|
|
||||||
def partition
|
def partition
|
||||||
@relevant_warning_groups, @irrelevant_warning_groups =
|
@relevant_warning_groups, @irrelevant_warning_groups =
|
||||||
warning_groups.partition do |group|
|
warning_groups.partition { |group| relevant_warnings?(group) }
|
||||||
group.any? { |line| line.include?(search_text) }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
@ -25,5 +23,14 @@ class WarningsSpy
|
||||||
private
|
private
|
||||||
|
|
||||||
def_delegators :reader, :warning_groups
|
def_delegators :reader, :warning_groups
|
||||||
|
|
||||||
|
def relevant_warnings?(group)
|
||||||
|
first_line = group[0]
|
||||||
|
first_line.start_with?("#{project_root}/lib")
|
||||||
|
end
|
||||||
|
|
||||||
|
def project_root
|
||||||
|
File.expand_path('../../..')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -28,14 +28,14 @@ class WarningsSpy
|
||||||
def process_line(line)
|
def process_line(line)
|
||||||
if start_of_group?(line)
|
if start_of_group?(line)
|
||||||
add_group(current_group)
|
add_group(current_group)
|
||||||
current_group.clear
|
@current_group = []
|
||||||
end
|
end
|
||||||
|
|
||||||
current_group << line
|
current_group << line
|
||||||
end
|
end
|
||||||
|
|
||||||
def start_of_group?(line)
|
def start_of_group?(line)
|
||||||
line =~ /^\W/
|
line =~ /^\S/
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_group(group)
|
def add_group(group)
|
||||||
|
|
Loading…
Reference in New Issue