Skip to content

Commit

Permalink
Adjusts negative ifs to unless.
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelnobrepd committed Dec 28, 2018
1 parent 0823cfe commit 833e4c7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/xcpretty/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,7 @@ def parse(text)
when SHELL_COMMAND_MATCHER
formatter.format_shell_command($1, $2)
when GENERIC_WARNING_MATCHER
if !ENV["XCPRETTY_INHIBIT_WARNINGS"]
formatter.format_warning($1)
end
formatter.format_warning($1) unless should_inhibit_warnings
when WILL_NOT_BE_CODE_SIGNED_MATCHER
formatter.format_will_not_be_code_signed($1)
else
Expand Down Expand Up @@ -462,10 +460,8 @@ def update_error_state(text)
@formatting_error = true
update_error.call
elsif text =~ COMPILE_WARNING_MATCHER
if !ENV["XCPRETTY_INHIBIT_WARNINGS"]
@formatting_warning = true
update_error.call
end
@formatting_warning = true unless should_inhibit_warnings
update_error.call unless should_inhibit_warnings
elsif text =~ CURSOR_MATCHER
current_issue[:cursor] = $1.chomp
elsif @formatting_error || @formatting_warning
Expand Down Expand Up @@ -595,6 +591,10 @@ def unescaped(*escaped_values)
escaped_values.map { |v| v.delete('\\') }
end

def should_inhibit_warnings
ENV["XCPRETTY_INHIBIT_WARNINGS"] != nil
end

end
end

0 comments on commit 833e4c7

Please sign in to comment.