quality 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 084fe3fc08270424439f80723b246afd52195ba6
4
- data.tar.gz: c931c4f2f5c550ecfa9574398d107eb56caf6dca
3
+ metadata.gz: 0ef07dad01bec2902dbd8a9eb3fc9a4c6aa9cda5
4
+ data.tar.gz: bd05769ba03b3fb97bb1bfac32c9547df70edcf9
5
5
  SHA512:
6
- metadata.gz: 7a7a5cde09d84a35aa3a676ce6b492950a11e861f11be01e238491ad912e0d8557b176131edfbc69d6a7d0446a68ccf2479b05c9c807a092f35b0782183e5411
7
- data.tar.gz: 271447c0a38f690bdf83e7d5cc0821d16b067a0b5a5cdfccc10aafe0c856927b857a5e72dbe8ad5c564bcc520af67a3727de9e70003901fc08cbbf1e8a2bb482
6
+ metadata.gz: 6e64aa6addebf2cdf93e29d6d3b1f99a075e8b8b78feb655866097f6178132de30576341df346ae855690ff2e655871ffa06133a8016a0bcfe19a88fcf68b4ad
7
+ data.tar.gz: 8ab27e030c01b22638a88b65999e7e38f6453fd10bef986cb42e51edb52ff546899e29a202886b3c1028de44c9396c1209a1c3c2991fe40213a174276f306306
@@ -71,9 +71,10 @@ module Quality
71
71
  quality_reek
72
72
  quality_flog
73
73
  quality_flay
74
+ quality_rubocop
74
75
  end
75
76
 
76
- def quality_quality_cmd(cmd,
77
+ def ratchet_quality_cmd(cmd,
77
78
  args: nil,
78
79
  emacs_format: false,
79
80
  &process_output_line)
@@ -126,7 +127,7 @@ module Quality
126
127
  if ! File.exist?(".cane")
127
128
  File.open(".cane", "w") {|f| f.write("-f *.rb lib/*.rb test/*.rb")}
128
129
  end
129
- quality_quality_cmd("cane",
130
+ ratchet_quality_cmd("cane",
130
131
  emacs_format: true) { |line|
131
132
  if line =~ /\(([0-9]*)\):$/
132
133
  $1.to_i
@@ -137,7 +138,7 @@ module Quality
137
138
  end
138
139
 
139
140
  def quality_reek
140
- quality_quality_cmd("reek",
141
+ ratchet_quality_cmd("reek",
141
142
  args: "--line-number *.rb lib/*.rb 2>/dev/null",
142
143
  emacs_format: true) { |line|
143
144
  if line =~ /^ .* (.*)$/
@@ -150,7 +151,7 @@ module Quality
150
151
 
151
152
  def quality_flog
152
153
  threshold = 50
153
- quality_quality_cmd("flog",
154
+ ratchet_quality_cmd("flog",
154
155
  args: "--all --continue --methods-only . 2>/dev/null",
155
156
  emacs_format: true) { |line|
156
157
  if line =~ /^ *([0-9.]*): flog total$/
@@ -170,7 +171,7 @@ module Quality
170
171
  end
171
172
 
172
173
  def quality_flay
173
- quality_quality_cmd("flay",
174
+ ratchet_quality_cmd("flay",
174
175
  args: "-t 99999 . 2>/dev/null",
175
176
  emacs_format: true) { |line|
176
177
  if line =~ /^[0-9]*\).* \(mass = ([0-9]*)\)$/
@@ -181,6 +182,17 @@ module Quality
181
182
  }
182
183
  end
183
184
 
185
+ def quality_rubocop
186
+ ratchet_quality_cmd("rubocop",
187
+ args: "--format emacs 2>&1") { |line|
188
+ if line =~ /^.* files inspected, (.*) offences detected$/
189
+ $1.to_i
190
+ else
191
+ 0
192
+ end
193
+ }
194
+ end
195
+
184
196
  def quality
185
197
  Dir.glob("*_high_water_mark").each { |filename|
186
198
  puts "Processing #{filename}"
@@ -1,3 +1,3 @@
1
1
  module Quality
2
- VERSION = '0.0.3'
2
+ VERSION = '0.1.0'
3
3
  end
data/quality.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.authors = ['Vince Broz']
10
10
  #s.default_executable = %q{quality}
11
11
  s.description = %q{Quality is a tool that runs quality checks on Ruby
12
- code using cane, reek, flog and flay, and makes sure
12
+ code using rubocop, cane, reek, flog and flay, and makes sure
13
13
  your numbers don't get any worse over time.
14
14
  }
15
15
  s.email = ["vince@broz.cc"]
@@ -31,6 +31,10 @@ your numbers don't get any worse over time.
31
31
  s.add_runtime_dependency(%q<reek>, [">= 1.3.1"])
32
32
  s.add_runtime_dependency(%q<flog>, [">= 4.1.1"])
33
33
  s.add_runtime_dependency(%q<flay>, [">= 2.4"])
34
+ s.add_runtime_dependency(%q<rubocop>)
35
+
36
+ # need above this version to support Ruby 2.0 syntax
37
+ s.add_runtime_dependency(%q<ruby_parser>, [">= 3.2.2"])
34
38
 
35
39
  s.add_development_dependency(%q<bundler>, [">= 1.1"])
36
40
  s.add_development_dependency(%q<rake>)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quality
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince Broz
@@ -66,6 +66,34 @@ dependencies:
66
66
  - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '2.4'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: ruby_parser
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: 3.2.2
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: 3.2.2
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: bundler
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -94,8 +122,9 @@ dependencies:
94
122
  - - '>='
95
123
  - !ruby/object:Gem::Version
96
124
  version: '0'
97
- description: "Quality is a tool that runs quality checks on Ruby\ncode using cane,
98
- reek, flog and flay, and makes sure \nyour numbers don't get any worse over time.\n"
125
+ description: "Quality is a tool that runs quality checks on Ruby\ncode using rubocop,
126
+ cane, reek, flog and flay, and makes sure \nyour numbers don't get any worse over
127
+ time.\n"
99
128
  email:
100
129
  - vince@broz.cc
101
130
  executables: []