xcpretty-travis-formatter-security-patched 1.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4626ceff8a6943b30e81aebed71b3ffb1856fa8ae0a214c843114186443d4067
4
+ data.tar.gz: f20c2d290685fd26a7af81dbb7d01681b784337f28772c6fb5c46a947a391df9
5
+ SHA512:
6
+ metadata.gz: 29dcde0ff73014eed966c87669f1d1cfba1ec9e706d70d52a152abaaa5077013cf7635d96575b88a7cf8c6d5b27764a8209ede8d0ca04cd5baf1756049c094b9
7
+ data.tar.gz: 2b55e04e4ff60937409539cc9c138ba2f7fca2e2102263bdf7e8b9f5495cfd1fb0cd034c50142c527b878c30ffa32f98ed0f797946af29e331797b3ff303b3b5
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Delisa Mason
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # XCPretty TravisCI Formatter
2
+
3
+ Custom formatter for [xcpretty](https://github.com/supermarin/xcpretty) with some syntactic sugar for presentation on TravisCI. [Here is some sample output](https://travis-ci.org/kattrali/xcpretty-travis-formatter/jobs/52970340). The "Build", "Clean", and test phase sections are folded separately, though the final completion message and failing tests are presented clearly, for faster scanning.
4
+
5
+ ## Installation
6
+
7
+ This formatter is distributed via RubyGems, and depends on a version of `xcpretty` >= 0.0.7 (when custom formatters were introduced). Run:
8
+
9
+ gem install xcpretty-travis-formatter
10
+
11
+ ## Usage
12
+
13
+ Specify `xcpretty-travis-formatter` as a custom formatter to `xcpretty`:
14
+
15
+ ```bash
16
+ #!/bin/bash
17
+
18
+ xcodebuild | xcpretty -f `xcpretty-travis-formatter`
19
+ ```
20
+
21
+ ## How it works
22
+
23
+ The `--formatter` option takes a file path as an argument, which is returned by the `xcpretty-travis-formatter` binary. It must be evaluated before the xcpretty arguments are evaluated, hence the backtick wrapping. The specified file must return a Ruby subclass of `XCPretty::Formatter`, which will then receive `formatter_*` method invocations as the build output is parsed.
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ print File.expand_path('../../lib/travis_formatter.rb', __FILE__)
@@ -0,0 +1,95 @@
1
+
2
+ class TravisFormatter < XCPretty::Simple
3
+
4
+ def initialize (use_unicode, colorize)
5
+ super
6
+ @currentGroup = nil
7
+ @errors = []
8
+ @seenGroups = {}
9
+ @travis = ENV['TRAVIS'].to_s == 'true'
10
+ @warnings = []
11
+ at_exit do
12
+ # Ensure the last opened fold is closed.
13
+ close_fold()
14
+
15
+ # Print out any warnings.
16
+ if !@warnings.compact.empty?
17
+ open_fold("Warnings")
18
+ STDOUT.puts @warnings.compact.join("\n")
19
+ close_fold()
20
+ end
21
+
22
+ # Print out any errors.
23
+ if !@errors.compact.empty?
24
+ open_fold("Errors")
25
+ STDOUT.puts @errors.compact.join("\n")
26
+ exit(1)
27
+ end
28
+ end
29
+ end
30
+
31
+ def format_group(group, track = true)
32
+ group = group.downcase.gsub(/[^a-z\d\-_.]+/, '-').gsub(/-$/, '')
33
+ i = 1
34
+ parts = group.split('.')
35
+ if parts.last =~ /^\d+$/
36
+ last = parts.pop()
37
+ i = last ? last.to_i : 1
38
+ group = parts.join('.')
39
+ end
40
+
41
+ if track && @currentGroup != "#{group}.#{i}" && @seenGroups.has_key?(group)
42
+ i = @seenGroups[group] + 1
43
+ end
44
+
45
+ @seenGroups[group] = i
46
+ "#{group}.#{i}"
47
+ end
48
+
49
+ def close_fold()
50
+ return if not @travis or @currentGroup == nil
51
+ STDOUT.puts "travis_fold:end:#{@currentGroup}\n"
52
+ @currentGroup = nil
53
+ end
54
+
55
+ def open_fold(group, track = true)
56
+ description = group
57
+ group = format_group(group, track)
58
+ return if @currentGroup == group or not @travis
59
+ close_fold() if @currentGroup != nil
60
+ @currentGroup = group
61
+ STDOUT.puts "travis_fold:start:#{group}\033[33;1m#{description}\033[0m\n"
62
+ end
63
+
64
+ # Analyze.
65
+ def format_analyze(file_name, file_path); open_fold("Analyze"); super; end
66
+ def format_analyze_target(target, project, configuration); open_fold("Analyze"); super; end
67
+
68
+ # Build.
69
+ def format_build_target(target, project, configuration); open_fold("Build"); super; end
70
+ def format_compile(file_name, file_path); open_fold("Build"); super; end
71
+
72
+ # Clean.
73
+ def format_clean(project, target, configuration); open_fold("Clean"); super; end
74
+ def format_clean_target(target, project, configuration); open_fold("Clean"); super; end
75
+ def format_clean_remove; open_fold("Clean"); super; end
76
+
77
+ # Test.
78
+ def format_test_run_started(name); open_fold("Test"); super; end
79
+ def format_test_suite_started(name); open_fold("Test"); super; end
80
+ def format_failing_test(suite, test, reason, file_path); @errors.push(super); super; end
81
+ def format_test_summary(message, failures_per_suite); @errors.concat(failures_per_suite.values); super; end
82
+
83
+ # Errors and warnings.
84
+ def format_compile_error(file_name, file_path, reason, line, cursor); @errors.push(super); ""; end
85
+ def format_error(message); @errors.push(super); ""; end
86
+ def format_file_missing_error(error, file_path); @errors.push(super); ""; end
87
+ def format_ld_warning(message); @warnings.push(super); ""; end
88
+ def format_undefined_symbols(message, symbol, reference); @warnings.push(super); ""; end
89
+ def format_duplicate_symbols(message, file_paths); @warnings.push(super); ""; end
90
+ def format_warning(message); @warnings.push(super); ""; end
91
+ def format_compile_warning(file_name, file_path, reason, line, cursor); @warnings.push(super); ""; end
92
+
93
+ end
94
+
95
+ TravisFormatter
metadata ADDED
@@ -0,0 +1,113 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: xcpretty-travis-formatter-security-patched
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Delisa Mason
8
+ - Sha Senevirathne
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2023-12-01 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: xcpretty-security-patched
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: 0.3.1
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.3.1
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - - "~>"
29
+ - !ruby/object:Gem::Version
30
+ version: 0.3.1
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.3.1
34
+ - !ruby/object:Gem::Dependency
35
+ name: bundler
36
+ requirement: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ type: :development
42
+ prerelease: false
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.3'
48
+ - !ruby/object:Gem::Dependency
49
+ name: rake
50
+ requirement: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: bacon
64
+ requirement: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.2'
69
+ type: :development
70
+ prerelease: false
71
+ version_requirements: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.2'
76
+ description: "\n Formatter for xcpretty customized to provide pretty output on TravisCI\n
77
+ \ "
78
+ email:
79
+ - iskanamagus@gmail.com
80
+ - shanaka36@gmail.com
81
+ executables:
82
+ - xcpretty-travis-formatter
83
+ extensions: []
84
+ extra_rdoc_files: []
85
+ files:
86
+ - LICENSE
87
+ - README.md
88
+ - bin/xcpretty-travis-formatter
89
+ - lib/travis_formatter.rb
90
+ homepage: https://github.com/hdsenevi/xcpretty-travis-formatter-security-patched
91
+ licenses:
92
+ - MIT
93
+ metadata: {}
94
+ post_install_message:
95
+ rdoc_options: []
96
+ require_paths:
97
+ - lib
98
+ required_ruby_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '2.0'
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ requirements: []
109
+ rubygems_version: 3.1.6
110
+ signing_key:
111
+ specification_version: 4
112
+ summary: xcpretty custom formatter for TravisCI
113
+ test_files: []