-
Notifications
You must be signed in to change notification settings - Fork 284
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
Fixed COMPILE_MATCHER to match all languages #158
Conversation
The existing COMPILE_MATCHER pattern only matches `CompileC`, and fails to match `CompileSwift`. The new pattern matches `CompileFollowedByAnyLettersAndDigits`.
@@ -50,6 +50,7 @@ module Matchers | |||
# $1 file_path | |||
# $2 file_name (e.g. KWNull.m) | |||
COMPILE_MATCHER = /^CompileC\s.+?\s((?:\\.|[^ ])+\/((?:\\.|[^ ])+\.(?:m|mm|c|cc|cpp|cxx|swift)))\s.*/ | |||
COMPILE_MATCHER = /^Compile[\w]+\s.+?\s((?:\\.|[^ ])+\/((?:\\.|[^ ])+\.(?:m|mm|c|cc|cpp|cxx|swift)))\s.*/ |
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.
Line is too long. [109/80]
@@ -49,7 +49,7 @@ module Matchers | |||
# @regex Captured groups | |||
# $1 file_path | |||
# $2 file_name (e.g. KWNull.m) | |||
COMPILE_MATCHER = /^CompileC\s.+?\s((?:\\.|[^ ])+\/((?:\\.|[^ ])+\.(?:m|mm|c|cc|cpp|cxx|swift)))\s.*/ | |||
COMPILE_MATCHER = /^Compile[\w]+\s.+?\s((?:\\.|[^ ])+\/((?:\\.|[^ ])+\.(?:m|mm|c|cc|cpp|cxx|swift)))\s.*/ |
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.
Line is too long. [109/80]
Hound’s warning about line length was present before the change, so … not a problem? |
@pcantrell not a problem. Thanks for the contribution! |
@@ -90,8 +90,8 @@ module XCPretty | |||
end | |||
|
|||
it 'parses compiling Swift source files' do | |||
@formatter.should receive(:format_compile).with("KWNull.swift", "Classes/Core/KWNull.swift") | |||
@parser.parse(SAMPLE_ANOTHER_COMPILE.sub('.m', '.swift')) | |||
@formatter.should receive(:format_compile).with("Resource.swift", "/Users/paul/foo/bar/siesta/Source/Resource.swift") |
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.
Line is too long. [123/80]
Prefer single-quoted strings when you don't need string interpolation or special symbols.
Done. The old spec had been testing Swift just by making a little substitution in the C compiler invocation, but the real-life output of Swift compilation is quite different from C, so I added a separate fixture for it. |
Fixed COMPILE_MATCHER to match all languages
Thanks @pcantrell! |
The existing COMPILE_MATCHER pattern only matches
CompileC
, and fails to matchCompileSwift
.The new pattern matches
CompileFollowedByAnyLettersAndDigits
.