Skip to content

Commit

Permalink
Drop support for Ruby 3.0, and adopt Rubycritic changes for Ruby 3.1.
Browse files Browse the repository at this point in the history
- Drop support for Ruby 3.0.
- Update Rubycritic config to target Ruby 3.1. Apply all safe autocorrections except for Style/HashSyntax.
- Set Rubycritic's Style/HashSyntax EnforcedShorthandSyntax to 'never', which keeps the old style in place (and consistent) until we decide to convert.
- Add Ruby 3.3 to the test matrix and Drop Ruby 3.0 (which largely includes the changes in whitesmith#488, so we'll need to rebase if that's landed when we do something with this)
  • Loading branch information
faisal committed Apr 16, 2024
1 parent 3464526 commit 26e19cd
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
fail-fast: false
matrix:
ruby-version:
- '3.0'
- '3.1'
- '3.2'
- '3.3'
Expand Down Expand Up @@ -59,7 +58,6 @@ jobs:
fail-fast: false
matrix:
ruby-version:
- '3.0'
- '3.1'
- '3.2'
- '3.3'
Expand Down Expand Up @@ -89,7 +87,6 @@ jobs:
fail-fast: false
matrix:
ruby-version:
- '3.0'
- '3.1'
- '3.2'
- '3.3'
Expand Down Expand Up @@ -119,7 +116,6 @@ jobs:
fail-fast: false
matrix:
ruby-version:
- '3.0'
- '3.1'
- '3.2'
- '3.3'
Expand Down
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ AllCops:
- 'tmp/**/*'
- 'vendor/**/*'
- 'gemfiles/*'
TargetRubyVersion: 3.0
TargetRubyVersion: 3.1

Metrics/BlockLength:
Enabled: false
Expand All @@ -26,6 +26,9 @@ Layout/LineLength:
Style/Documentation:
Enabled: false

Style/HashSyntax:
EnforcedShorthandSyntax: either

Security/MarshalLoad:
Enabled: false
Include:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# main [(unreleased)](https://github.com/whitesmith/rubycritic/compare/v4.9.1...main)

* [CHANGE] Drop support for Ruby 3.0.x (by [@faisal][])
* [CHANGE] Drop support for Ruby 2.7.x (by [@faisal][])

# v4.9.1 / 2024-04-14 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.9.0...v4.9.1)
Expand Down
4 changes: 2 additions & 2 deletions lib/rubycritic/analysers/coverage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ def stored_data

# Ensure only one process is reading or writing the resultset at any
# given time
def synchronize_resultset(&proc)
def synchronize_resultset(&)
# make it reentrant
return yield if defined?(@resultset_locked) && @resultset_locked == true

return yield unless File.exist?(resultset_writelock)

with_lock(&proc)
with_lock(&)
end

def with_lock
Expand Down
4 changes: 2 additions & 2 deletions lib/rubycritic/core/analysed_modules_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def initialize(paths, modules = nil)
end
end

def each(&block)
@modules.each(&block)
def each(&)
@modules.each(&)
end

def where(module_paths)
Expand Down
2 changes: 1 addition & 1 deletion rubycritic.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
spec.summary = 'RubyCritic is a Ruby code quality reporter'
spec.homepage = 'https://github.com/whitesmith/rubycritic'
spec.license = 'MIT'
spec.required_ruby_version = '>= 3.0.0'
spec.required_ruby_version = '>= 3.1.0'

spec.files = [
'CHANGELOG.md',
Expand Down

0 comments on commit 26e19cd

Please sign in to comment.