quality 37.0.0 → 38.0.1

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: 5c6e41075a75632729495d06a8d99f5a96a5d3256ab509f99fda27a20c90425e
4
- data.tar.gz: bb0f8c7a16417cd6c240d40c846f89518977a4a729a5f7102f63476922eca0e6
3
+ metadata.gz: 48e5a658826a5173325eff4e5619770ea522511d7abfbcaab02aa34c56bd7ae6
4
+ data.tar.gz: 4e8e75ced5fa378412558485e865e5d0a0713ce4a549db77a235d0a6bf575fdc
5
5
  SHA512:
6
- metadata.gz: 79be96733f293dffc553f942a66357becbd953061df2dfed6f3d4d7f8e78abdc6459e45da26a835bf068d1206912690a1124f9abc922aca84d309316fa6b15c9
7
- data.tar.gz: 6a17209dd3f51ad443e3ebcfcce37a36c08d4e6b8ffeda64399dcfcc23484c49e63eca3782a6e0ca1a9adbb7f10683e85fdb520e9cc609f3e41ccaf798412aab
6
+ metadata.gz: bad91c1209954febba291e7d91a86624ed722f7c51475c2a2bd284ec7814c6963bd3ca157a5967535ac611a01d76112f64d029381404be97c7f563d1e5dfac22
7
+ data.tar.gz: 5b155a764d1387c64faceb9998fc7539e9753cb7bc2c7fd2c79ec90feeebf4db257e7060c629b3fbd8c1717d89fee2401a4bc2a93860b1efc4b62cf5ceb56f96
data/README.md CHANGED
@@ -149,7 +149,9 @@ updates.
149
149
 
150
150
  This includes RuboCop upgrades - the quality gem locks in a specific
151
151
  minor version of RuboCop to avoid your metrics being bumped and
152
- 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.
153
155
 
154
156
  Expect your build to break on major upgrades if you use RuboCop.
155
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
 
@@ -1,5 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # this 'time' require statement is needed as of active_support, which
4
+ # tries to remap the xmlschema method. Turns out there are two 'Time'
5
+ # classes - methods get added when you "require 'time'".
6
+ #
7
+ # https://github.com/rails/rails/pull/40859
8
+ #
9
+ # https://app.circleci.com/pipelines/github/apiology/checkoff/46/workflows/27702e5f-ce86-4960-8b5e-f5277ddf159e/jobs/124
10
+ require 'time'
3
11
  require 'active_support'
4
12
  require 'active_support/core_ext'
5
13
 
@@ -3,7 +3,7 @@
3
3
  require_relative 'command_output_processor'
4
4
  require_relative 'process'
5
5
  require_relative 'ruby_spawn'
6
- require_relative 'threshold'
6
+ require 'high_water_mark/threshold'
7
7
 
8
8
  module Quality
9
9
  # Runs a quality-checking, command, checks it agaist the existing
@@ -29,10 +29,10 @@ module Quality
29
29
  @command_options = command_options
30
30
  @verbose = verbose
31
31
  @count_dir.mkdir(output_dir) unless @count_file.exists?(output_dir)
32
- @threshold = Quality::Threshold.new(cmd,
33
- count_io: count_io,
34
- count_file: count_file,
35
- output_dir: output_dir)
32
+ @threshold = HighWaterMark::Threshold.new(cmd,
33
+ count_io: count_io,
34
+ count_file: count_file,
35
+ output_dir: output_dir)
36
36
  @process_class = process_class
37
37
  end
38
38
 
@@ -110,9 +110,7 @@ module Quality
110
110
  end
111
111
 
112
112
  def report_violations(existing)
113
- if existing != MAX_VIOLATIONS
114
- @logger.puts "Existing violations: #{existing}"
115
- end
113
+ @logger.puts "Existing violations: #{existing}" if existing != MAX_VIOLATIONS
116
114
  @logger.puts "Found #{@violations} #{@cmd} violations"
117
115
  end
