Skip to content

Commit 22a2744

Browse files
committed
Rubocop safe corrections
1 parent b4714a7 commit 22a2744

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

Diff for: lib/puppet-strings/markdown/base.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def defaults
181181
def toc_info
182182
{
183183
name: name.to_s,
184-
link: link,
184+
link:,
185185
desc: summary || @registry[:docstring][:text][0..140].tr("\n", ' '),
186186
private: private?
187187
}

Diff for: lib/puppet-strings/yard/code_objects/function.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def to_hash
9494
hash[:signatures] << { signature: o.signature, docstring: PuppetStrings::Yard::Util.docstring_to_hash(o.docstring, %i[param option enum return example]) }
9595
end
9696
else
97-
hash[:signatures] << { signature: signature, docstring: PuppetStrings::Yard::Util.docstring_to_hash(docstring, %i[param option enum return example]) }
97+
hash[:signatures] << { signature:, docstring: PuppetStrings::Yard::Util.docstring_to_hash(docstring, %i[param option enum return example]) }
9898
end
9999

100100
hash[:docstring] = PuppetStrings::Yard::Util.docstring_to_hash(docstring)

Diff for: lib/puppet-strings/yard/handlers/ruby/base.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class PuppetStrings::Yard::Handlers::Ruby::Base < YARD::Handlers::Ruby::Base
77
# A regular expression for detecting the start of a Ruby heredoc.
88
# Note: the first character of the heredoc start may have been cut off by YARD.
9-
HEREDOC_START = /^<?<[-~]?['"]?(\w+)['"]?[^\n]*\n?/.freeze
9+
HEREDOC_START = /^<?<[-~]?['"]?(\w+)['"]?[^\n]*\n?/
1010

1111
protected
1212

Diff for: lib/puppet-strings/yard/handlers/ruby/data_type_handler.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def extract_params(hash)
237237
default = value['value'] unless value['value'].nil?
238238
end
239239
data_type = [data_type] unless data_type.nil? || data_type.is_a?(Array)
240-
params_hash[key] = { types: data_type, default: default }
240+
params_hash[key] = { types: data_type, default: }
241241
end
242242

243243
params_hash

Diff for: lib/puppet-strings/yard/parsers/puppet/statement.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module PuppetStrings::Yard::Parsers::Puppet
77
# Represents the base Puppet language statement.
88
class Statement
99
# The pattern for parsing docstring comments.
10-
COMMENT_REGEX = /^\s*#+\s?/.freeze
10+
COMMENT_REGEX = /^\s*#+\s?/
1111

1212
attr_reader :source, :file, :line, :docstring, :comments_range
1313

Diff for: lib/puppet-strings/yard/tags/overload_tag.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ def object=(value)
7575
# @param [Array] args The args passed to the method.
7676
# @param block The block passed to the method.
7777
# @return Returns what the method call on the object would return.
78-
def method_missing(method_name, *args, &block)
79-
return object.send(method_name, *args, &block) if object.respond_to? method_name
78+
def method_missing(method_name, ...)
79+
return object.send(method_name, ...) if object.respond_to? method_name
8080

8181
super
8282
end

Diff for: spec/unit/puppet-strings/json_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ class klass(Integer $param1, $param2, String $param3 = hi) inherits foo::bar {
310310
#
311311
# @param [Proc] block The block to capture output from
312312
# @return [Hash] A hash containing the captured output
313-
def capture_output(&_block)
313+
def capture_output(&)
314314
begin
315315
$stdout = StringIO.new
316316
$stderr = StringIO.new

0 commit comments

Comments
 (0)