rubycritic 4.9.0 → 4.9.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e02409fa512f3a1b9449ee32bcaf96a8a0b8de76761252475774fa190ca2059
4
- data.tar.gz: 928090c08aff3e873916412a2b0ebc947e64495ade84fc60503534e0b531dad4
3
+ metadata.gz: 9bea0ead82dce8ce7d27a1421044b70841199150f37e2293c41046ed4f96e50a
4
+ data.tar.gz: ef72c2062593c9c8cccea0c01e3f06904051c48de42ee55b3f0a2b672bf1186e
5
5
  SHA512:
6
- metadata.gz: de7584c2a57e92752da20be9a561164234347a7e24d0a8ee036cd54ff213a8f096aec0e7f299f0f534bf260a587314488f26bcdbf61639f47456d276aeebd200
7
- data.tar.gz: 2988c1a400c24ce70b6468cafb7a70459830d9db42d928e714b552b2cfa6c53baf656d6ed92eea63b89a5a678451bce09e23018481c0992ff9ddbb11b8430e13
6
+ metadata.gz: 57279fe99d97710ee3e5371adf8b001f8d4f272a69b9e1cb4ef06083404d8e3d5ce4c10671f59a8e2a3f5728d46b3f12fa7a77a41510a9d9618caee2745b338e
7
+ data.tar.gz: b1e216cf37893fcc573ece5d68e137f47797b490da322efed18e8ef060ef9935ba38be5a68fd293f516840ee942b25426f97487d4c97155f962f23f138498469
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
- # main [(unreleased)](https://github.com/whitesmith/rubycritic/compare/v4.9.0...main)
1
+ # main [(unreleased)](https://github.com/whitesmith/rubycritic/compare/v4.9.1...main)
2
+
3
+ # v4.9.1 / 2024-04-14 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.9.0...v4.9.1)
4
+
5
+ * [CHANGE] Bump cucumber, minitest, parser, rake, reek, rubocop, and ruby_parser dependencies (by [@faisal][])
6
+ * [CHANGE] Fix some typos (by [@jbampton][])
7
+ * [FEATURE] Add coverage_path configuration option (by [@exoego][])
2
8
 
3
9
  # v4.9.0 / 2023-10-18 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.8.1...v4.9.0)
4
10
 
@@ -103,7 +109,7 @@
103
109
 
104
110
  # v4.3.0 / 2019-12-26 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.2.2...v4.3.0)
105
111
 
106
- * [FEATURE] Show which files are uncommited in git (by [@GeoffTidey][])
112
+ * [FEATURE] Show which files are uncommitted in git (by [@GeoffTidey][])
107
113
  * [BUGFIX] Fixes TypeError when `.resultset.json` is not found (by [@etagwerker][])
108
114
 
109
115
  # v4.2.2 / 2019-11-12 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.2.1...v4.2.2)
@@ -341,7 +347,7 @@
341
347
 
342
348
  * [FEATURE] Add CI mode that only analyses the last commit
343
349
  * [FEATURE] Add partial support for Mercurial
344
- * [FEATURE] Allow using RubyCritic programatically
350
+ * [FEATURE] Allow using RubyCritic programmatically
345
351
  * [CHANGE] Update to Reek 1.6.0 (from 1.3.8)
346
352
  * [BUGFIX] Fix issue #18 - Prevent encoding issues when using Git
347
353
 
@@ -442,3 +448,4 @@
442
448
  [@96RadhikaJadhav]: https://github.com/96RadhikaJadhav
443
449
  [@Fito]: https://github.com/Fito
444
450
  [@fbuys]: https://github.com/fbuys
