flutter_analyze_parser 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/flutter_analyze_parser.rb +17 -17
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2620b4f6e1fc97234a1f14b48e2b7c114a818611319396b139d6536628db85cc
|
4
|
+
data.tar.gz: c6a54c975719fca3872a81b075dc67978a30aab6a8a3659368f4a515206a97b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ae28e14315deecb745ea777619d35da6916d1ddabd640c3e2e63998a7f4ee5ee2c30943341e87ed33eb8582c1da4c2149dfd8e80421eab70e7f0d339025e1c8
|
7
|
+
data.tar.gz: 67e8f1016d83d5ac0b1248e9167dc5469593d1c60de06c65762436e50d3561a7f48aea103cde918e08380f9c9c0c009459b7857bb4f396ce5c2174dbf6746efd
|
@@ -1,30 +1,30 @@
|
|
1
1
|
FlutterViolation = Struct.new(:rule, :description, :file, :line)
|
2
2
|
|
3
3
|
class FlutterAnalyzeParser
|
4
|
-
|
5
|
-
|
4
|
+
class << self
|
5
|
+
def violations(input)
|
6
|
+
filtered_input = filter_input(input)
|
6
7
|
|
7
|
-
|
8
|
-
return []
|
9
|
-
else
|
10
|
-
violations = []
|
8
|
+
return [] if filtered_input.detect { |element| element.include? "No issues found!" }
|
11
9
|
|
12
10
|
filtered_input
|
13
11
|
.select { |line| line.start_with? "info" }
|
14
|
-
.
|
15
|
-
|
16
|
-
file, line = file_with_line_number.split(":")
|
12
|
+
.map(&method(:parse_line))
|
13
|
+
end
|
17
14
|
|
18
|
-
|
19
|
-
end
|
15
|
+
private
|
20
16
|
|
21
|
-
|
17
|
+
def filter_input(input)
|
18
|
+
input.each_line
|
19
|
+
.map(&:strip)
|
20
|
+
.reject(&:empty?)
|
22
21
|
end
|
23
|
-
end
|
24
22
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
def parse_line(line)
|
24
|
+
_, description, file_with_line_number, rule = line.split(" • ")
|
25
|
+
file, line = file_with_line_number.split(":")
|
26
|
+
|
27
|
+
FlutterViolation.new(rule, description, file, line.to_i)
|
28
|
+
end
|
29
29
|
end
|
30
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flutter_analyze_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mateusz Szklarek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard-rspec
|
@@ -135,8 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '0'
|
137
137
|
requirements: []
|
138
|
-
|
139
|
-
rubygems_version: 2.6.13
|
138
|
+
rubygems_version: 3.0.1
|
140
139
|
signing_key:
|
141
140
|
specification_version: 4
|
142
141
|
summary: Parser for flutter analyze output
|