Skip to content

Commit cbd6f81

Browse files
authored
Merge pull request #397 from puppetlabs/revert-393-maint_exclude_rubocop_versions
Revert "(maint) Exclude breaking rubocop versions"
2 parents 2c26cb4 + ca1498e commit cbd6f81

File tree

6 files changed

+16
-29
lines changed

6 files changed

+16
-29
lines changed

.rubocop.yml

-8
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,3 @@ Style/ClassAndModuleChildren:
2020

2121
Layout/LineLength:
2222
Max: 200
23-
24-
####################################################
25-
# Cops below here due for deprecation
26-
####################################################
27-
# ``Rspec/FilePath`` is going to be deprecated in the next major release of rubocop >=3.0.0: see <https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath>
28-
# As the new cops are already present, e.g., Rspec/SpecFilePathPathFormat, then disabling this in preparation
29-
RSpec/FilePath:
30-
Enabled: false

Gemfile

+2-4
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@ group :development do
3636
gem 'rspec', '~> 3.1'
3737
gem 'rspec-its', '~> 1.0'
3838

39-
gem 'rubocop', '~> 1.50.0', require: false
39+
gem 'rubocop', '~> 1.64.0', require: false
4040
gem 'rubocop-performance', '~> 1.16', require: false
41-
gem 'rubocop-rspec', '~> 2.19', require: false
42-
gem 'rubocop-factory_bot', '!= 2.26.0', require: false
43-
gem 'rubocop-rspec_rails', '!= 2.29.0', require: false
41+
gem 'rubocop-rspec', '~> 3.0', require: false
4442

4543
gem 'serverspec'
4644
gem 'simplecov', require: false

lib/puppet-strings/yard/code_objects/task.rb

+5-7
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,12 @@ def source
4444
end
4545

4646
def parameters
47-
parameters = []
48-
statement.parameters.each do |name, props|
49-
parameters.push({ name: name.to_s,
50-
tag_name: 'param',
51-
text: props['description'] || '',
52-
types: [props['type']] || '' })
47+
statement.parameters.map do |name, props|
48+
{ name: name.to_s,
49+
tag_name: 'param',
50+
text: props['description'] || '',
51+
types: [props['type']] || '' }
5352
end
54-
parameters
5553
end
5654

5755
# Converts the code object to a hash representation.

lib/puppet-strings/yard/handlers/ruby/provider_handler.rb

+2-3
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,8 @@ def populate_provider_data(object)
107107
parameters.each do |kvps|
108108
next unless kvps.count >= 1
109109

110-
defaultfor = []
111-
kvps.each do |kvp|
112-
defaultfor << [node_as_string(kvp[0]) || kvp[0].source, node_as_string(kvp[1]) || kvp[1].source]
110+
defaultfor = kvps.map do |kvp|
111+
[node_as_string(kvp[0]) || kvp[0].source, node_as_string(kvp[1]) || kvp[1].source]
113112
end
114113
object.add_default(defaultfor)
115114
end

lib/puppet-strings/yard/parsers/puppet/statement.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def initialize(parameter)
9292
# @param object The Puppet parser model object that has parameters.
9393
# @param [String] file The file containing the statement.
9494
def initialize(object, file)
95-
super(object, file)
95+
super
9696
@parameters = object.parameters.map { |parameter| Parameter.new(parameter) }
9797
end
9898
end
@@ -105,7 +105,7 @@ class ClassStatement < ParameterizedStatement
105105
# @param [Puppet::Pops::Model::HostClassDefinition] object The model object for the class statement.
106106
# @param [String] file The file containing the statement.
107107
def initialize(object, file)
108-
super(object, file)
108+
super
109109
@name = object.name
110110
@parent_class = object.parent_class
111111
end
@@ -119,7 +119,7 @@ class DefinedTypeStatement < ParameterizedStatement
119119
# @param [Puppet::Pops::Model::ResourceTypeDefinition] object The model object for the defined type statement.
120120
# @param [String] file The file containing the statement.
121121
def initialize(object, file)
122-
super(object, file)
122+
super
123123
@name = object.name
124124
end
125125
end
@@ -132,7 +132,7 @@ class FunctionStatement < ParameterizedStatement
132132
# @param [Puppet::Pops::Model::FunctionDefinition] object The model object for the function statement.
133133
# @param [String] file The file containing the statement.
134134
def initialize(object, file)
135-
super(object, file)
135+
super
136136
@name = object.name
137137
return unless object.respond_to? :return_type
138138

@@ -151,7 +151,7 @@ class PlanStatement < ParameterizedStatement
151151
# @param [Puppet::Pops::Model::PlanDefinition] object The model object for the plan statement.
152152
# @param [String] file The file containing the statement.
153153
def initialize(object, file)
154-
super(object, file)
154+
super
155155
@name = object.name
156156
end
157157
end
@@ -164,7 +164,7 @@ class DataTypeAliasStatement < Statement
164164
# @param [Puppet::Pops::Model::TypeAlias] object The model object for the type statement.
165165
# @param [String] file The file containing the statement.
166166
def initialize(object, file)
167-
super(object, file)
167+
super
168168

169169
type_expr = object.type_expr
170170
case type_expr

lib/puppet-strings/yard/tags/overload_tag.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def has_tag?(name) # rubocop:disable Naming/PredicateName
6565
# @param [Object] value The object to associate with this tag.
6666
# @return [void]
6767
def object=(value)
68-
super(value)
68+
super
6969
@docstring.object = value
7070
@docstring.tags.each { |tag| tag.object = value }
7171
end

0 commit comments

Comments
 (0)