xcpretty-warning-counter 1.1.0 → 1.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/README.md +1 -1
- data/lib/warning_counter.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b727f4e1868c7bcfdcc88ad8b8a5e032eb590f6e
|
4
|
+
data.tar.gz: 5c42ba5b369bdbb3e2da8db79519e64371b913e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e386f280cc00bda5efe1ad19d9fe9f216219f79b40df69f54617fa902b458b9542e45fffa366711adec9f3ea7e3239b5bc774946d6e1e124dc0a9c57fdd48304
|
7
|
+
data.tar.gz: 7da38650ed273ec9e659cf8224a5f06137bfb93604f9792c6a77037cbecdf6f0c1483d91b31f028aca5695aae0de003e35aca481dc59f93fbf46e17e35614c62
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# XCPretty Warning Counter
|
2
2
|
|
3
|
-
A custom formatter for [xcpretty](https://github.com/supermarin/xcpretty) that counts warnings and outputs them in JSON and YAML format in
|
3
|
+
A custom formatter for [xcpretty](https://github.com/supermarin/xcpretty) that counts warnings and outputs them in JSON and YAML format in files named `warning-counts.json` and `warning-counts.yaml` respectively
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
data/lib/warning_counter.rb
CHANGED
@@ -4,6 +4,7 @@ require 'psych'
|
|
4
4
|
class WarningCounter < XCPretty::Simple
|
5
5
|
def initialize(use_unicode, colorize)
|
6
6
|
super
|
7
|
+
@warnings_hash = Set.new()
|
7
8
|
@warning_count = 0
|
8
9
|
end
|
9
10
|
|
@@ -18,7 +19,11 @@ class WarningCounter < XCPretty::Simple
|
|
18
19
|
end
|
19
20
|
|
20
21
|
def format_compile_warning(file_name, file_path, reason, line, cursor)
|
21
|
-
|
22
|
+
key = "#{file_path}:#{reason}:#{line}"
|
23
|
+
if not @warnings_hash.include?(key)
|
24
|
+
@warnings_hash.add(key)
|
25
|
+
@warning_count += 1
|
26
|
+
end
|
22
27
|
super
|
23
28
|
end
|
24
29
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xcpretty-warning-counter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Lyon-Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xcpretty
|