Skip to content

Commit

Permalink
Gemwork update v0.5.0: New Rubocop cops added
Browse files Browse the repository at this point in the history
Fix up new offenses after adding new Rubocop cops.

Update all gems.
  • Loading branch information
Paul DobbinSchmaltz committed Mar 22, 2024
1 parent 111e40d commit fc85661
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 33 deletions.
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ require:
- rubocop-performance

inherit_gem:
gemwork: lib/rubocop/.rubocop.yml
gemwork: lib/rubocop/.rubocop-gems.yml

AllCops:
TargetRubyVersion: 2.7

Performance/OpenStruct:
Enabled: false # Reconsider later.
50 changes: 25 additions & 25 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ GEM
ansi (1.5.0)
ast (2.4.2)
benchmark-ips (2.13.0)
bigdecimal (3.1.5)
bigdecimal (3.1.7)
builder (3.2.4)
concurrent-ruby (1.2.2)
concurrent-ruby (1.2.3)
debug (1.9.1)
irb (~> 1.10)
reline (>= 0.3.8)
Expand Down Expand Up @@ -43,7 +43,7 @@ GEM
dry-inflector (~> 1.0)
dry-logic (~> 1.4)
zeitwerk (~> 2.6)
gemwork (0.3.0)
gemwork (0.5.0)
debug
irb
minitest
Expand All @@ -56,56 +56,56 @@ GEM
rubocop-rake
simplecov
yard
io-console (0.7.1)
irb (1.11.0)
io-console (0.7.2)
irb (1.12.0)
rdoc
reline (>= 0.3.8)
reline (>= 0.4.2)
json (2.7.1)
language_server-protocol (3.17.0.3)
minitest (5.20.0)
minitest (5.22.3)
minitest-reporters (1.6.1)
ansi
builder
minitest (>= 5.0)
ruby-progressbar
much-stub (0.1.10)
parallel (1.24.0)
parser (3.2.2.4)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
psych (5.1.2)
stringio
racc (1.7.3)
rainbow (3.1.1)
rake (13.1.0)
rdoc (6.6.2)
rdoc (6.6.3.1)
psych (>= 4.0.0)
reek (6.2.0)
reek (6.3.0)
dry-schema (~> 1.13.0)
parser (~> 3.2.0)
parser (~> 3.3.0)
rainbow (>= 2.0, < 4.0)
rexml (~> 3.1)
regexp_parser (2.8.3)
reline (0.4.2)
regexp_parser (2.9.0)
reline (0.4.3)
io-console (~> 0.5)
rexml (3.2.6)
rubocop (1.59.0)
rubocop (1.62.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.4)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-minitest (0.34.3)
rubocop (>= 1.39, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-performance (1.20.1)
rubocop-ast (1.31.2)
parser (>= 3.3.0.4)
rubocop-minitest (0.35.0)
rubocop (>= 1.61, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-performance (1.20.2)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rake (0.6.0)
Expand All @@ -119,8 +119,8 @@ GEM
simplecov_json_formatter (0.1.4)
stringio (3.1.0)
unicode-display_width (2.5.0)
yard (0.9.34)
zeitwerk (2.6.12)
yard (0.9.36)
zeitwerk (2.6.13)

PLATFORMS
arm64-darwin-23
Expand All @@ -133,4 +133,4 @@ DEPENDENCIES
rake

BUNDLED WITH
2.4.13
2.5.6
2 changes: 1 addition & 1 deletion lib/object_identifier/array_wrap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Array.wrap method. This allows us to get around objects that respond to
# `to_a` (such as Struct) and, instead, either utilize `to_ary` or just
# actually wrap the object in an Array ourselves.
class ObjectIdentifier::ArrayWrap
module ObjectIdentifier::ArrayWrap
# :reek:NilCheck
# :reek:ManualDispatch

Expand Down
2 changes: 1 addition & 1 deletion lib/object_identifier/formatters/string_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def initialize(objects, parameters)
#
# @return [String]
def call
parts = objects.first(limit).map { |obj| format_item(obj) }
parts = objects.first(limit).map! { |obj| format_item(obj) }
parts << "... (#{truncated_objects_count} more)" if truncated?
parts.join(", ")
end
Expand Down
3 changes: 2 additions & 1 deletion rakelib/bump.rake
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ module RubyVersions

def self.latest_supported_patches
@latest_supported_patches ||= begin
patches = versions.fetch_values(*VERSION_TYPES).compact.flatten
patches =
versions.fetch_values(*VERSION_TYPES).tap(&:flatten!).tap(&:compact!)
patches.map { |patch| Gem::Version.new(patch) }.sort!.map(&:to_s)
end
end
Expand Down
17 changes: 15 additions & 2 deletions rakelib/gemwork.rake
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# frozen_string_literal: true

spec = Gem::Specification.find_by_name("gemwork")

# Load additional tasks defined by Gemwork.
Gem::Specification.find_by_name("gemwork").tap do |gemspec|
Rake.load_rakefile("#{gemspec.gem_dir}/lib/tasks/Rakefile")
Dir.glob(
Pathname.new(spec.gem_dir).
join("lib", "tasks", "{util,rubocop,reek,test}.rake")) do |task|
load(task)
end

# Redefine the default `rake` task.
task :default do
run_tasks(%i[
test
rubocop
reek
])
end
2 changes: 1 addition & 1 deletion test/object_identifier/parameters_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class ObjectIdentifier::ParametersTest < Minitest::Spec
# ObjectIdentifier::ParametersTest::CustomFormatter is a Test Dummy.
class CustomFormatter
module CustomFormatter
def self.call(*)
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

require "minitest/autorun"

require "gemwork/test/support/reporters"
require "gemwork/test/support/much_stub"
require "gemwork/test/support/reporters"
require "gemwork/test/support/spec_dsl"

0 comments on commit fc85661

Please sign in to comment.