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

Fixes #37427 - Fix some Style/ cop #10080

Merged
merged 3 commits into from
Oct 17, 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
3 changes: 1 addition & 2 deletions app/helpers/form_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,7 @@ def add_label(options, f, attr)
if options[:label_help].present?
label += ' '.html_safe + popover("", options[:label_help], options[:label_help_options] || {})
end
label = label.present? ? label_tag(attr, label.to_s + required_mark.to_s, :class => label_size + " control-label") : ''
label
label.present? ? label_tag(attr, label.to_s + required_mark.to_s, :class => label_size + " control-label") : ''
end

def check_required(options, f, attr)
Expand Down
3 changes: 1 addition & 2 deletions app/models/compute_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,7 @@ def vm_compute_attributes(vm)
vm_attrs = vm_attrs.reject { |k, v| k == :id }

vm_attrs = set_vm_volumes_attributes(vm, vm_attrs)
vm_attrs = set_vm_interfaces_attributes(vm, vm_attrs)
vm_attrs
set_vm_interfaces_attributes(vm, vm_attrs)
end

def vm_ready(vm)
Expand Down
3 changes: 1 addition & 2 deletions app/models/host/managed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,7 @@ def apply_inherited_attributes(attributes, initialized = true)
attributes[attribute] = value
end

attributes = apply_facet_attributes(new_hostgroup, attributes)
attributes
apply_facet_attributes(new_hostgroup, attributes)
end

def hash_clone(value)
Expand Down
2 changes: 1 addition & 1 deletion app/services/foreman/renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def render_template_to_tempfile(template:, prefix:, host: nil, params: {}, varia
file
end

def get_source(klass: nil, template:, **args)
def get_source(template:, klass: nil, **args)
klass ||= Foreman::Renderer::Source::Database
klass.new(template)
end
Expand Down
2 changes: 1 addition & 1 deletion app/services/foreman/renderer/source/string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Foreman
module Renderer
module Source
class String < Foreman::Renderer::Source::Base
def initialize(name: 'Unnamed', content:)
def initialize(content:, name: 'Unnamed')
@name = name
@content = content
end
Expand Down
3 changes: 1 addition & 2 deletions app/services/proxy_reference_registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ def join_reference_arrays(references, other_references)
end
memo
end
references = references.concat to_add
references
references.concat to_add
end

private
Expand Down
6 changes: 3 additions & 3 deletions config/initializers/ldap_instrumentation.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'foreman/ldap/ldap_subscriber.rb'
require 'foreman/ldap/ldap_fluff_subscriber.rb'
require 'foreman/ldap/net_ldap_subscriber.rb'
require 'foreman/ldap/ldap_subscriber'
require 'foreman/ldap/ldap_fluff_subscriber'
require 'foreman/ldap/net_ldap_subscriber'

# Debug logging from net-ldap and ldap_fluff events sent via ActiveSupport::Notifications
Rails.application.config.after_initialize do
Expand Down
Loading