xcpretty 0.1.12 → 0.2.0
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 +4 -4
- data/.hound.yml +2 -10
- data/.rubocop.yml +239 -0
- data/.travis.yml +1 -8
- data/CHANGELOG.md +35 -0
- data/Gemfile +1 -0
- data/README.md +23 -76
- data/Rakefile +10 -8
- data/bin/xcpretty +14 -14
- data/features/simple_format.feature +39 -17
- data/features/steps/formatting_steps.rb +33 -4
- data/features/steps/html_steps.rb +1 -0
- data/features/steps/json_steps.rb +2 -1
- data/features/steps/junit_steps.rb +4 -3
- data/features/steps/report_steps.rb +1 -0
- data/features/support/env.rb +4 -3
- data/features/test_format.feature +4 -4
- data/lib/xcpretty/ansi.rb +14 -13
- data/lib/xcpretty/formatters/formatter.rb +24 -8
- data/lib/xcpretty/formatters/knock.rb +2 -1
- data/lib/xcpretty/formatters/rspec.rb +1 -0
- data/lib/xcpretty/formatters/simple.rb +18 -3
- data/lib/xcpretty/formatters/tap.rb +3 -2
- data/lib/xcpretty/parser.rb +38 -15
- data/lib/xcpretty/printer.rb +1 -0
- data/lib/xcpretty/reporters/html.rb +7 -5
- data/lib/xcpretty/reporters/json_compilation_database.rb +6 -10
- data/lib/xcpretty/reporters/junit.rb +6 -3
- data/lib/xcpretty/snippet.rb +0 -2
- data/lib/xcpretty/syntax.rb +38 -31
- data/lib/xcpretty/term.rb +14 -0
- data/lib/xcpretty/version.rb +2 -1
- data/lib/xcpretty.rb +5 -6
- data/spec/fixtures/constants.rb +15 -2
- data/spec/fixtures/custom_formatter.rb +2 -1
- data/spec/spec_helper.rb +2 -1
- data/spec/support/matchers/colors.rb +1 -0
- data/spec/xcpretty/ansi_spec.rb +1 -0
- data/spec/xcpretty/formatters/formatter_spec.rb +27 -16
- data/spec/xcpretty/formatters/rspec_spec.rb +1 -0
- data/spec/xcpretty/formatters/simple_spec.rb +22 -3
- data/spec/xcpretty/parser_spec.rb +39 -10
- data/spec/xcpretty/printer_spec.rb +15 -13
- data/spec/xcpretty/syntax_spec.rb +24 -48
- data/spec/xcpretty/term_spec.rb +26 -0
- data/xcpretty.gemspec +15 -11
- metadata +42 -14
- data/vendor/json_pure/COPYING +0 -57
- data/vendor/json_pure/LICENSE +0 -340
- data/vendor/json_pure/generator.rb +0 -443
- data/vendor/json_pure/parser.rb +0 -364
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 096f34c67b491e7637fc6eed7870ed867d9c2713
|
4
|
+
data.tar.gz: 4f6c1cda9fbad733514a05daa85ca70552be004d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd960ef62227e77628d522d65d1687865205b1b272290362f25de59c93f6468007cac7d4f22ca78c4fde3cb405288541fe3a15cbbab72503ab764b308e159e7f
|
7
|
+
data.tar.gz: 42c4f1727f405fe17affbb6e8abff7b8d3141c2ff278fb4ac94de47eacc6dc667cc7a566304ce222c54a9ad8db3cad39a2ba0857b5a2c1c945c7ad1b0ebb07bf
|
data/.hound.yml
CHANGED
@@ -1,10 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
Lint/UnusedMethodArgument:
|
5
|
-
Description: 'Checks for unused method arguments.'
|
6
|
-
Enabled: false
|
7
|
-
|
8
|
-
Style/HashSyntax:
|
9
|
-
Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a => 1, :b => 2 }.'
|
10
|
-
Enabled: false
|
1
|
+
ruby:
|
2
|
+
config_file: .rubocop.yml
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,239 @@
|
|
1
|
+
Lint/AssignmentInCondition:
|
2
|
+
Exclude:
|
3
|
+
- 'bin/xcpretty'
|
4
|
+
|
5
|
+
Lint/DefEndAlignment:
|
6
|
+
Enabled: true
|
7
|
+
Exclude:
|
8
|
+
- 'lib/xcpretty/formatters/formatter.rb'
|
9
|
+
|
10
|
+
Lint/EndAlignment:
|
11
|
+
Enabled: true
|
12
|
+
|
13
|
+
Lint/Eval:
|
14
|
+
Exclude:
|
15
|
+
- 'lib/xcpretty.rb'
|
16
|
+
|
17
|
+
Lint/FormatParameterMismatch:
|
18
|
+
Exclude:
|
19
|
+
- 'lib/xcpretty/formatters/simple.rb'
|
20
|
+
|
21
|
+
Lint/UnusedBlockArgument:
|
22
|
+
Enabled: false
|
23
|
+
|
24
|
+
Lint/UnusedMethodArgument:
|
25
|
+
Enabled: false
|
26
|
+
|
27
|
+
Lint/UselessAccessModifier:
|
28
|
+
Enabled: true
|
29
|
+
|
30
|
+
Lint/Void:
|
31
|
+
Enabled: false
|
32
|
+
|
33
|
+
Metrics/AbcSize:
|
34
|
+
Enabled: false
|
35
|
+
|
36
|
+
Metrics/ClassLength:
|
37
|
+
Enabled: false
|
38
|
+
|
39
|
+
Metrics/CyclomaticComplexity:
|
40
|
+
Enabled: false
|
41
|
+
|
42
|
+
Metrics/LineLength:
|
43
|
+
Max: 80
|
44
|
+
Exclude:
|
45
|
+
- 'bin/xcpretty'
|
46
|
+
- 'spec/**/*.rb'
|
47
|
+
- 'features/**/*.rb'
|
48
|
+
- 'lib/xcpretty/parser.rb'
|
49
|
+
|
50
|
+
Metrics/MethodLength:
|
51
|
+
Enabled: false
|
52
|
+
|
53
|
+
Metrics/ModuleLength:
|
54
|
+
Enabled: false
|
55
|
+
|
56
|
+
Metrics/PerceivedComplexity:
|
57
|
+
Enabled: false
|
58
|
+
|
59
|
+
Performance/Count:
|
60
|
+
Enabled: true
|
61
|
+
|
62
|
+
Performance/Size:
|
63
|
+
Enabled: true
|
64
|
+
|
65
|
+
Performance/StringReplacement:
|
66
|
+
Enabled: true
|
67
|
+
|
68
|
+
Style/AlignHash:
|
69
|
+
Enabled: true
|
70
|
+
Exclude:
|
71
|
+
- 'spec/**/*.rb'
|
72
|
+
|
73
|
+
Style/AlignParameters:
|
74
|
+
Enabled: true
|
75
|
+
Exclude:
|
76
|
+
- 'spec/**/*.rb'
|
77
|
+
|
78
|
+
Style/BarePercentLiterals:
|
79
|
+
Enabled: false
|
80
|
+
|
81
|
+
Style/BlockDelimiters:
|
82
|
+
Enabled: false
|
83
|
+
|
84
|
+
Style/BracesAroundHashParameters:
|
85
|
+
Enabled: true
|
86
|
+
|
87
|
+
# Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep.
|
88
|
+
Style/CaseIndentation:
|
89
|
+
Enabled: true
|
90
|
+
|
91
|
+
Style/ClassVars:
|
92
|
+
Enabled: false
|
93
|
+
|
94
|
+
Style/ClosingParenthesisIndentation:
|
95
|
+
Enabled: false
|
96
|
+
|
97
|
+
# Offense count: 1
|
98
|
+
# Cop supports --auto-correct.
|
99
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerBackticks.
|
100
|
+
Style/CommandLiteral:
|
101
|
+
Exclude:
|
102
|
+
- 'features/support/*.rb'
|
103
|
+
|
104
|
+
Style/CommentIndentation:
|
105
|
+
Enabled: true
|
106
|
+
|
107
|
+
Style/Documentation:
|
108
|
+
Enabled: false
|
109
|
+
|
110
|
+
Style/DoubleNegation:
|
111
|
+
Exclude:
|
112
|
+
- 'lib/xcpretty/ansi.rb'
|
113
|
+
- 'lib/xcpretty/formatters/formatter.rb'
|
114
|
+
|
115
|
+
Style/EmptyLineBetweenDefs:
|
116
|
+
Exclude:
|
117
|
+
- 'lib/xcpretty/formatters/formatter.rb'
|
118
|
+
|
119
|
+
Style/EmptyLines:
|
120
|
+
Enabled: false
|
121
|
+
|
122
|
+
Style/EmptyLinesAroundBlockBody:
|
123
|
+
Exclude:
|
124
|
+
- 'spec/**/*.rb'
|
125
|
+
|
126
|
+
Style/EmptyLinesAroundClassBody:
|
127
|
+
Enabled: false
|
128
|
+
|
129
|
+
Style/EmptyLinesAroundModuleBody:
|
130
|
+
Enabled: false
|
131
|
+
|
132
|
+
Style/ExtraSpacing:
|
133
|
+
Enabled: true
|
134
|
+
Exclude:
|
135
|
+
- 'lib/xcpretty/formatters/formatter.rb'
|
136
|
+
|
137
|
+
Style/FirstParameterIndentation:
|
138
|
+
Enabled: true
|
139
|
+
|
140
|
+
Style/GuardClause:
|
141
|
+
Enabled: false
|
142
|
+
|
143
|
+
Style/HashSyntax:
|
144
|
+
EnforcedStyle: ruby19
|
145
|
+
|
146
|
+
Style/IfUnlessModifier:
|
147
|
+
Enabled: false
|
148
|
+
|
149
|
+
Style/IndentationWidth:
|
150
|
+
Exclude:
|
151
|
+
- 'spec/**/*.rb'
|
152
|
+
|
153
|
+
Style/LeadingCommentSpace:
|
154
|
+
Enabled: true
|
155
|
+
|
156
|
+
Style/LineEndConcatenation:
|
157
|
+
Enabled: true
|
158
|
+
|
159
|
+
Style/MethodDefParentheses:
|
160
|
+
Enabled: true
|
161
|
+
|
162
|
+
Style/MultilineOperationIndentation:
|
163
|
+
Enabled: false
|
164
|
+
|
165
|
+
Style/NonNilCheck:
|
166
|
+
Enabled: false
|
167
|
+
|
168
|
+
Style/PercentLiteralDelimiters:
|
169
|
+
Enabled: true
|
170
|
+
|
171
|
+
Style/PercentQLiterals:
|
172
|
+
Enabled: false
|
173
|
+
|
174
|
+
Style/PerlBackrefs:
|
175
|
+
Enabled: false
|
176
|
+
|
177
|
+
Style/RedundantBegin:
|
178
|
+
Enabled: true
|
179
|
+
|
180
|
+
Style/RegexpLiteral:
|
181
|
+
Enabled: false
|
182
|
+
|
183
|
+
Style/Semicolon:
|
184
|
+
Exclude:
|
185
|
+
- 'bin/xcpretty'
|
186
|
+
|
187
|
+
Style/SignalException:
|
188
|
+
Enabled: false
|
189
|
+
|
190
|
+
Style/SingleLineMethods:
|
191
|
+
Exclude:
|
192
|
+
- 'lib/xcpretty/formatters/formatter.rb'
|
193
|
+
|
194
|
+
Style/SpaceAfterComma:
|
195
|
+
Enabled: true
|
196
|
+
|
197
|
+
Style/SpaceAroundEqualsInParameterDefault:
|
198
|
+
Enabled: false
|
199
|
+
|
200
|
+
Style/SpaceAroundOperators:
|
201
|
+
Enabled: true
|
202
|
+
|
203
|
+
Style/SpaceInsideBlockBraces:
|
204
|
+
Enabled: true
|
205
|
+
EnforcedStyle: space
|
206
|
+
|
207
|
+
Style/SpaceInsideHashLiteralBraces:
|
208
|
+
Enabled: true
|
209
|
+
EnforcedStyle: no_space
|
210
|
+
|
211
|
+
Style/SpaceInsideParens:
|
212
|
+
Enabled: true
|
213
|
+
|
214
|
+
Style/SpecialGlobalVars:
|
215
|
+
Enabled: false
|
216
|
+
|
217
|
+
Style/StringLiterals:
|
218
|
+
Enabled: false
|
219
|
+
|
220
|
+
Style/StringLiteralsInInterpolation:
|
221
|
+
Enabled: false
|
222
|
+
|
223
|
+
Style/SymbolProc:
|
224
|
+
Enabled: false
|
225
|
+
|
226
|
+
Style/TrailingBlankLines:
|
227
|
+
Enabled: true
|
228
|
+
EnforcedStyle: final_blank_line
|
229
|
+
|
230
|
+
Style/TrailingComma:
|
231
|
+
Enabled: true
|
232
|
+
|
233
|
+
Style/TrailingWhitespace:
|
234
|
+
Enabled: true
|
235
|
+
|
236
|
+
Style/UnneededPercentQ:
|
237
|
+
Exclude:
|
238
|
+
- 'spec/**/*.rb'
|
239
|
+
- 'xcpretty.gemspec'
|
data/.travis.yml
CHANGED
@@ -1,18 +1,11 @@
|
|
1
1
|
language: ruby
|
2
|
-
|
3
|
-
#travis workaround for bundler failing on 1.8.7
|
4
|
-
before_install:
|
5
|
-
- gem update --system 2.1.11
|
6
|
-
- gem --version
|
7
|
-
|
2
|
+
sudo: false
|
8
3
|
install:
|
9
4
|
- bundle install
|
10
5
|
|
11
6
|
rvm:
|
12
7
|
- 2.1.1
|
13
8
|
- 2.0.0
|
14
|
-
- 1.9.3
|
15
|
-
- 1.8.7
|
16
9
|
|
17
10
|
script: rake ci
|
18
11
|
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,40 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.2.0
|
4
|
+
|
5
|
+
###### Enhancements
|
6
|
+
|
7
|
+
* Format `ld` warnings as warnings instead of errors
|
8
|
+
| [Cédric Luthi](https://github.com/0xced)
|
9
|
+
| [#160](https://github.com/supermarin/xcpretty/pull/160)
|
10
|
+
|
11
|
+
* Use `rouge` instead of `pygments` for syntax highlighting
|
12
|
+
| [Kyle Fuller](https://github.com/kylef)
|
13
|
+
| [#141](https://github.com/supermarin/xcpretty/pull/141)
|
14
|
+
|
15
|
+
* Output phase success messages in simple formatter
|
16
|
+
| [Delisa Mason](https://github.com/kattrali)
|
17
|
+
| [#167](https://github.com/supermarin/xcpretty/pull/167)
|
18
|
+
|
19
|
+
* Automatically detect terminal color, and make `-c --color` flag redundant
|
20
|
+
| [Delisa Mason](https://github.com/kattrali)
|
21
|
+
| [#136](https://github.com/supermarin/xcpretty/pull/136)
|
22
|
+
<br>You can still use `--no-color` or force `--color`.
|
23
|
+
|
24
|
+
* Show check dependencies phase
|
25
|
+
| [Vladimir Burdukov](https://github.com/chipp)
|
26
|
+
| [#176](https://github.com/supermarin/xcpretty/pull/176)
|
27
|
+
|
28
|
+
|
29
|
+
* Show compile storyboard outputs
|
30
|
+
* Show compilation errors for missing files
|
31
|
+
|
32
|
+
###### Misc
|
33
|
+
|
34
|
+
* Use the CROSS MARK (U+274C) symbol for errors
|
35
|
+
| [Cédric Luthi](https://github.com/0xced)
|
36
|
+
| [#159](https://github.com/supermarin/xcpretty/pull/159)
|
37
|
+
|
3
38
|
## 0.1.12
|
4
39
|
|
5
40
|
###### Bug fixes
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -16,10 +16,12 @@ $ gem install xcpretty
|
|
16
16
|
``` bash
|
17
17
|
$ xcodebuild [flags] | xcpretty -c
|
18
18
|
```
|
19
|
-
`xcpretty` is designed to be piped with `xcodebuild` and thus keeping 100%
|
20
|
-
It's even a bit faster than `xcodebuild`
|
19
|
+
`xcpretty` is designed to be piped with `xcodebuild` and thus keeping 100%
|
20
|
+
compatibility with it. It's even a bit faster than `xcodebuild` itself, since
|
21
|
+
it saves your terminal some prints.
|
21
22
|
|
22
|
-
__Important:__ If you're running `xcpretty` on a CI like Travis or Jenkins, you
|
23
|
+
__Important:__ If you're running `xcpretty` on a CI like Travis or Jenkins, you
|
24
|
+
may want to exit with same status code as `xcodebuild`.
|
23
25
|
CI systems usually use status codes to determine if the build has failed.
|
24
26
|
|
25
27
|
``` bash
|
@@ -30,10 +32,23 @@ $ set -o pipefail && xcodebuild [flags] | xcpretty -c
|
|
30
32
|
$ xcodebuild [flags] | xcpretty -c && exit ${PIPESTATUS[0]}
|
31
33
|
```
|
32
34
|
|
35
|
+
## Raw xcodebuild output
|
36
|
+
You might want to use `xcpretty` together with `tee` to store the raw log in a
|
37
|
+
file, and get the pretty output in the terminal. This might be useful if you
|
38
|
+
want to inspect a failure in detail and aren't able to tell from the pretty
|
39
|
+
output.
|
40
|
+
|
41
|
+
Here's a way of doing it:
|
42
|
+
``` bash
|
43
|
+
$ xcodebuild [flags] | tee xcodebuild.log | xcpretty -c
|
44
|
+
```
|
45
|
+
|
33
46
|
## Formats
|
34
47
|
|
35
|
-
- `--color
|
36
|
-
|
48
|
+
- `--[no-]color`: Show build icons in color. (you can add it to `--simple` or `--test` format).
|
49
|
+
Defaults to auto-detecting color availability.
|
50
|
+
- `--[no-]utf`: Use unicode characters in build output or only ASCII.
|
51
|
+
Defaults to auto-detecting the current locale
|
37
52
|
|
38
53
|
- `--simple`, `-s` (default)
|
39
54
|

|
@@ -71,76 +86,8 @@ events.
|
|
71
86
|
The recommended format is a gem containing the formatter and named
|
72
87
|
with an `xcpretty-` prefix, for easier discovery.
|
73
88
|
|
74
|
-
## Did you just clone xctool?
|
75
|
-
|
76
|
-
Unlike [xctool](https://github.com/facebook/xctool), `xcpretty` isn't a build tool.
|
77
|
-
It relies on `xcodebuild` to do the build process, and it formats the output.
|
78
|
-
|
79
|
-
By the time when [xctool](https://github.com/facebook/xctool) was made, `xcodebuild`
|
80
|
-
wasn't aware of the `test` command, thus running tests in general via CLI was a pain.
|
81
|
-
At this point `xcodebuild` has been improved significantly, and is ready to be used directly.
|
82
|
-
|
83
|
-
|
84
|
-
## Benchmark
|
85
|
-
|
86
|
-
A smaller project ([ObjectiveSugar](https://github.com/supermarin/objectivesugar)) with a fast suite
|
87
|
-
|
88
|
-
#### xcpretty
|
89
|
-
```
|
90
|
-
$ time xcodebuild -workspace ObjectiveSugar.xcworkspace -scheme ObjectiveSugar -sdk iphonesimulator test | xcpretty -tc
|
91
|
-
....................................................................................
|
92
|
-
|
93
|
-
Executed 84 tests, with 0 failures (0 unexpected) in 0.070 (0.094) seconds
|
94
|
-
4.08 real 5.82 user 2.08 sys
|
95
|
-
```
|
96
|
-
#### xcodebuild
|
97
|
-
```
|
98
|
-
$ time xcodebuild -workspace ObjectiveSugar.xcworkspace -scheme ObjectiveSugar -sdk iphonesimulator test
|
99
|
-
... ommitted output ...
|
100
|
-
Executed 84 tests, with 0 failures (0 unexpected) in 0.103 (0.129) seconds
|
101
|
-
** TEST SUCCEEDED **
|
102
|
-
|
103
|
-
4.35 real 6.07 user 2.21 sys
|
104
|
-
```
|
105
|
-
#### xctool
|
106
|
-
```
|
107
|
-
$ time xctool -workspace ObjectiveSugar.xcworkspace -scheme ObjectiveSugar -sdk iphonesimulator test
|
108
|
-
... ommitted output ...
|
109
|
-
** TEST SUCCEEDED: 84 passed, 0 failed, 0 errored, 84 total ** (26964 ms)
|
110
|
-
|
111
|
-
28.05 real 6.59 user 2.24 sys
|
112
|
-
```
|
113
|
-
|
114
|
-
A bit bigger project, without CocoaPods ([ReactiveCocoa](https://github.com/ReactiveCocoa/ReactiveCocoa))
|
115
|
-
|
116
|
-
#### xcpretty
|
117
|
-
```
|
118
|
-
$ time xcodebuild -project ReactiveCocoa.xcodeproj -scheme ReactiveCocoa test | xcpretty -tc
|
119
|
-
..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
|
120
|
-
|
121
|
-
Executed 922 tests, with 0 failures (0 unexpected) in 6.437 (6.761) seconds
|
122
|
-
8.72 real 5.73 user 0.81 sys
|
123
|
-
```
|
124
|
-
#### xcodebuild
|
125
|
-
```
|
126
|
-
$ time xcodebuild -project ReactiveCocoa.xcodeproj -scheme ReactiveCocoa test
|
127
|
-
... ommitted output ...
|
128
|
-
Executed 922 tests, with 0 failures (0 unexpected) in 6.542 (6.913) seconds
|
129
|
-
** TEST SUCCEEDED **
|
130
|
-
|
131
|
-
8.82 real 5.65 user 0.75 sys
|
132
|
-
```
|
133
|
-
#### xctool
|
134
|
-
```
|
135
|
-
$ time xctool -project ReactiveCocoa.xcodeproj -scheme ReactiveCocoa test
|
136
|
-
... ommitted output ...
|
137
|
-
** TEST SUCCEEDED: 922 passed, 0 failed, 0 errored, 922 total ** (9584 ms)
|
138
|
-
|
139
|
-
10.80 real 6.72 user 0.76 sys
|
140
|
-
```
|
141
|
-
|
142
89
|
|
143
|
-
##
|
90
|
+
## Team
|
144
91
|
|
145
|
-
- [
|
146
|
-
- [
|
92
|
+
- [Marin Usalj](http://github.com/supermarin) http://supermar.in
|
93
|
+
- [Delisa Mason](http://github.com/kattrali) http://delisa.me
|
data/Rakefile
CHANGED
@@ -1,24 +1,26 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
+
require 'rubocop/rake_task'
|
3
|
+
require 'rspec/core/rake_task'
|
4
|
+
require 'cucumber/rake/task'
|
2
5
|
|
3
6
|
task :kick do
|
4
|
-
sh 'kicker -r ruby'
|
7
|
+
sh 'bundle exec kicker -r ruby'
|
5
8
|
end
|
6
9
|
|
7
|
-
|
8
|
-
sh 'rspec spec --color --format=doc'
|
10
|
+
Cucumber::Rake::Task.new(:cucumber) do |task|
|
9
11
|
end
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
+
RSpec::Core::RakeTask.new(:spec) do |task|
|
14
|
+
task.rspec_opts = %w(--color --format=doc)
|
13
15
|
end
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
+
RuboCop::RakeTask.new(:lint) do |task|
|
18
|
+
task.fail_on_error = false
|
17
19
|
end
|
18
20
|
|
19
21
|
task :ci do
|
20
|
-
Rake::Task[:install_tools].invoke
|
21
22
|
Rake::Task[:spec].invoke
|
22
23
|
Rake::Task[:cucumber].invoke
|
24
|
+
Rake::Task[:lint].invoke
|
23
25
|
end
|
24
26
|
|
data/bin/xcpretty
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
if RUBY_VERSION < '
|
4
|
-
abort "error: XCPretty requires Ruby
|
3
|
+
if RUBY_VERSION < '2.0.0'
|
4
|
+
abort "error: XCPretty requires Ruby 2.0.0 or higher."
|
5
5
|
end
|
6
6
|
|
7
|
-
if $
|
8
|
-
|
7
|
+
if $PROGRAM_NAME == __FILE__
|
8
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
9
9
|
end
|
10
10
|
require 'xcpretty'
|
11
11
|
require 'optparse'
|
@@ -15,13 +15,13 @@ report_classes = []
|
|
15
15
|
report_formats = {
|
16
16
|
"junit" => XCPretty::JUnit,
|
17
17
|
"html" => XCPretty::HTML,
|
18
|
-
"json-compilation-database" => XCPretty::JSONCompilationDatabase
|
18
|
+
"json-compilation-database" => XCPretty::JSONCompilationDatabase
|
19
19
|
}
|
20
20
|
|
21
21
|
printer_opts = {
|
22
|
-
:unicode
|
23
|
-
:
|
24
|
-
:
|
22
|
+
unicode: XCPretty::Term.unicode?,
|
23
|
+
colorize: XCPretty::Term.color?,
|
24
|
+
formatter: XCPretty::Simple
|
25
25
|
}
|
26
26
|
|
27
27
|
OptionParser.new do |opts|
|
@@ -41,14 +41,14 @@ OptionParser.new do |opts|
|
|
41
41
|
opts.on('-f', '--formatter PATH', 'Use formatter returned from evaluating the specified Ruby file') do |path|
|
42
42
|
printer_opts[:formatter] = XCPretty.load_custom_formatter(path)
|
43
43
|
end
|
44
|
-
opts.on('-
|
45
|
-
printer_opts[:colorize] =
|
44
|
+
opts.on('--[no-]color', 'Use colorized output. Defaults is auto') do |value|
|
45
|
+
printer_opts[:colorize] = value
|
46
46
|
end
|
47
|
-
opts.on('--no-utf', '
|
48
|
-
printer_opts[:unicode] =
|
47
|
+
opts.on('--[no-]utf', 'Use unicode characters in output. Default is auto.') do |value|
|
48
|
+
printer_opts[:unicode] = value
|
49
49
|
end
|
50
50
|
opts.on("-r", "--report FORMAT", "Run FORMAT reporter",
|
51
|
-
|
51
|
+
" Choices: #{report_formats.keys.join(', ')}") do |format|
|
52
52
|
report_classes << report_formats[format]
|
53
53
|
report_options << {}
|
54
54
|
end
|
@@ -74,7 +74,7 @@ OptionParser.new do |opts|
|
|
74
74
|
end
|
75
75
|
|
76
76
|
printer = XCPretty::Printer.new(printer_opts)
|
77
|
-
reporters = report_classes.compact.each_with_index.map {|k,i| k.new(report_options[i])}
|
77
|
+
reporters = report_classes.compact.each_with_index.map { |k, i| k.new(report_options[i]) }
|
78
78
|
|
79
79
|
STDIN.each_line do |line|
|
80
80
|
printer.pretty_print(line)
|