xcpretty 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 15e5b2c06fdab978445beef93dcd79340a31e754
4
- data.tar.gz: f86212f6533fab98da537943c3a4464685471d8b
3
+ metadata.gz: b78a4012d3b1df36cbd26eee764159f4a2ee5e14
4
+ data.tar.gz: 8744a4e46db1e1983611a445b733208c4d12f177
5
5
  SHA512:
6
- metadata.gz: bfe0f34e95a6cea49c50c1249844abff6ddc447bae786bdfface21384bdad95c7ca48848045970545f95b8fae11fffccb7def9f612d43f827eab1209407dfd1b
7
- data.tar.gz: d54e782c2bec5f3dd894348a28b235936189addfccee72fcb4cf054f016360816f3d14456dafc5553ff276b70dedbfddc6b638ccb4877308d8ceba59ea0e407e
6
+ metadata.gz: 9e7ff5c8ce55088cd935aa120aec5bbe154f876201211d193345349372a5e3100a0f38c2d55c460e2c380ddebfee1f9f9d1e0eee1f0fc930d95a512e27fe1339
7
+ data.tar.gz: b54c6a0c5d506252a6ae6eb07ee0ddbb40d468757f104decf4219b357527f40eb33f8ac8664a3b221de88d083c613b30f0c4534925489e85452f8443cc1d5daf
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.2
4
+
5
+ ###### Enhancements
6
+
7
+ * More consistent error output (add some spacing before and after)
8
+ * Parsed clang errors
9
+ * Parsed ld: errors
10
+
11
+
3
12
  ## 0.1.1
4
13
 
5
14
  ###### Enhancements
data/README.md CHANGED
@@ -17,9 +17,8 @@ XCPretty is designed to be piped with `xcodebuild` and thus keeping 100% compati
17
17
  This means, when `xcodebuild` works, `xcpretty` works.
18
18
  It's even a bit faster than `xcodebuild` only, since it saves your terminal some prints.
19
19
 
20
- __Important:__ exiting status code is still experimental, and could potentially
21
- be removed from `xcpretty`. If you want to ensure the exit status code from
22
- `xcodebuild`, add this to the end of pipe:
20
+ __Important:__ lots of CIs are using exit status for determining if build has
21
+ failed. You probably want to exit with the same status code as `xcodebuild`.
23
22
 
