-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix UNDEFINED_SYMBOL formatter and print #222
Open
NoDifficulty
wants to merge
2
commits into
xcpretty:master
Choose a base branch
from
NoDifficulty:master
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -244,7 +244,7 @@ module Errors | |
|
||
# @regex Captured groups | ||
# $1 symbol location | ||
LINKER_UNDEFINED_SYMBOL_LOCATION_MATCHER = /^(.* in .*\.o)$/ | ||
LINKER_UNDEFINED_SYMBOL_LOCATION_MATCHER = /^(.* in .*\.o[\)]?)$/ | ||
|
||
# @regex Captured groups | ||
# $1 reason | ||
|
@@ -279,7 +279,6 @@ def parse(text) | |
|
||
return format_compile_error if should_format_error? | ||
return format_compile_warning if should_format_warning? | ||
return format_undefined_symbols if should_format_undefined_symbols? | ||
return format_duplicate_symbols if should_format_duplicate_symbols? | ||
|
||
case text | ||
|
@@ -334,7 +333,7 @@ def parse(text) | |
when LD_WARNING_MATCHER | ||
formatter.format_ld_warning($1 + $2) | ||
when LD_ERROR_MATCHER | ||
formatter.format_error($1) | ||
format_undefined_symbols($1) if should_format_undefined_symbols? | ||
when LIBTOOL_MATCHER | ||
formatter.format_libtool($1) | ||
when LINKING_MATCHER | ||
|
@@ -430,9 +429,10 @@ def update_linker_failure_state(text) | |
|
||
case text | ||
when SYMBOL_REFERENCED_FROM_MATCHER | ||
current_linker_failure[:symbol] = $1 | ||
info = { symbol: $1 , references: []} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Space found before comma. |
||
current_linker_failure[:infos] << info | ||
when LINKER_UNDEFINED_SYMBOL_LOCATION_MATCHER | ||
current_linker_failure[:reference] = text.strip | ||
current_linker_failure[:infos][-1][:references] << text.strip | ||
when LINKER_DUPLICATE_SYMBOLS_LOCATION_MATCHER | ||
current_linker_failure[:files] << $1 | ||
end | ||
|
@@ -452,7 +452,7 @@ def error_or_warning_is_present | |
end | ||
|
||
def should_format_undefined_symbols? | ||
current_linker_failure[:message] && current_linker_failure[:symbol] && current_linker_failure[:reference] | ||
current_linker_failure[:message] && current_linker_failure[:infos].count > 1 | ||
end | ||
|
||
def should_format_duplicate_symbols? | ||
|
@@ -464,7 +464,7 @@ def current_issue | |
end | ||
|
||
def current_linker_failure | ||
@linker_failure ||= {files: []} | ||
@linker_failure ||= {files: [], infos: []} | ||
end | ||
|
||
def format_compile_error | ||
|
@@ -489,12 +489,12 @@ def format_compile_warning | |
warning[:cursor]) | ||
end | ||
|
||
def format_undefined_symbols | ||
def format_undefined_symbols(ld_error) | ||
result = formatter.format_undefined_symbols( | ||
current_linker_failure[:message], | ||
current_linker_failure[:symbol], | ||
current_linker_failure[:reference] | ||
current_linker_failure[:infos] | ||
) | ||
result = result + formatter.format_error(ld_error) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use self-assignment shorthand |
||
reset_linker_format_state | ||
result | ||
end | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.