quality 6.0.0 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/quality/quality_checker.rb +9 -18
- data/lib/quality/rake/config.rb +18 -3
- data/lib/quality/rake/task.rb +2 -1
- data/lib/quality/ruby_spawn.rb +27 -0
- data/lib/quality/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 391f50644286c21d661b14b26561ef8c2326f69d
|
4
|
+
data.tar.gz: 4688022631bec832fe2b4af9e05e6c6ce889e11e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 944415ce3e6063fd876e51dfd01f1554a9fa38fbcf504d76f9a44df05273b663a6af958791b924c1e2be0261f48b97217286bb88e380d824779698f5ae888a8e
|
7
|
+
data.tar.gz: b2e622d47b4037081b49203cc77842c9a40b22f46e895181e81622c3c96633d4a8a0ca357178254b3993958fc284b240fb31b0afaa213067ed309ef0e78a5d03
|
data/README.md
CHANGED
@@ -80,6 +80,10 @@ Quality::Rake::Task.new { |t|
|
|
80
80
|
# Defaults to t.ruby_dirs
|
81
81
|
t.source_dirs.concat(%w(MyProject MyProjectTests))
|
82
82
|
|
83
|
+
# Pick any extra files that are source files, but may not have
|
84
|
+
# extensions--defaults to ['Rakefile']
|
85
|
+
t.extra_files = ['Foo', 'Rakefile']
|
86
|
+
|
83
87
|
# Relative path to output directory where *_high_water_mark
|
84
88
|
# files will be read/written
|
85
89
|
#
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require_relative 'command_output_processor'
|
2
2
|
require_relative 'process_runner'
|
3
|
+
require_relative 'ruby_spawn'
|
3
4
|
|
4
5
|
# XXX: Should add *.gemspec to glob
|
5
6
|
module Quality
|
@@ -14,9 +15,13 @@ module Quality
|
|
14
15
|
Quality::CommandOutputProcessor,
|
15
16
|
count_dir: Dir,
|
16
17
|
process_runner_class: ProcessRunner)
|
17
|
-
@count_file
|
18
|
-
|
19
|
-
@
|
18
|
+
@count_file = count_file
|
19
|
+
@count_io = count_io
|
20
|
+
@command_output_processor_class = command_output_processor_class
|
21
|
+
@count_dir = count_dir
|
22
|
+
@cmd = cmd
|
23
|
+
@command_options = command_options
|
24
|
+
@verbose = verbose
|
20
25
|
@count_dir.mkdir(output_dir) unless @count_file.exists?(output_dir)
|
21
26
|
@filename = File.join(output_dir, "#{cmd}_high_water_mark")
|
22
27
|
@process_runner_class = process_runner_class
|
@@ -89,21 +94,7 @@ module Quality
|
|
89
94
|
args ||= ''
|
90
95
|
|
91
96
|
@found_output = false
|
92
|
-
|
93
|
-
"#{cmd_with_ruby_hack_prefix} #{args}"
|
94
|
-
else
|
95
|
-
"#{cmd_with_ruby_hack_prefix}"
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
def cmd_with_ruby_hack_prefix
|
100
|
-
if defined?(RUBY_ENGINE) && (RUBY_ENGINE == 'jruby')
|
101
|
-
"jruby -S #{@cmd}"
|
102
|
-
elsif RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
|
103
|
-
"#{@cmd}.bat"
|
104
|
-
else
|
105
|
-
@cmd
|
106
|
-
end
|
97
|
+
RubySpawn.new(@cmd, args).invocation
|
107
98
|
end
|
108
99
|
|
109
100
|
def write_violations(new_violations)
|
data/lib/quality/rake/config.rb
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# XXX: I should figure out how to use tagged releases in github. Example:
|
2
|
+
# https://github.com/xsc/lein-ancient/issues/29
|
3
|
+
# https://github.com/xsc/lein-ancient/releases
|
4
|
+
|
1
5
|
# XXX: This should be moved out of rake directory
|
2
6
|
module Quality
|
3
7
|
# Configuration for running quality tool
|
@@ -32,6 +36,10 @@ module Quality
|
|
32
36
|
# Defaults to the same as ruby_dirs
|
33
37
|
attr_writer :source_dirs
|
34
38
|
|
39
|
+
# Pick any extra files that are source files, but may not have
|
40
|
+
# extensions--defaults to ['Rakefile']
|
41
|
+
attr_accessor :extra_files
|
42
|
+
|
35
43
|
# Relative path to output directory where *_high_water_mark
|
36
44
|
# files will be read/written
|
37
45
|
#
|
@@ -46,9 +54,15 @@ module Quality
|
|
46
54
|
@source_dirs ||= ruby_dirs.clone
|
47
55
|
end
|
48
56
|
|
57
|
+
def extra_files
|
58
|
+
@extra_files ||= ['Rakefile']
|
59
|
+
end
|
60
|
+
|
49
61
|
def source_files_glob(dirs = source_dirs,
|
50
|
-
extensions =
|
51
|
-
|
62
|
+
extensions =
|
63
|
+
'rb,swift,cpp,c,java,py,clj,cljs,scala,js')
|
64
|
+
File.join("{#{dirs.join(',')}}", '**',
|
65
|
+
"{#{extra_files.join(',')},*.{#{extensions}}}")
|
52
66
|
end
|
53
67
|
|
54
68
|
def ruby_files_glob
|
@@ -63,7 +77,8 @@ module Quality
|
|
63
77
|
def initialize(quality_name: 'quality',
|
64
78
|
ratchet_name: 'ratchet',
|
65
79
|
globber: fail)
|
66
|
-
@quality_name
|
80
|
+
@quality_name = quality_name
|
81
|
+
@ratchet_name = ratchet_name
|
67
82
|
@skip_tools = []
|
68
83
|
@output_dir = 'metrics'
|
69
84
|
@verbose = false
|
data/lib/quality/rake/task.rb
CHANGED
@@ -35,7 +35,8 @@ module Quality
|
|
35
35
|
gem_spec: Gem::Specification,
|
36
36
|
quality_checker_class:
|
37
37
|
Quality::QualityChecker)
|
38
|
-
@dsl
|
38
|
+
@dsl = dsl
|
39
|
+
@cmd_runner = cmd_runner
|
39
40
|
@globber = globber
|
40
41
|
@config = Quality::Config.new(globber: globber)
|
41
42
|
yield @config if block_given?
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Quality
|
2
|
+
# Spawn a ruby process
|
3
|
+
class RubySpawn
|
4
|
+
def initialize(cmd, args)
|
5
|
+
@cmd = cmd
|
6
|
+
@args = args
|
7
|
+
end
|
8
|
+
|
9
|
+
def invocation
|
10
|
+
if @args.size > 0
|
11
|
+
"#{cmd_with_ruby_hack_prefix} #{@args}"
|
12
|
+
else
|
13
|
+
"#{cmd_with_ruby_hack_prefix}"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def cmd_with_ruby_hack_prefix
|
18
|
+
if defined?(RUBY_ENGINE) && (RUBY_ENGINE == 'jruby')
|
19
|
+
"jruby -S #{@cmd}"
|
20
|
+
elsif RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
|
21
|
+
"#{@cmd}.bat"
|
22
|
+
else
|
23
|
+
@cmd
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/quality/version.rb
CHANGED
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: 7.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-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cane
|
@@ -237,6 +237,7 @@ files:
|
|
237
237
|
- lib/quality/quality_checker.rb
|
238
238
|
- lib/quality/rake/config.rb
|
239
239
|
- lib/quality/rake/task.rb
|
240
|
+
- lib/quality/ruby_spawn.rb
|
240
241
|
- lib/quality/runner.rb
|
241
242
|
- lib/quality/tools/bigfiles.rb
|
242
243
|
- lib/quality/tools/cane.rb
|