quality 13.0.0 → 14.0.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/lib/quality/{process_runner.rb → process.rb} +1 -1
- data/lib/quality/quality_checker.rb +7 -8
- data/lib/quality/rake/task.rb +13 -0
- data/lib/quality/runner.rb +2 -2
- data/lib/quality/tools/bigfiles.rb +1 -1
- data/lib/quality/tools/brakeman.rb +20 -0
- data/lib/quality/version.rb +1 -1
- data/quality.gemspec +6 -3
- metadata +21 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1005c04aae87d441e5a4206c4c4e7771d0e0a354
|
4
|
+
data.tar.gz: ce749018195f340fb7e80b77bbb1b4ea807bc10e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2807707cd4a03836f3deadd69ba4fcb59bc48ef4bf092744a71385a8a0fe8f2958754a807002463927e737d7a06c93d361237408f4102f27d6dfcc42eb90a90
|
7
|
+
data.tar.gz: 79636bb7472afcc74b819a78ed829b1f7b010429c297b80c77f84bc2a70d9e14a8ce4399d998e1eaaf25a1ee4a69afa1091bd2d0bbf723109202257864d433db
|
@@ -1,8 +1,7 @@
|
|
1
1
|
require_relative 'command_output_processor'
|
2
|
-
require_relative '
|
2
|
+
require_relative 'process'
|
3
3
|
require_relative 'ruby_spawn'
|
4
4
|
|
5
|
-
# XXX: Should add *.gemspec to glob
|
6
5
|
module Quality
|
7
6
|
# Runs a quality-checking, command, checks it agaist the existing
|
8
7
|
# number of violations for that command, and decreases that number
|
@@ -14,7 +13,7 @@ module Quality
|
|
14
13
|
command_output_processor_class:
|
15
14
|
Quality::CommandOutputProcessor,
|
16
15
|
count_dir: Dir,
|
17
|
-
|
16
|
+
process_class: Process)
|
18
17
|
@count_file = count_file
|
19
18
|
@count_io = count_io
|
20
19
|
@command_output_processor_class = command_output_processor_class
|
@@ -24,7 +23,7 @@ module Quality
|
|
24
23
|
@verbose = verbose
|
25
24
|
@count_dir.mkdir(output_dir) unless @count_file.exists?(output_dir)
|
26
25
|
@filename = File.join(output_dir, "#{cmd}_high_water_mark")
|
27
|
-
@
|
26
|
+
@process_class = process_class
|
28
27
|
end
|
29
28
|
|
30
29
|
def execute(&count_violations_on_line)
|
@@ -44,7 +43,7 @@ module Quality
|
|
44
43
|
end
|
45
44
|
|
46
45
|
def run_command(processor, &count_violations_on_line)
|
47
|
-
runner = @
|
46
|
+
runner = @process_class.new(full_cmd)
|
48
47
|
|
49
48
|
puts full_cmd if @verbose
|
50
49
|
runner.run do |file|
|
@@ -54,11 +53,11 @@ module Quality
|
|
54
53
|
end
|
55
54
|
|
56
55
|
def check_exit_status(exit_status)
|
57
|
-
return if @command_options[:gives_error_code_on_violations]
|
56
|
+
return if @command_options[:gives_error_code_on_violations] ||
|
57
|
+
@command_options[:gives_error_code_on_no_relevant_code]
|
58
58
|
|
59
59
|
fail("Error detected running #{full_cmd}. " \
|
60
|
-
"Exit status is #{exit_status}
|
61
|
-
"output is [#{out}]") if exit_status != 0
|
60
|
+
"Exit status is #{exit_status}") if exit_status != 0
|
62
61
|
end
|
63
62
|
|
64
63
|
def existing_violations
|
data/lib/quality/rake/task.rb
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
# XXX: There's an underlying issue with bundler, and knowing my luck,
|
4
|
+
# probably RVM that is causing confusion on which version of rake is
|
5
|
+
# being pulled in in this situation. Similar issues from the past:
|
6
|
+
#
|
7
|
+
# http://stackoverflow.com/questions/6085610/
|
8
|
+
# ruby-on-rails-and-rake-problems-uninitialized-constant-rakedsl
|
9
|
+
module Rake
|
10
|
+
# Define this in advance so that confused requires succeed
|
11
|
+
module DSL
|
12
|
+
end
|
13
|
+
class Task
|
14
|
+
end
|
15
|
+
end
|
3
16
|
require 'rake'
|
4
17
|
require 'rake/tasklib'
|
5
18
|
require 'rbconfig'
|
data/lib/quality/runner.rb
CHANGED
@@ -6,8 +6,7 @@ require_relative 'tools/reek'
|
|
6
6
|
require_relative 'tools/rubocop'
|
7
7
|
require_relative 'tools/bigfiles'
|
8
8
|
require_relative 'tools/punchlist'
|
9
|
-
|
10
|
-
# XXX: This name is too similar to process_runner
|
9
|
+
require_relative 'tools/brakeman'
|
11
10
|
|
12
11
|
module Quality
|
13
12
|
# Knows how to run different quality tools based on a configuration
|
@@ -20,6 +19,7 @@ module Quality
|
|
20
19
|
include Tools::Rubocop
|
21
20
|
include Tools::BigFiles
|
22
21
|
include Tools::Punchlist
|
22
|
+
include Tools::Brakeman
|
23
23
|
|
24
24
|
extend ::Forwardable
|
25
25
|
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Quality
|
2
|
+
module Tools
|
3
|
+
# Adds 'rubocop' tool support to quality gem
|
4
|
+
module Brakeman
|
5
|
+
private
|
6
|
+
|
7
|
+
def quality_brakeman
|
8
|
+
ratchet_quality_cmd('brakeman',
|
9
|
+
args: '-q --summary -f csv 2>/dev/null',
|
10
|
+
gives_error_code_on_no_relevant_code: true) do |line|
|
11
|
+
if line =~ /Security Warnings,([0-9]*) \([0-9]*\)$/
|
12
|
+
$1.to_i
|
13
|
+
else
|
14
|
+
0
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/quality/version.rb
CHANGED
data/quality.gemspec
CHANGED
@@ -9,9 +9,11 @@ Gem::Specification.new do |s|
|
|
9
9
|
|
10
10
|
s.authors = ['Vince Broz']
|
11
11
|
# s.default_executable = %q{quality}
|
12
|
-
s.description =
|
13
|
-
|
14
|
-
your numbers don't get any
|
12
|
+
s.description =
|
13
|
+
'Quality is a tool that runs quality checks on your code using ' \
|
14
|
+
"community tools, and makes sure your numbers don't get any " \
|
15
|
+
"worse over time. Just add 'rake quality' as part of your " \
|
16
|
+
'Continuous Integration'
|
15
17
|
s.email = ['vince@broz.cc']
|
16
18
|
# s.executables = ["quality"]
|
17
19
|
# s.extra_rdoc_files = ["CHANGELOG", "License.txt"]
|
@@ -36,6 +38,7 @@ your numbers don't get any worse over time."
|
|
36
38
|
s.add_runtime_dependency('rubocop')
|
37
39
|
s.add_runtime_dependency('bigfiles')
|
38
40
|
s.add_runtime_dependency('punchlist')
|
41
|
+
s.add_runtime_dependency('brakeman')
|
39
42
|
|
40
43
|
# need above 3.2.2 to support Ruby 2.0 syntax
|
41
44
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quality
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 14.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vince Broz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cane
|
@@ -114,6 +114,20 @@ dependencies:
|
|
114
114
|
- - '>='
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: brakeman
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - '>='
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
type: :runtime
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - '>='
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0'
|
117
131
|
- !ruby/object:Gem::Dependency
|
118
132
|
name: ruby_parser
|
119
133
|
requirement: !ruby/object:Gem::Requirement
|
@@ -218,10 +232,9 @@ dependencies:
|
|
218
232
|
- - ~>
|
219
233
|
- !ruby/object:Gem::Version
|
220
234
|
version: '5'
|
221
|
-
description:
|
222
|
-
|
223
|
-
|
224
|
-
your numbers don't get any worse over time.
|
235
|
+
description: Quality is a tool that runs quality checks on your code using community
|
236
|
+
tools, and makes sure your numbers don't get any worse over time. Just add 'rake
|
237
|
+
quality' as part of your Continuous Integration
|
225
238
|
email:
|
226
239
|
- vince@broz.cc
|
227
240
|
executables: []
|
@@ -232,13 +245,14 @@ files:
|
|
232
245
|
- README.md
|
233
246
|
- Rakefile
|
234
247
|
- lib/quality/command_output_processor.rb
|
235
|
-
- lib/quality/
|
248
|
+
- lib/quality/process.rb
|
236
249
|
- lib/quality/quality_checker.rb
|
237
250
|
- lib/quality/rake/config.rb
|
238
251
|
- lib/quality/rake/task.rb
|
239
252
|
- lib/quality/ruby_spawn.rb
|
240
253
|
- lib/quality/runner.rb
|
241
254
|
- lib/quality/tools/bigfiles.rb
|
255
|
+
- lib/quality/tools/brakeman.rb
|
242
256
|
- lib/quality/tools/cane.rb
|
243
257
|
- lib/quality/tools/flay.rb
|
244
258
|
- lib/quality/tools/flog.rb
|