rubycritic 4.10.0 → 4.11.0
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 +4 -4
- data/CHANGELOG.md +11 -1
- data/README.md +1 -0
- data/lib/rubycritic/configuration.rb +19 -0
- data/lib/rubycritic/source_control_systems/git/churn.rb +5 -1
- data/lib/rubycritic/version.rb +1 -1
- metadata +7 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc015a0d7c129bd1da7f6a6568ddfdbd970f6fb9899632e07c1687b4d2b0e24f
|
4
|
+
data.tar.gz: a94ac6fe001ee473936352ce4684012fad2d541feab5b3a432da5391784932ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b8712ec496070d78cb6ebbaf57a3a50e37e6971c7997fff75dd6a52bb17b3e549c66150ea8f614e2d80afe2fd4cc9ac2352a9ffeecb548c0becd0ba93a989cb
|
7
|
+
data.tar.gz: 42427d7b53a2921623a53cb9be052019b1399f0eaa729e4a17540bfe5c0a34c8153c59233f15242afcb3782cbcd2514cfccc7c9a7d25ed4e33f2c1ceea06cbf9
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,12 @@
|
|
1
|
-
# main [(unreleased)](https://github.com/whitesmith/rubycritic/compare/v4.
|
1
|
+
# main [(unreleased)](https://github.com/whitesmith/rubycritic/compare/v4.11.0...main)
|
2
|
+
|
3
|
+
* <INSERT YOUR CHANGES HERE>
|
4
|
+
|
5
|
+
# v4.11.0 / 2025-10-15 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.10.0...v4.11.0)
|
6
|
+
|
7
|
+
* [CHANGE] Bump cucumber dependency (by [@faisal][])
|
8
|
+
* [CHANGE] Performance improvement for churn calculation: Memoize call to `git rev-parse --show-toplevel` for churn calculations (by [@mateusdeap][])
|
9
|
+
* [CHANGE] Bump minitest dependency. (by [@faisal][])
|
2
10
|
|
3
11
|
# v4.10.0 / 2025-07-30 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.9.2...v4.10.0)
|
4
12
|
|
@@ -23,6 +31,8 @@
|
|
23
31
|
* [CHANGE] Fix some typos (by [@jbampton][])
|
24
32
|
* [FEATURE] Add coverage_path configuration option (by [@exoego][])
|
25
33
|
|
34
|
+
* [CHANGE] Add support for wildcard entries to the paths option in rubycritic.yml (by [@rishiain][])
|
35
|
+
|
26
36
|
# v4.9.0 / 2023-10-18 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.8.1...v4.9.0)
|
27
37
|
|
28
38
|
* [CHANGE] Bump aruba, cucumber, fakefs, flog, mdl, minitest, and rubocop dependencies (by [@faisal][])
|
data/README.md
CHANGED
@@ -154,6 +154,7 @@ minimum_score: 95 # default is 0
|
|
154
154
|
paths: # Files to analyse. Churn calculation is scoped to these files when using Git SCM.
|
155
155
|
- 'app/controllers/'
|
156
156
|
- 'app/models/'
|
157
|
+
- 'lib/**' # Wildcard patterns are supported (excludes tmp directories automatically)
|
157
158
|
```
|
158
159
|
|
159
160
|
### Analyzer Configuration
|
@@ -21,11 +21,16 @@ module RubyCritic
|
|
21
21
|
self.no_browser = options[:no_browser]
|
22
22
|
self.coverage_path = options[:coverage_path]
|
23
23
|
self.threshold_score = options[:threshold_score].to_i
|
24
|
+
setup_paths_for_targets(options) if options[:paths]
|
24
25
|
setup_analysis_targets(options)
|
25
26
|
setup_version_control(options)
|
26
27
|
setup_formats(options)
|
27
28
|
end
|
28
29
|
|
30
|
+
def setup_paths_for_targets(options)
|
31
|
+
options[:paths] = find_directories(options[:paths])
|
32
|
+
end
|
33
|
+
|
29
34
|
def setup_analysis_targets(options)
|
30
35
|
self.paths = options[:paths] || ['.']
|
31
36
|
self.ruby_extensions = options[:ruby_extensions] || %w[.rb .rake .thor]
|
@@ -51,6 +56,20 @@ module RubyCritic
|
|
51
56
|
source_control_system &&
|
52
57
|
!source_control_system.is_a?(SourceControlSystem::Double)
|
53
58
|
end
|
59
|
+
|
60
|
+
private
|
61
|
+
|
62
|
+
def find_directories(paths)
|
63
|
+
expanded_paths = paths.flat_map do |path|
|
64
|
+
if path.include?('**')
|
65
|
+
search_pattern = File.join(path)
|
66
|
+
Dir.glob(search_pattern).select { |tmp_path| File.directory?(tmp_path) && !tmp_path.start_with?('tmp') }
|
67
|
+
else
|
68
|
+
path
|
69
|
+
end
|
70
|
+
end
|
71
|
+
expanded_paths
|
72
|
+
end
|
54
73
|
end
|
55
74
|
|
56
75
|
module Config
|
@@ -123,7 +123,7 @@ module RubyCritic
|
|
123
123
|
# :reek:DuplicateMethodCall
|
124
124
|
def filename_for_subdirectory(filename)
|
125
125
|
if @git_root == Dir.pwd
|
126
|
-
git_path =
|
126
|
+
git_path = git_top_level
|
127
127
|
cd_path = Dir.pwd
|
128
128
|
if cd_path.length > git_path.length
|
129
129
|
filename = filename.sub(/^#{Regexp.escape("#{File.basename(cd_path)}/")}/, '')
|
@@ -134,6 +134,10 @@ module RubyCritic
|
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
137
|
+
def git_top_level
|
138
|
+
@git_top_level ||= Git.git('rev-parse --show-toplevel').strip
|
139
|
+
end
|
140
|
+
|
137
141
|
def process_file(filename)
|
138
142
|
record_commit(renames.current(filename), @date)
|
139
143
|
end
|
data/lib/rubycritic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubycritic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guilherme Simoes
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date: 2025-
|
10
|
+
date: 2025-10-15 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: flay
|
@@ -230,7 +229,7 @@ dependencies:
|
|
230
229
|
requirements:
|
231
230
|
- - "~>"
|
232
231
|
- !ruby/object:Gem::Version
|
233
|
-
version: 10.
|
232
|
+
version: 10.1.0
|
234
233
|
- - "!="
|
235
234
|
- !ruby/object:Gem::Version
|
236
235
|
version: 9.0.0
|
@@ -240,7 +239,7 @@ dependencies:
|
|
240
239
|
requirements:
|
241
240
|
- - "~>"
|
242
241
|
- !ruby/object:Gem::Version
|
243
|
-
version: 10.
|
242
|
+
version: 10.1.0
|
244
243
|
- - "!="
|
245
244
|
- !ruby/object:Gem::Version
|
246
245
|
version: 9.0.0
|
@@ -312,7 +311,7 @@ dependencies:
|
|
312
311
|
requirements:
|
313
312
|
- - "~>"
|
314
313
|
- !ruby/object:Gem::Version
|
315
|
-
version: 5.
|
314
|
+
version: 5.26.0
|
316
315
|
- - ">="
|
317
316
|
- !ruby/object:Gem::Version
|
318
317
|
version: 5.3.0
|
@@ -322,7 +321,7 @@ dependencies:
|
|
322
321
|
requirements:
|
323
322
|
- - "~>"
|
324
323
|
- !ruby/object:Gem::Version
|
325
|
-
version: 5.
|
324
|
+
version: 5.26.0
|
326
325
|
- - ">="
|
327
326
|
- !ruby/object:Gem::Version
|
328
327
|
version: 5.3.0
|
@@ -612,7 +611,6 @@ licenses:
|
|
612
611
|
- MIT
|
613
612
|
metadata:
|
614
613
|
rubygems_mfa_required: 'true'
|
615
|
-
post_install_message:
|
616
614
|
rdoc_options: []
|
617
615
|
require_paths:
|
618
616
|
- lib
|
@@ -627,8 +625,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
627
625
|
- !ruby/object:Gem::Version
|
628
626
|
version: '0'
|
629
627
|
requirements: []
|
630
|
-
rubygems_version: 3.
|
631
|
-
signing_key:
|
628
|
+
rubygems_version: 3.6.2
|
632
629
|
specification_version: 4
|
633
630
|
summary: RubyCritic is a Ruby code quality reporter
|
634
631
|
test_files: []
|