quality 36.1.0 → 38.0.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
  SHA256:
3
- metadata.gz: 0c66b37cdb110269046721f38cafb06eca1f8d96cec35d3c3ef2e5650d72e5ce
4
- data.tar.gz: 82e46462a6ffa1ebb9e5eda340b9cb9817e5057026f9b9f2a3898d5a86ed380f
3
+ metadata.gz: 313add6992c8a1f267328a1806dd28365c4d1a9f5c6bd1c8647cab8ea0dcc13f
4
+ data.tar.gz: 239a065dbee555879d31febe98f182351899bbc4d60546f842eed7228a076d6d
5
5
  SHA512:
6
- metadata.gz: 8901276ecd9d6e8ea29b568ee8f22e75acf7ebc08fb2641ed1604a203272983358f6d7df7f5756498e31f7b210802f105fce9f7a902148748970a6a6a539125a
7
- data.tar.gz: d3d62de966cf078e7201972bb60ac07b4582af0872b6e21b8ee3892376a158a17e05ba6a2e5b94ce35e7c9f36c7b839e529e682e3d30ee5d377732c297c73910
6
+ metadata.gz: de7208c080d5b76b4315d1cb12ad1c8cb231c8a3e41de3fb4a969ae3111a90d69190d23bcdcf7a6f29eace8fb50b2dbcfb412bd93ba97b85ae3600bcb4a78143
7
+ data.tar.gz: f1e306ac0000e7687f098b8e30dfbc82fa58edccb040904ae979573c261c20068a2454a8e7bb62344d534de9a8aeb2374879e6db2df51ba2238d2c92156c9703
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Quality -- code quality ratchet for Ruby
2
2
 
3
3
  [![Build Status](https://travis-ci.org/apiology/quality.png)](https://travis-ci.org/apiology/quality)
4
- [![Coverage Status](https://coveralls.io/repos/apiology/quality/badge.png?branch=master)](https://coveralls.io/r/apiology/quality?branch=master)
5
4
 
6
5
  ## Overview
7
6
 
@@ -150,7 +149,9 @@ updates.
150
149
 
151
150
  This includes RuboCop upgrades - the quality gem locks in a specific
152
151
  minor version of RuboCop to avoid your metrics being bumped and
153
- breaking your build.
152
+ breaking your build. This lock affects both the Docker-based quality
153
+ gem (helping to ensure build stability for floating major versions) as
154
+ well as the gem when included directly in your project's gems.
154
155
 
155
156
  Expect your build to break on major upgrades if you use RuboCop.
156
157
 
@@ -23,9 +23,7 @@ module Quality
23
23
 
24
24
  def process_file(file, &count_violations_on_line)
25
25
  out = ''
26
- while (@current_line = file.gets)
27
- out += process_line(&count_violations_on_line)
28
- end
26
+ out += process_line(&count_violations_on_line) while (@current_line = file.gets)
29
27
  out
30
28
  end
31
29
 
@@ -3,6 +3,7 @@
3
3
  require_relative 'command_output_processor'
4
4
  require_relative 'process'
5
5
  require_relative 'ruby_spawn'
6
+ require 'high_water_mark/threshold'
6
7
 
7
8
  module Quality
8
9
  # Runs a quality-checking, command, checks it agaist the existing
@@ -28,7 +29,10 @@ module Quality
28
29
  @command_options = command_options
29
30
  @verbose = verbose
30
31
  @count_dir.mkdir(output_dir) unless @count_file.exists?(output_dir)
31
- @filename = File.join(output_dir, "#{cmd}_high_water_mark")
32
+ @threshold = HighWaterMark::Threshold.new(cmd,
33
+ count_io: count_io,
34
+ count_file: count_file,
35
+ output_dir: output_dir)
32
36
  @process_class = process_class
33
37
  end
34
38
 
@@ -70,14 +74,7 @@ module Quality
70
74
  MAX_VIOLATIONS = 9_999_999_999
71
75
 
72
76
  def existing_violations
73
- @existing_violations ||=
74
- begin
75
- if @count_file.exist?(@filename)
76
- @count_io.read(@filename).to_i
77
- else
78
- MAX_VIOLATIONS
79
- end
80
- end
77
+ @existing_violations ||= (@threshold.threshold || MAX_VIOLATIONS)
81
78
  end
82
79
 
83
80
  def rendered_full_cmd
@@ -113,9 +110,7 @@ module Quality
113
110
  end
114
111
 
115
112
  def report_violations(existing)
116
- if existing != MAX_VIOLATIONS
117
- @logger.puts "Existing violations: #{existing}"
118
- end
113
+ @logger.puts "Existing violations: #{existing}" if existing != MAX_VIOLATIONS
119
114
  @logger.puts "Found #{@violations} #{@cmd} violations"
120
115
  end
121
116
 
@@ -126,9 +121,7 @@ module Quality
126
121
  end
127
122
 
128
123
  def write_violations(new_violations)
129
- @count_file.open(@filename, 'w') do |file|
130
- file.write(new_violations.to_s + "\n")
131
- end
124
+ @threshold.write_violations(new_violations)
132
125
  end
133
126
  end
134
127
  end
@@ -1,14 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative '../tool'
4
+
3
5
  module Quality
4
6
  module Tools
5
7
  # Adds 'bigfiles' tool support to quality gem
6
8
  class Bigfiles < Tool
7
9
  def bigfiles_args
8
10
  args = ['--glob', "'#{source_and_doc_files_glob}'"]
9
- unless source_files_exclude_glob == '{}'
10
- args << ['--exclude-glob', "'#{source_files_exclude_glob}'"]
11
- end
11
+ args << ['--exclude-glob', "'#{source_files_exclude_glob}'"] unless source_files_exclude_glob == '{}'
12
12
  args.join(' ')
13
13
  end
14
14
 
@@ -20,9 +20,7 @@ module Quality
20
20
  args = [
21
21
  "-f '#{ruby_files_glob}'",
22
22
  ]
23
- unless exclude_files.nil? || exclude_files.empty?
24
- args += cane_exclude_args
25
- end
23
+ args += cane_exclude_args unless exclude_files.nil? || exclude_files.empty?
26
24
  args.join(' ')
27
25
  end
28
26
 
@@ -7,9 +7,7 @@ module Quality
7
7
  def punchlist_args
8
8
  glob = "--glob '#{source_and_doc_files_glob}'"
9
9
  regexp = " --regexp '#{punchlist_regexp}'" if punchlist_regexp
10
- unless source_files_exclude_glob == '{}'
11
- exclude = " --exclude-glob '#{source_files_exclude_glob}'"
12
- end
10
+ exclude = " --exclude-glob '#{source_files_exclude_glob}'" unless source_files_exclude_glob == '{}'
13
11
 
14
12
  args = glob
15
13
  args += regexp if regexp
@@ -7,6 +7,8 @@ module Quality
7
7
  def rubocop_args
8
8
  [
9
9
  '--force-exclusion',
10
+ '--require rubocop-minitest',
11
+ '--require rubocop-rake',
10
12
  '--require rubocop-rspec',
11
13
  '--format emacs',
12
14
  *ruby_files,
@@ -4,5 +4,5 @@
4
4
  # reek, flog, flay and rubocop and makes sure your numbers don't get
5
5
  # any worse over time.
6
6
  module Quality
7
- VERSION = '36.1.0'
7
+ VERSION = '38.0.0'
8
8
  end
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  # frozen_string_literal: true
3
2
 
4
3
  # ; -*-Ruby-*-
@@ -43,12 +42,17 @@ Gem::Specification.new do |s|
43
42
  #
44
43
  # https://github.com/bbatsov/rubocop#installation
45
44
  s.add_runtime_dependency('mdl')
46
- s.add_runtime_dependency('rubocop', '~> 0.78.0')
47
- # 1.19.0 was a RuboCop 0.51.0 compatibility release
48
- s.add_runtime_dependency('bigfiles', ['>= 0.1'])
45
+ s.add_runtime_dependency('rubocop', '~> 0.92.0')
46
+ # 0.2.0 had a fatal bug
47
+ s.add_runtime_dependency('bigfiles', ['>= 0.1', '!= 0.2.0'])
49
48
  s.add_runtime_dependency('brakeman')
49
+ s.add_runtime_dependency('high_water_mark')
50
50
  s.add_runtime_dependency('punchlist', ['>= 1.1'])
51
51
  s.add_runtime_dependency('rails_best_practices')
52
+ s.add_runtime_dependency('rubocop-minitest')
53
+ s.add_runtime_dependency('rubocop-rake')
54
+ # 1.19.0 was a RuboCop 0.51.0 compatibility release
55
+ s.add_runtime_dependency('faraday', ['~>1'])
52
56
  s.add_runtime_dependency('rubocop-rspec', ['>=1.19.0'])
53
57
 
54
58
  # need above 3.2.2 to support Ruby 2.0 syntax
@@ -63,13 +67,12 @@ Gem::Specification.new do |s|
63
67
  # Workaround for
64
68
  # https://github.com/bundler/bundler/issues/3401
65
69
  s.add_development_dependency('minitest', ['~> 5'])
66
- # https://github.com/apiology/quality/issues/121
67
- # https://github.com/freerange/mocha/issues/436
68
70
  s.add_development_dependency('mocha')
69
71
  s.add_development_dependency('pronto')
72
+ s.add_development_dependency('pronto-bigfiles')
70
73
  s.add_development_dependency('pronto-flake8')
71
74
  s.add_development_dependency('pronto-punchlist')
72
- s.add_development_dependency('pronto-reek')
73
75
  s.add_development_dependency('pronto-rubocop')
74
76
  s.add_development_dependency('rake', ['!= 10.4.2'])
77
+ s.add_development_dependency('rspec')
75
78
  end
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: 36.1.0
4
+ version: 38.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince Broz
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-27 00:00:00.000000000 Z
11
+ date: 2020-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -148,14 +148,14 @@ dependencies:
148
148
  requirements:
149
149
  - - "~>"
150
150
  - !ruby/object:Gem::Version
151
- version: 0.78.0
151
+ version: 0.92.0
152
152
  type: :runtime
153
153
  prerelease: false
154
154
  version_requirements: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
- version: 0.78.0
158
+ version: 0.92.0
159
159
  - !ruby/object:Gem::Dependency
160
160
  name: bigfiles
161
161
  requirement: !ruby/object:Gem::Requirement
@@ -163,6 +163,9 @@ dependencies:
163
163
  - - ">="
164
164
  - !ruby/object:Gem::Version
165
165
  version: '0.1'
166
+ - - "!="
167
+ - !ruby/object:Gem::Version
168
+ version: 0.2.0
166
169
  type: :runtime
167
170
  prerelease: false
168
171
  version_requirements: !ruby/object:Gem::Requirement
@@ -170,6 +173,9 @@ dependencies:
170
173
  - - ">="
171
174
  - !ruby/object:Gem::Version
172
175
  version: '0.1'
176
+ - - "!="
177
+ - !ruby/object:Gem::Version
178
+ version: 0.2.0
173
179
  - !ruby/object:Gem::Dependency
174
180
  name: brakeman
175
181
  requirement: !ruby/object:Gem::Requirement
@@ -184,6 +190,20 @@ dependencies:
184
190
  - - ">="
185
191
  - !ruby/object:Gem::Version
186
192
  version: '0'
193
+ - !ruby/object:Gem::Dependency
194
+ name: high_water_mark
195
+ requirement: !ruby/object:Gem::Requirement
196
+ requirements:
197
+ - - ">="
198
+ - !ruby/object:Gem::Version
199
+ version: '0'
200
+ type: :runtime
201
+ prerelease: false
202
+ version_requirements: !ruby/object:Gem::Requirement
203
+ requirements:
204
+ - - ">="
205
+ - !ruby/object:Gem::Version
206
+ version: '0'
187
207
  - !ruby/object:Gem::Dependency
188
208
  name: punchlist
189
209
  requirement: !ruby/object:Gem::Requirement
@@ -212,6 +232,48 @@ dependencies:
212
232
  - - ">="
213
233
  - !ruby/object:Gem::Version
214
234
  version: '0'
235
+ - !ruby/object:Gem::Dependency
236
+ name: rubocop-minitest
237
+ requirement: !ruby/object:Gem::Requirement
238
+ requirements:
239
+ - - ">="
240
+ - !ruby/object:Gem::Version
241
+ version: '0'
242
+ type: :runtime
243
+ prerelease: false
244
+ version_requirements: !ruby/object:Gem::Requirement
245
+ requirements:
246
+ - - ">="
247
+ - !ruby/object:Gem::Version
248
+ version: '0'
249
+ - !ruby/object:Gem::Dependency
250
+ name: rubocop-rake
251
+ requirement: !ruby/object:Gem::Requirement
252
+ requirements:
253
+ - - ">="
254
+ - !ruby/object:Gem::Version
255
+ version: '0'
256
+ type: :runtime
257
+ prerelease: false
258
+ version_requirements: !ruby/object:Gem::Requirement
259
+ requirements:
260
+ - - ">="
261
+ - !ruby/object:Gem::Version
262
+ version: '0'
263
+ - !ruby/object:Gem::Dependency
264
+ name: faraday
265
+ requirement: !ruby/object:Gem::Requirement
266
+ requirements:
267
+ - - "~>"
268
+ - !ruby/object:Gem::Version
269
+ version: '1'
270
+ type: :runtime
271
+ prerelease: false
272
+ version_requirements: !ruby/object:Gem::Requirement
273
+ requirements:
274
+ - - "~>"
275
+ - !ruby/object:Gem::Version
276
+ version: '1'
215
277
  - !ruby/object:Gem::Dependency
216
278
  name: rubocop-rspec
217
279
  requirement: !ruby/object:Gem::Requirement
@@ -317,7 +379,7 @@ dependencies:
317
379
  - !ruby/object:Gem::Version
318
380
  version: '0'
319
381
  - !ruby/object:Gem::Dependency
320
- name: pronto-flake8
382
+ name: pronto-bigfiles
321
383
  requirement: !ruby/object:Gem::Requirement
322
384
  requirements:
323
385
  - - ">="
@@ -331,7 +393,7 @@ dependencies:
331
393
  - !ruby/object:Gem::Version
332
394
  version: '0'
333
395
  - !ruby/object:Gem::Dependency
334
- name: pronto-punchlist
396
+ name: pronto-flake8
335
397
  requirement: !ruby/object:Gem::Requirement
336
398
  requirements:
337
399
  - - ">="
@@ -345,7 +407,7 @@ dependencies:
345
407
  - !ruby/object:Gem::Version
346
408
  version: '0'
347
409
  - !ruby/object:Gem::Dependency
348
- name: pronto-reek
410
+ name: pronto-punchlist
349
411
  requirement: !ruby/object:Gem::Requirement
350
412
  requirements:
351
413
  - - ">="
@@ -386,6 +448,20 @@ dependencies:
386
448
  - - "!="
387
449
  - !ruby/object:Gem::Version
388
450
  version: 10.4.2
451
+ - !ruby/object:Gem::Dependency
452
+ name: rspec
453
+ requirement: !ruby/object:Gem::Requirement
454
+ requirements:
455
+ - - ">="
456
+ - !ruby/object:Gem::Version
457
+ version: '0'
458
+ type: :development
459
+ prerelease: false
460
+ version_requirements: !ruby/object:Gem::Requirement
461
+ requirements:
462
+ - - ">="
463
+ - !ruby/object:Gem::Version
464
+ version: '0'
389
465
  description: Quality is a tool that runs quality checks on your code using community
390
466
  tools, and makes sure your numbers don't get any worse over time. Just add 'rake
391
467
  quality' as part of your Continuous Integration
@@ -431,7 +507,7 @@ homepage: http://github.com/apiology/quality
431
507
  licenses:
432
508
  - MIT
433
509
  metadata: {}
434
- post_install_message:
510
+ post_install_message:
435
511
  rdoc_options: []
436
512
  require_paths:
437
513
  - lib
@@ -447,7 +523,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
447
523
  version: '0'
448
524
  requirements: []
449
525
  rubygems_version: 3.0.3
450
- signing_key:
526
+ signing_key:
451
527
  specification_version: 4
452
528
  summary: Code quality tools for Ruby
453
529
  test_files: []