code_quality 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/code_quality/version.rb +1 -1
- data/lib/tasks/code_quality.rake +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce1b29f26412c92229b44e6c88942516150530704c7497046109b4ae9c73502d
|
4
|
+
data.tar.gz: 65b101687e65a2510fbc2842f5313059aa0e21f2a971179928e27e6a947305ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ef7f4e2e65635d002a2d306af20a1d075c876642bef72c66a906aafad988766ddcd5901a9d41d8b9f0d00e86aa58e8bfe686acf37a1a98e14e9655f32f01539
|
7
|
+
data.tar.gz: 0da44037de11fd8dafd39badf65dc6f202dc5d3c9aa52a8684ed89c05b091238013a618700e8976e15479782636176738eb09799978f4c3936d8f38d76302adc
|
data/lib/code_quality/version.rb
CHANGED
data/lib/tasks/code_quality.rake
CHANGED
@@ -111,7 +111,7 @@ namespace :code_quality do
|
|
111
111
|
|
112
112
|
# if config lowest_score then audit it with report score
|
113
113
|
if options[:lowest_score]
|
114
|
-
if report
|
114
|
+
if report[-20..-1] =~ /Score: (.+)/
|
115
115
|
report_score = $1.to_f
|
116
116
|
lowest_score = options[:lowest_score].to_f
|
117
117
|
audit_faild "Report score #{colorize(report_score, :yellow)} is lower then #{colorize(lowest_score, :yellow)}, must improve your code quality or set a higher #{colorize("lowest_score", :black, :white)}" if report_score < lowest_score
|
@@ -155,7 +155,7 @@ namespace :code_quality do
|
|
155
155
|
|
156
156
|
# if config max_offenses then audit it with detected offenses number in report
|
157
157
|
if options[:max_offenses]
|
158
|
-
if report
|
158
|
+
if report[-20..-1] =~ /(\d+) *Total/
|
159
159
|
detected_offenses = $1.to_i
|
160
160
|
max_offenses = options[:max_offenses].to_i
|
161
161
|
audit_faild "Detected offenses #{colorize(detected_offenses, :yellow)} is more then #{colorize(max_offenses, :yellow)}, must improve your code quality or set a lower #{colorize("max_offenses", :black, :white)}" if detected_offenses > max_offenses
|
@@ -253,9 +253,9 @@ namespace :code_quality do
|
|
253
253
|
report_path: "",
|
254
254
|
failure: "",
|
255
255
|
}
|
256
|
-
|
257
256
|
puts "## #{title}"
|
258
257
|
puts "", "```"
|
258
|
+
exc = nil
|
259
259
|
begin
|
260
260
|
realtime(&block)
|
261
261
|
rescue SystemExit => exc
|
@@ -266,6 +266,7 @@ namespace :code_quality do
|
|
266
266
|
@audit_tasks[task_name][:report_path] = @report_path.sub("tmp/code_quality/", "")
|
267
267
|
end
|
268
268
|
puts "```", ""
|
269
|
+
raise exc if exc
|
269
270
|
end
|
270
271
|
|
271
272
|
def realtime(&block)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: code_quality
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RainChen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler-audit
|