118
116
 
@@ -8,9 +8,7 @@ module Quality
8
8
  class Bigfiles < Tool
9
9
  def bigfiles_args
10
10
  args = ['--glob', "'#{source_and_doc_files_glob}'"]
11
- unless source_files_exclude_glob == '{}'
12
- args << ['--exclude-glob', "'#{source_files_exclude_glob}'"]
13
- end
11
+ args << ['--exclude-glob', "'#{source_files_exclude_glob}'"] unless source_files_exclude_glob == '{}'
14
12
  args.join(' ')
15
13
  end
16
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
@@ -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 = '37.0.0'
7
+ VERSION = '38.0.1'
8
8
  end
@@ -42,21 +42,18 @@ Gem::Specification.new do |s|
42
42
  #
43
43
  # https://github.com/bbatsov/rubocop#installation
44
44
  s.add_runtime_dependency('mdl')
45
- s.add_runtime_dependency('rubocop', '~> 0.78.0')
46
- # 1.19.0 was a RuboCop 0.51.0 compatibility release
47
- 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'])
48
48
  s.add_runtime_dependency('brakeman')
49
+ s.add_runtime_dependency('high_water_mark')
49
50
  s.add_runtime_dependency('punchlist', ['>= 1.1'])
50
51
  s.add_runtime_dependency('rails_best_practices')
51
52
  s.add_runtime_dependency('rubocop-minitest')
52
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'])
53
56
  s.add_runtime_dependency('rubocop-rspec', ['>=1.19.0'])
54
- # not directly required - this is to workaround this issue:
55
- # https://github.com/octokit/octokit.rb/issues/1177
56
- #
57
- # This causes:
58
- # "uninitialized constant Faraday::Error::ClientError (NameError)"
59
- s.add_runtime_dependency('faraday', ['<1'])
60
57
 
61
58
  # need above 3.2.2 to support Ruby 2.0 syntax
62
59
  #
@@ -72,9 +69,11 @@ Gem::Specification.new do |s|
72
69
  s.add_development_dependency('minitest', ['~> 5'])
73
70
  s.add_development_dependency('mocha')
74
71
  s.add_development_dependency('pronto')
72
+ s.add_development_dependency('pronto-bigfiles')
75
73
  s.add_development_dependency('pronto-flake8')
76
74
  s.add_development_dependency('pronto-punchlist')
77
75
  s.add_development_dependency('pronto-rubocop')
78
- s.add_development_dependency('rake', ['!= 10.4.2'])
76
+ # https://github.com/advisories/GHSA-jppv-gw3r-w3q8
77
+ s.add_development_dependency('rake', ['>= 12.3.3'])
79
78
  s.add_development_dependency('rspec')
80
79
  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: 37.0.0
4
+ version: 38.0.1
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: 2020-01-02 00:00:00.000000000 Z
11
+ date: 2020-12-30 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
@@ -241,33 +261,33 @@ dependencies:
241
261
  - !ruby/object:Gem::Version
242
262
  version: '0'
243
263
  - !ruby/object:Gem::Dependency
244
- name: rubocop-rspec
264
+ name: faraday
245
265
  requirement: !ruby/object:Gem::Requirement
246
266
  requirements:
247
- - - ">="
267
+ - - "~>"
248
268
  - !ruby/object:Gem::Version
249
- version: 1.19.0
269
+ version: '1'
250
270
  type: :runtime
251
271
  prerelease: false
252
272
  version_requirements: !ruby/object:Gem::Requirement
253
273
  requirements:
254
- - - ">="
274
+ - - "~>"
255
275
  - !ruby/object:Gem::Version
256
- version: 1.19.0
276
+ version: '1'
257
277
  - !ruby/object:Gem::Dependency
258
- name: faraday
278
+ name: rubocop-rspec
259
279
  requirement: !ruby/object:Gem::Requirement
260
280
  requirements:
261
- - - "<"
281
+ - - ">="
262
282
  - !ruby/object:Gem::Version
