Skip to content
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

Merged
merged 3 commits into from
Sep 8, 2015

Conversation

pcantrell
Copy link
Contributor

The existing COMPILE_MATCHER pattern only matches CompileC, and fails to match CompileSwift.

The new pattern matches CompileFollowedByAnyLettersAndDigits.

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.*/
Copy link
Collaborator

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.*/
Copy link
Collaborator

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]

@pcantrell
Copy link
Contributor Author

Hound’s warning about line length was present before the change, so … not a problem?

@supermarin
Copy link
Contributor

@pcantrell not a problem.

Thanks for the contribution!
Do you mind writing a test in parser_spec.rb that shows it failing?

@@ -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")
Copy link
Collaborator

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.

@pcantrell
Copy link
Contributor Author

Do you mind writing a test in parser_spec.rb that shows it failing?

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.

supermarin added a commit that referenced this pull request Sep 8, 2015
Fixed COMPILE_MATCHER to match all languages
@supermarin supermarin merged commit 9194b0e into xcpretty:master Sep 8, 2015
@supermarin
Copy link
Contributor

Thanks @pcantrell!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants