Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "(maint) Exclude breaking rubocop versions" #397

Merged
merged 4 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,3 @@ Style/ClassAndModuleChildren:

Layout/LineLength:
Max: 200

####################################################
# Cops below here due for deprecation
####################################################
# ``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>
# As the new cops are already present, e.g., Rspec/SpecFilePathPathFormat, then disabling this in preparation
RSpec/FilePath:
Enabled: false
6 changes: 2 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@ group :development do
gem 'rspec', '~> 3.1'
gem 'rspec-its', '~> 1.0'

gem 'rubocop', '~> 1.50.0', require: false
gem 'rubocop', '~> 1.64.0', require: false
gem 'rubocop-performance', '~> 1.16', require: false
gem 'rubocop-rspec', '~> 2.19', require: false
gem 'rubocop-factory_bot', '!= 2.26.0', require: false
gem 'rubocop-rspec_rails', '!= 2.29.0', require: false
gem 'rubocop-rspec', '~> 3.0', require: false

gem 'serverspec'
gem 'simplecov', require: false
Expand Down
12 changes: 5 additions & 7 deletions lib/puppet-strings/yard/code_objects/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@ def source
end

def parameters
parameters = []
statement.parameters.each do |name, props|
parameters.push({ name: name.to_s,
tag_name: 'param',
text: props['description'] || '',
types: [props['type']] || '' })
statement.parameters.map do |name, props|
{ name: name.to_s,
tag_name: 'param',
text: props['description'] || '',
types: [props['type']] || '' }
end
parameters
end

# Converts the code object to a hash representation.
Expand Down
5 changes: 2 additions & 3 deletions lib/puppet-strings/yard/handlers/ruby/provider_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,8 @@ def populate_provider_data(object)
parameters.each do |kvps|
next unless kvps.count >= 1

defaultfor = []
kvps.each do |kvp|
defaultfor << [node_as_string(kvp[0]) || kvp[0].source, node_as_string(kvp[1]) || kvp[1].source]
defaultfor = kvps.map do |kvp|
[node_as_string(kvp[0]) || kvp[0].source, node_as_string(kvp[1]) || kvp[1].source]
end
object.add_default(defaultfor)
end
Expand Down
12 changes: 6 additions & 6 deletions lib/puppet-strings/yard/parsers/puppet/statement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def initialize(parameter)
# @param object The Puppet parser model object that has parameters.
# @param [String] file The file containing the statement.
def initialize(object, file)
super(object, file)
super
@parameters = object.parameters.map { |parameter| Parameter.new(parameter) }
end
end
Expand All @@ -105,7 +105,7 @@ class ClassStatement < ParameterizedStatement
# @param [Puppet::Pops::Model::HostClassDefinition] object The model object for the class statement.
# @param [String] file The file containing the statement.
def initialize(object, file)
super(object, file)
super
@name = object.name
@parent_class = object.parent_class
end
Expand All @@ -119,7 +119,7 @@ class DefinedTypeStatement < ParameterizedStatement
# @param [Puppet::Pops::Model::ResourceTypeDefinition] object The model object for the defined type statement.
# @param [String] file The file containing the statement.
def initialize(object, file)
super(object, file)
super
@name = object.name
end
end
Expand All @@ -132,7 +132,7 @@ class FunctionStatement < ParameterizedStatement
# @param [Puppet::Pops::Model::FunctionDefinition] object The model object for the function statement.
# @param [String] file The file containing the statement.
def initialize(object, file)
super(object, file)
super
@name = object.name
return unless object.respond_to? :return_type

Expand All @@ -151,7 +151,7 @@ class PlanStatement < ParameterizedStatement
# @param [Puppet::Pops::Model::PlanDefinition] object The model object for the plan statement.
# @param [String] file The file containing the statement.
def initialize(object, file)
super(object, file)
super
@name = object.name
end
end
Expand All @@ -164,7 +164,7 @@ class DataTypeAliasStatement < Statement
# @param [Puppet::Pops::Model::TypeAlias] object The model object for the type statement.
# @param [String] file The file containing the statement.
def initialize(object, file)
super(object, file)
super

type_expr = object.type_expr
case type_expr
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet-strings/yard/tags/overload_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def has_tag?(name) # rubocop:disable Naming/PredicateName
# @param [Object] value The object to associate with this tag.
# @return [void]
def object=(value)
super(value)
super
@docstring.object = value
@docstring.tags.each { |tag| tag.object = value }
end
Expand Down