263
- version: '1'
283
+ version: 1.19.0
264
284
  type: :runtime
265
285
  prerelease: false
266
286
  version_requirements: !ruby/object:Gem::Requirement
267
287
  requirements:
268
- - - "<"
288
+ - - ">="
269
289
  - !ruby/object:Gem::Version
270
- version: '1'
290
+ version: 1.19.0
271
291
  - !ruby/object:Gem::Dependency
272
292
  name: ruby_parser
273
293
  requirement: !ruby/object:Gem::Requirement
@@ -358,6 +378,20 @@ dependencies:
358
378
  - - ">="
359
379
  - !ruby/object:Gem::Version
360
380
  version: '0'
381
+ - !ruby/object:Gem::Dependency
382
+ name: pronto-bigfiles
383
+ requirement: !ruby/object:Gem::Requirement
384
+ requirements:
385
+ - - ">="
386
+ - !ruby/object:Gem::Version
387
+ version: '0'
388
+ type: :development
389
+ prerelease: false
390
+ version_requirements: !ruby/object:Gem::Requirement
391
+ requirements:
392
+ - - ">="
393
+ - !ruby/object:Gem::Version
394
+ version: '0'
361
395
  - !ruby/object:Gem::Dependency
362
396
  name: pronto-flake8
363
397
  requirement: !ruby/object:Gem::Requirement
@@ -404,16 +438,16 @@ dependencies:
404
438
  name: rake
405
439
  requirement: !ruby/object:Gem::Requirement
406
440
  requirements:
407
- - - "!="
441
+ - - ">="
408
442
  - !ruby/object:Gem::Version
409
- version: 10.4.2
443
+ version: 12.3.3
410
444
  type: :development
411
445
  prerelease: false
412
446
  version_requirements: !ruby/object:Gem::Requirement
413
447
  requirements:
414
- - - "!="
448
+ - - ">="
415
449
  - !ruby/object:Gem::Version
416
- version: 10.4.2
450
+ version: 12.3.3
417
451
  - !ruby/object:Gem::Dependency
418
452
  name: rspec
419
453
  requirement: !ruby/object:Gem::Requirement
@@ -448,7 +482,6 @@ files:
448
482
  - lib/quality/rake/task.rb
449
483
  - lib/quality/ruby_spawn.rb
450
484
  - lib/quality/runner.rb
451
- - lib/quality/threshold.rb
452
485
  - lib/quality/tool.rb
453
486
  - lib/quality/tools/bigfiles.rb
454
487
  - lib/quality/tools/brakeman.rb
@@ -474,7 +507,7 @@ homepage: http://github.com/apiology/quality
474
507
  licenses:
475
508
  - MIT
476
509
  metadata: {}
477
- post_install_message:
510
+ post_install_message:
478
511
  rdoc_options: []
479
512
  require_paths:
480
513
  - lib
@@ -490,7 +523,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
490
523
  version: '0'
491
524
  requirements: []
492
525
  rubygems_version: 3.0.3
493
- signing_key:
526
+ signing_key:
494
527
  specification_version: 4
495
528
  summary: Code quality tools for Ruby
496
529
  test_files: []
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Quality
4
- # Calculate threshold for quality gem tool
5
- class Threshold
6
- attr_reader :tool_name
7
-
8
- def initialize(tool_name,
9
- count_file: File,
10
- count_io: IO,
11
- output_dir: 'metrics')
12
- @tool_name = tool_name
13
- @count_file = count_file
14
- @count_io = count_io
15
- @filename = File.join(output_dir, "#{tool_name}_high_water_mark")
16
- end
17
-
18
- def threshold
19
- return @count_io.read(@filename).to_i if @count_file.exist?(@filename)
20
- end
21
-
22
- def write_violations(new_violations)
23
- @count_file.open(@filename, 'w') do |file|
24
- file.write(new_violations.to_s + "\n")
25
- end
26
- end
27
- end
28
- end