crap4ruby 0.2.3 → 0.2.4
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 +8 -1
- data/README.md +6 -3
- data/lib/crap4ruby/analyzer.rb +1 -1
- data/lib/crap4ruby/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dada0d1d790a96c73811f6970d4aca07935dff096805da03f7a1c88b915420de
|
|
4
|
+
data.tar.gz: 8e5c903bd1b45a6f4eea147af46669ab49a81753b90d6760e77b121c462d5983
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d183c752379bb1e86e2e5ef1be3a9bf40767c2d4af2e1d9ed4e5eacc9afc6f904ce5a10d8f7f5aa92012ced727e7ed11803312e66054bccc6e27d28f82b1f8b
|
|
7
|
+
data.tar.gz: b7006ec2c0f4708a1bde7a0d8632c541cc5cc1ec42df2ebc2d31e8d053075f6d05953237bbcaf4338062619a67a92e87261aa0afd0e501ccff6f08184e702314
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ Version numbers follow [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.2.4] - 2026-11-13
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Preserve parsing of the newest supported Ruby syntax with Prism 2.x, independently of the Ruby version running crap4ruby.
|
|
13
|
+
|
|
8
14
|
## [0.2.3] - 2026-11-06
|
|
9
15
|
|
|
10
16
|
### Added
|
|
@@ -68,7 +74,8 @@ Version numbers follow [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.
|
|
|
68
74
|
|
|
69
75
|
- Split CLI execution, AST discovery, and coverage loading into smaller methods without changing their behavior or scoring rules.
|
|
70
76
|
|
|
71
|
-
[Unreleased]: https://github.com/svyatov/crap4ruby/compare/v0.2.
|
|
77
|
+
[Unreleased]: https://github.com/svyatov/crap4ruby/compare/v0.2.4...HEAD
|
|
78
|
+
[0.2.4]: https://github.com/svyatov/crap4ruby/compare/v0.2.3...v0.2.4
|
|
72
79
|
[0.2.3]: https://github.com/svyatov/crap4ruby/compare/v0.2.2...v0.2.3
|
|
73
80
|
[0.2.2]: https://github.com/svyatov/crap4ruby/compare/v0.2.1...v0.2.2
|
|
74
81
|
[0.2.1]: https://github.com/svyatov/crap4ruby/compare/v0.2.0...v0.2.1
|
data/README.md
CHANGED
|
@@ -11,6 +11,8 @@ crap4ruby identifies complex, under-tested Ruby methods using the Change Risk An
|
|
|
11
11
|
|
|
12
12
|
Ruby 3.3 or newer is required.
|
|
13
13
|
|
|
14
|
+
Source parsing uses the newest Ruby syntax supported by the installed Prism version, independently of the Ruby version running crap4ruby.
|
|
15
|
+
|
|
14
16
|
```sh
|
|
15
17
|
gem install crap4ruby
|
|
16
18
|
```
|
|
@@ -53,7 +55,7 @@ Run these commands from this checkout with Ruby 3.3 or newer:
|
|
|
53
55
|
```sh
|
|
54
56
|
bundle install
|
|
55
57
|
gem build crap4ruby.gemspec
|
|
56
|
-
gem install ./crap4ruby-0.2.
|
|
58
|
+
gem install ./crap4ruby-0.2.4.gem
|
|
57
59
|
```
|
|
58
60
|
|
|
59
61
|
To use Bundler in the measured project, add this checkout to that project's `Gemfile`:
|
|
@@ -214,8 +216,9 @@ bundle exec rake
|
|
|
214
216
|
bundle exec ruby -Ilib exe/crap4ruby --help
|
|
215
217
|
```
|
|
216
218
|
|
|
217
|
-
The default task runs
|
|
218
|
-
|
|
219
|
+
The default task runs RuboCop, Steep, tests with SimpleCov, the CRAP limit, YARD validation, and dependency audits.
|
|
220
|
+
It requires 100% typed calls and fails if any library method's CRAP score exceeds 10.
|
|
221
|
+
`bundle exec rake crap` runs the tests and CRAP check. `bundle exec rake test` runs only the tests and coverage collection.
|
|
219
222
|
Each Rake test run discards the previous resultset so stale coverage cannot improve the score.
|
|
220
223
|
Reports are written to `coverage/index.html`, `coverage/.resultset.json`, and `.metrics/crap.edn`.
|
|
221
224
|
|
data/lib/crap4ruby/analyzer.rb
CHANGED
|
@@ -35,7 +35,7 @@ module Crap4Ruby
|
|
|
35
35
|
# @example Analyze a method without loading it
|
|
36
36
|
# Analyzer.new.call("def eligible?(age) = age >= 18", path: "person.rb")
|
|
37
37
|
def call(source, path:)
|
|
38
|
-
result = Prism.parse(source)
|
|
38
|
+
result = Prism.parse(source, version: "latest")
|
|
39
39
|
unless result.success?
|
|
40
40
|
error = result.errors.first
|
|
41
41
|
raise Error, "#{path}:#{error.location.start_line}: #{error.message}"
|
data/lib/crap4ruby/version.rb
CHANGED