451
+ [@exoego]: https://github.com/exoego
data/README.md CHANGED
@@ -10,17 +10,19 @@ RubyCritic is a gem that wraps around static analysis gems such as [Reek][1], [F
10
10
 
11
11
  ## Table of Contents
12
12
 
13
- - [Overview](#overview)
14
- - [Getting Started](#getting-started)
15
- - [Usage](#usage)
16
- + [Analyzer Configuration](#analyzer-configuration)
17
- + [Alternative Usage Methods](#alternative-usage-methods)
18
- + [Rake Task](#rake-task)
19
- - [Formatters](#formatters)
20
- - [Compatibility](#compatibility)
21
- - [Improving RubyCritic](#improving-rubyCritic)
22
- - [Contributors](#contributors)
23
- - [Credits](#credits)
13
+ - [RubyCritic](#rubycritic)
14
+ - [Table of Contents](#table-of-contents)
15
+ - [Overview](#overview)
16
+ - [Getting Started](#getting-started)
17
+ - [Usage](#usage)
18
+ - [Analyzer Configuration](#analyzer-configuration)
19
+ - [Alternative Usage Methods](#alternative-usage-methods)
20
+ - [Rake Task](#rake-task)
21
+ - [Formatters](#formatters)
22
+ - [Compatibility](#compatibility)
23
+ - [Improving RubyCritic](#improving-rubycritic)
24
+ - [Contributors](#contributors)
25
+ - [Credits](#credits)
24
26
 
25
27
  ## Overview
26
28
 
@@ -107,19 +109,20 @@ For a full list of the command-line options run:
107
109
  $ rubycritic --help
108
110
  ```
109
111
 
110
- | Command flag | Description |
111
- |-------------------------------------|-----------------------------------------------------------------|
112
- | `-v` / `--version` | Displays the current version and exits |
113
- | `-p` / `--path` | Set path where report will be saved (tmp/rubycritic by default) |
114
- | `-f` / `--format` | Report smells in the given format(s)<sup>1</sup> |
115
- | `--custom-format path:classname` | Load and instantiate custom formatter(s)<sup>2</sup> |
116
- | `-s` / `--minimum-score` | Set a minimum score (FLOAT: ex: 96.28), default: 0 |
117
- | `-m` / `--mode-ci` | Use CI mode<sup>3</sup> |
118
- | `-b` / `--branch` | Set branch to compare |
119
- | `-t` / `--maximum-decrease` | Threshold for score difference between two branches<sup>4</sup> |
120
- | `--deduplicate-symlinks` | De-duplicate symlinks based on their final target |
121
- | `--suppress-ratings` | Suppress letter ratings |
122
- | `--no-browser` | Do not open html report with browser |
112
+ | Command flag | Description |
113
+ |----------------------------------|-----------------------------------------------------------------|
114
+ | `-v` / `--version` | Displays the current version and exits |
115
+ | `-p` / `--path` | Set path where report will be saved (tmp/rubycritic by default) |
116
+ | `--coverage-path` | Set path where SimpleCov will be saved (./coverage by default) |
117
+ | `-f` / `--format` | Report smells in the given format(s)<sup>1</sup> |
118
+ | `--custom-format path:classname` | Load and instantiate custom formatter(s)<sup>2</sup> |
119
+ | `-s` / `--minimum-score` | Set a minimum score (FLOAT: ex: 96.28), default: 0 |
120
+ | `-m` / `--mode-ci` | Use CI mode<sup>3</sup> |
121
+ | `-b` / `--branch` | Set branch to compare |
122
+ | `-t` / `--maximum-decrease` | Threshold for score difference between two branches<sup>4</sup> |
123
+ | `--deduplicate-symlinks` | De-duplicate symlinks based on their final target |
124
+ | `--suppress-ratings` | Suppress letter ratings |
125
+ | `--no-browser` | Do not open html report with browser |
123
126
 
124
127
  1. Available output formats:
125
128
  - `html` (default; will open in a browser)
@@ -140,6 +143,7 @@ mode_ci:
140
143
  branch: 'production' # default is main
141
144
  branch: 'production' # default is main
142
145
  path: '/tmp/mycustompath' # Set path where report will be saved (tmp/rubycritic by default)
146
+ coverage_path: '/tmp/coverage' # Set path where SimpleCov coverage will be saved (./coverage by default)
143
147
  threshold_score: 10 # default is 0
144
148
  deduplicate_symlinks: true # default is false
145
149
  suppress_ratings: true # default is false
@@ -239,7 +243,7 @@ RubyCritic is supporting Ruby versions:
239
243
  | 2.4 | [v4.7.0](https://github.com/whitesmith/rubycritic/tree/v4.7.0) |
240
244
  | 2.5 | [v4.7.0](https://github.com/whitesmith/rubycritic/tree/v4.7.0) |
241
245
  | 2.6 | [v4.7.0](https://github.com/whitesmith/rubycritic/tree/v4.7.0) |
242
- | 2.7 | latest |
246
+ | 2.7 | [v4.9.x](https://github.com/whitesmith/rubycritic/tree/v4.9.1) |
243
247
  | 3.0 | latest |
244
248
  | 3.1 | latest |
245
249
 
@@ -48,6 +48,9 @@ module RubyCritic
48
48
 
49
49
  # The path to the cache file
50
50
  def resultset_path
51
+ if (cp = Config.coverage_path)
52
+ SimpleCov.coverage_dir(cp)
53
+ end
51
54
  File.join(SimpleCov.coverage_path, RESULTSET_FILENAME)
52
55
  end
53
56
 
@@ -112,11 +115,7 @@ module RubyCritic
112
115
  if Gem.loaded_specs['simplecov'].version >= Gem::Version.new('0.19')
113
116
  ::SimpleCov::Result.from_hash(resultset)
114
117
  else
115
- array = []
116
- resultset.each do |command_name, data|
117
- array << ::SimpleCov::Result.from_hash(command_name => data)
118
- end
119
- array
118
+ resultset.map { |command_name, data| ::SimpleCov::Result.from_hash(command_name => data) }
120
119
  end
121
120
  end
122
121
  end
@@ -95,6 +95,10 @@ module RubyCritic
95
95
  self.no_browser = true
96
96
  end
97
97
 
98
+ opts.on('--coverage-path [PATH]', 'SimpleCov coverage will be saved (./coverage by default)') do |path|
99
+ @coverage_path = path
100
+ end
101
+
98
102
  opts.on_tail('-v', '--version', "Show gem's version") do
99
103
  self.mode = :version
100
104
  end
@@ -129,7 +133,7 @@ module RubyCritic
129
133
 
130
134
  attr_accessor :mode, :root, :formats, :formatters, :deduplicate_symlinks,
131
135
  :suppress_ratings, :minimum_score, :churn_after, :no_browser,
132
- :parser, :base_branch, :feature_branch, :threshold_score
136
+ :parser, :base_branch, :feature_branch, :threshold_score, :coverage_path
133
137
 
134
138
  def paths
135
139
  @argv unless @argv.empty?
@@ -22,6 +22,7 @@ module RubyCritic
22
22
  {
23
23
  mode: mode,
24
24
  root: root,
25
+ coverage_path: coverage_path,
25
26
  formats: formats,
26
27
  deduplicate_symlinks: deduplicate_symlinks,
27
28
  paths: paths,
@@ -59,6 +60,10 @@ module RubyCritic
59
60
  options['path']
60
61
  end
61
62
 
63
+ def coverage_path
64
+ options['coverage_path']
65
+ end
66
+
62
67
  def threshold_score
63
68
  options['threshold_score']
64
69
  end
@@ -6,7 +6,7 @@ module RubyCritic
6
6
  class Configuration
7
7
  attr_reader :root
8
8
  attr_accessor :source_control_system, :mode, :formats, :formatters, :deduplicate_symlinks,
9
- :suppress_ratings, :open_with, :no_browser, :base_branch,
9
+ :suppress_ratings, :open_with, :no_browser, :base_branch, :coverage_path,
10
10
  :feature_branch, :base_branch_score, :feature_branch_score,
11
11
  :base_root_directory, :feature_root_directory,
12
12
  :compare_root_directory, :threshold_score, :base_branch_collection,
@@ -19,6 +19,7 @@ module RubyCritic
19
19
  self.suppress_ratings = options[:suppress_ratings]
20
20
  self.open_with = options[:open_with]
21
21
  self.no_browser = options[:no_browser]
22
+ self.coverage_path = options[:coverage_path]
22
23
  self.threshold_score = options[:threshold_score].to_i
23
24
  setup_analysis_targets(options)
24
25
  setup_version_control(options)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyCritic
4
- VERSION = '4.9.0'.freeze
4
+ VERSION = '4.9.1'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubycritic
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.9.0
4
+ version: 4.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Simoes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-18 00:00:00.000000000 Z
11
+ date: 2024-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: flay
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 3.2.2.1
61
+ version: 3.2.2.4
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 3.2.2.1
68
+ version: 3.2.2.4
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rainbow
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -89,7 +89,7 @@ dependencies:
89
89
  version: '6.0'
90
90
  - - "<"
91
91
  - !ruby/object:Gem::Version
92
- version: '7.0'
92
+ version: '6.2'
93
93
  type: :runtime
94
94
  prerelease: false
95
95
  version_requirements: !ruby/object:Gem::Requirement
@@ -99,7 +99,7 @@ dependencies:
99
99
  version: '6.0'
100
100
  - - "<"
101
101
  - !ruby/object:Gem::Version
102
- version: '7.0'
102
+ version: '6.2'
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: rexml
105
105
  requirement: !ruby/object:Gem::Requirement
@@ -120,14 +120,14 @@ dependencies:
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: '3.20'
123
+ version: '3.21'
124
124
  type: :runtime
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: '3.20'
130
+ version: '3.21'
131
131
  - !ruby/object:Gem::Dependency
132
132
  name: simplecov
133
133
  requirement: !ruby/object:Gem::Requirement
@@ -224,7 +224,7 @@ dependencies:
224
224
  requirements:
225
225
  - - "~>"
226
226
  - !ruby/object:Gem::Version
227
- version: 9.0.2
227
+ version: 9.2.0
228
228
  - - "!="
229
229
  - !ruby/object:Gem::Version
230
230
  version: 9.0.0
@@ -234,7 +234,7 @@ dependencies:
234
234
  requirements:
235
235
  - - "~>"
236
236
  - !ruby/object:Gem::Version
237
- version: 9.0.2
237
+ version: 9.2.0
238
238
  - - "!="
239
239
  - !ruby/object:Gem::Version
240
240
  version: 9.0.0
@@ -292,7 +292,7 @@ dependencies:
292
292
  requirements:
293
293
  - - "~>"
294
294
  - !ruby/object:Gem::Version
295
- version: 5.20.0
295
+ version: 5.22.2
296
296
  - - ">="
297
297
  - !ruby/object:Gem::Version
298
298
  version: 5.3.0
@@ -302,7 +302,7 @@ dependencies:
302
302
  requirements:
303
303
  - - "~>"
304
304
  - !ruby/object:Gem::Version
305
- version: 5.20.0
305
+ version: 5.22.2
306
306
  - - ">="
307
307
  - !ruby/object:Gem::Version
308
308
  version: 5.3.0
@@ -332,21 +332,21 @@ dependencies:
332
332
  requirements:
333
333
  - - "~>"
334
334
  - !ruby/object:Gem::Version
335
- version: 2.1.0
335
+ version: 2.2.0
336
336
  type: :development
337
337
  prerelease: false
338
338
  version_requirements: !ruby/object:Gem::Requirement
339
339
  requirements:
340
340
  - - "~>"
341
341
  - !ruby/object:Gem::Version
342
- version: 2.1.0
342
+ version: 2.2.0
343
343
  - !ruby/object:Gem::Dependency
344
344
  name: rake
345
345
  requirement: !ruby/object:Gem::Requirement
346
346
  requirements:
347
347
  - - "~>"
348
348
  - !ruby/object:Gem::Version
349
- version: 13.0.6
349
+ version: 13.2.0
350
350
  - - ">="
351
351
  - !ruby/object:Gem::Version
352
352
  version: 11.0.0
@@ -356,7 +356,7 @@ dependencies:
356
356
  requirements:
357
357
  - - "~>"
358
358
  - !ruby/object:Gem::Version
359
- version: 13.0.6
359
+ version: 13.2.0
360
360
  - - ">="
361
361
  - !ruby/object:Gem::Version
362
362
  version: 11.0.0
@@ -380,7 +380,7 @@ dependencies:
380
380
  requirements:
381
381
  - - "~>"
382
382
  - !ruby/object:Gem::Version
383
- version: 1.57.1
383
+ version: 1.59.0
384
384
  - - ">="
385
385
  - !ruby/object:Gem::Version
386
386
  version: 1.54.0
@@ -390,7 +390,7 @@ dependencies:
390
390
  requirements:
391
391
  - - "~>"
392
392
  - !ruby/object:Gem::Version
393
- version: 1.57.1
393
+ version: 1.59.0
394
394
  - - ">="
395
395
  - !ruby/object:Gem::Version
396
396
  version: 1.54.0
@@ -579,7 +579,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
579
579
  - !ruby/object:Gem::Version
580
580
  version: '0'
581
581
  requirements: []
582
- rubygems_version: 3.3.7
582
+ rubygems_version: 3.4.19
583
583
  signing_key:
584
584
  specification_version: 4
585
585
  summary: RubyCritic is a Ruby code quality reporter