24
23
  ```
25
24
  xcodebuild ... | xcpretty -c; exit ${PIPESTATUS[0]}
@@ -85,15 +85,15 @@ module XCPretty
85
85
  ASCII_ERROR = "[!]"
86
86
 
87
87
  def format_error(message)
88
- red((use_unicode? ? ERROR : ASCII_ERROR) + " " + message)
88
+ "\n#{red(error_symbol + " " + message)}\n\n"
89
89
  end
90
90
 
91
91
  def format_compile_error(file, file_path, reason, line, cursor)
92
- "\n#{file_path}: #{red(reason)}\n\n#{line}\n#{cyan(cursor)}\n\n"
92
+ "\n#{red(error_symbol + " ")}#{file_path}: #{red(reason)}\n\n#{line}\n#{cyan(cursor)}\n\n"
93
93
  end
94
94
 
95
95
  def format_linker_failure(message, symbol, reference)
96
- "\n#{red(" " + message)}\n> Symbol: #{symbol}\n> Referenced from: #{reference}\n\n"
96
+ "\n#{red(error_symbol + " " + message)}\n> Symbol: #{symbol}\n> Referenced from: #{reference}\n\n"
97
97
  end
98
98
 
99
99
 
@@ -109,5 +109,9 @@ module XCPretty
109
109
  end.join("\n")
110
110
  end
111
111
 
112
+ def error_symbol
113
+ use_unicode? ? ERROR : ASCII_ERROR
114
+ end
115
+
112
116
  end
113
117
  end
@@ -16,6 +16,10 @@ module XCPretty
16
16
  # @regex Nothing returned here for now
17
17
  CHECK_DEPENDENCIES_MATCHER = /^Check dependencies/
18
18
 
19
+ # @regex Captured groups
20
+ # $1 = whole error
21
+ CLANG_ERROR_MATCHER = /^(clang: error:.*)$/
22
+
19
23
  # @regex Nothing returned here for now
20
24
  CLEAN_REMOVE_MATCHER = /^Clean.Remove/
21
25
 
@@ -89,6 +93,10 @@ module XCPretty
89
93
  # $1 = library
90
94
  LIBTOOL_MATCHER = /^Libtool.*\/(.*\.a)/
91
95
 
96
+ # @regex Captured groups
97
+ # $1 = whole error
98
+ LD_ERROR_MATCHER = /^(ld:.*not found for.*)/
99
+
92
100
  # @regex Captured groups
93
101
  # $1 reason
94
102
  LINKER_FAILURE_MATCHER = /^(Undefined symbols for architecture .*):$/
@@ -191,6 +199,8 @@ module XCPretty
191
199
  formatter.format_copy_strings_file($1)
192
200
  when CHECK_DEPENDENCIES_MATCHER
193
201
  formatter.format_check_dependencies
202
+ when CLANG_ERROR_MATCHER
203
+ formatter.format_error($1)
194
204
  when CODESIGN_FRAMEWORK_MATCHER
195
205
  formatter.format_codesign($1)
196
206
  when CODESIGN_MATCHER
@@ -211,6 +221,8 @@ module XCPretty
211
221
  formatter.format_error($1)
212
222
  when GENERATE_DSYM_MATCHER
213
223
  formatter.format_generate_dsym($1)
224
+ when LD_ERROR_MATCHER
225
+ formatter.format_error($1)
214
226
  when LIBTOOL_MATCHER
215
227
  formatter.format_libtool($1)
216
228
  when LINKING_MATCHER
@@ -1,3 +1,3 @@
1
1
  module XCPretty
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -523,5 +523,10 @@ Undefined symbols for architecture x86_64:
523
523
  "_OBJC_CLASS_$_CABasicAnimation", referenced from:
524
524
  objc-class-ref in ATZRadialProgressControl.o
525
525
  ld: symbol(s) not found for architecture x86_64
526
- clang: error: linker command failed with exit code 1 (use -v to see invocation)
527
526
  )
527
+
528
+ SAMPLE_LD_SYMBOLS_ERROR = 'ld: symbol(s) not found for architecture x86_64'
529
+ SAMPLE_LD_LIBRARY_ERROR = 'ld: library not found for -lPods-Yammer'
530
+
531
+ SAMPLE_CLANG_ERROR = 'clang: error: linker command failed with exit code 1 (use -v to see invocation)'
532
+
@@ -24,7 +24,7 @@ module XCPretty
24
24
 
25
25
  it "formats cocoapods errors" do
26
26
  @formatter.format_error("The sandbox is not in sync...").should ==
27
- "#{@formatter.red("⌦ The sandbox is not in sync...")}"
27
+ "\n#{@formatter.red("⌦ The sandbox is not in sync...")}\n\n"
28
28
  end
29
29
 
30
30
  it "formats compiling errors" do
@@ -32,7 +32,7 @@ module XCPretty
32
32
  "[a should",
33
33
  " ^").should ==
34
34
  %Q(
35
- path/to/file: #{@formatter.red("expected valid syntax")}
35
+ #{@formatter.red('⌦ ')}path/to/file: #{@formatter.red("expected valid syntax")}
36
36
 
37
37
  [a should
38
38
  #{@formatter.cyan(" ^")}
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'xcpretty'
2
4
  require 'xcpretty/parser'
3
5
  require 'fixtures/constants'
@@ -182,6 +184,11 @@ module XCPretty
182
184
 
183
185
  context "errors" do
184
186
 
187
+ it "parses clang errors" do
188
+ @formatter.should receive(:format_error).with(SAMPLE_CLANG_ERROR)
189
+ @parser.parse(SAMPLE_CLANG_ERROR)
190
+ end
191
+
185
192
  it "parses cocoapods errors" do
186
193
  @formatter.should receive(:format_error).with("The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.")
187
194
  @parser.parse(SAMPLE_PODS_ERROR)
@@ -259,6 +266,20 @@ module XCPretty
259
266
  @parser.parse(SAMPLE_CODESIGN_ERROR_NO_SPACES)
260
267
  end
261
268
 
269
+ it "parses ld library errors" do
270
+ @formatter.should receive(:format_error).with(
271
+ SAMPLE_LD_LIBRARY_ERROR
272
+ )
273
+ @parser.parse(SAMPLE_LD_LIBRARY_ERROR)
274
+ end
275
+
276
+ it 'parses ld symbols errors' do
277
+ @formatter.should receive(:format_error).with(
278
+ SAMPLE_LD_SYMBOLS_ERROR
279
+ )
280
+ @parser.parse(SAMPLE_LD_SYMBOLS_ERROR)
281
+ end
282
+
262
283
  it "doesn't print the same error over and over" do
263
284
  SAMPLE_COMPILE_ERROR.each_line do |line|
264
285
  @parser.parse(line)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcpretty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marin Usalj
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-19 00:00:00.000000000 Z
12
+ date: 2014-01-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler