Skip to content

Commit

Permalink
Fix layout cops (Katello#11068)
Browse files Browse the repository at this point in the history
* Fix Layout/EmptyLineBetweenDefs cop

* Fix Layout/EmptyLinesAroundAttributeAccessor cop
  • Loading branch information
archanaserver authored Jul 9, 2024
1 parent 7246740 commit 5226e72
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/lib/actions/katello/content_view/publish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Publish < Actions::EntryAction
include ::Katello::ContentViewHelper
include ::Actions::ObservableAction
attr_accessor :version

execution_plan_hooks.use :trigger_capsule_sync, :on => :success
execution_plan_hooks.use :notify_on_failure, :on => [:failure, :paused]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module ContentViewVersion
class CreateRepos < Actions::Base
# allows accessing the build object from the superior action
attr_accessor :repository_mapping

def plan(version, source_repositories = [])
self.repository_mapping = {}
concurrence do
Expand Down
1 change: 1 addition & 0 deletions app/lib/katello/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def self.from_task(task)
end

class UpstreamCandlepinError < CandlepinError; end

class UpstreamConsumerGone < StandardError
def message
_("The manifest doesn't exist on console.redhat.com. " \
Expand Down
1 change: 1 addition & 0 deletions app/lib/katello/http_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class NetworkException < StandardError

class RestClientException < StandardError
attr_reader :service_code, :code

def initialize(params)
super params[:message]
@service_code = params[:service_code]
Expand Down
1 change: 1 addition & 0 deletions app/lib/katello/util/cdn_var_substitutor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module Util
class CdnVarSubstitutor
attr_reader :good_listings
attr_reader :bad_listings

# cdn_resource - an object providing access to CDN. It has to
# provide a get method that takes a path (e.g.
# /content/rhel/6.2/listing) and returns the body response)
Expand Down
1 change: 1 addition & 0 deletions app/services/katello/pulp3/content_view_version/export.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class Export
FORMATS = [SYNCABLE, IMPORTABLE].freeze

attr_reader :smart_proxy, :content_view_version, :destination_server, :from_content_view_version, :repository, :base_path

def self.create(options)
if options.delete(:format) == SYNCABLE
SyncableFormatExport.new(**options)
Expand Down
1 change: 1 addition & 0 deletions app/services/katello/pulp3/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Repository
include Katello::Pulp3::ServiceCommon
attr_accessor :repo
attr_accessor :smart_proxy

delegate :root, to: :repo
delegate :pulp3_api, to: :smart_proxy

Expand Down
1 change: 1 addition & 0 deletions app/services/katello/pulp3/repository_mirror.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module Katello
module Pulp3
class RepositoryMirror
attr_accessor :repo_service

delegate :repo, to: :repo_service
delegate :smart_proxy, to: :repo_service

Expand Down
1 change: 1 addition & 0 deletions app/services/katello/pulp3/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Task
#needed for serialization in dynflow

attr_reader :pulp_data

delegate :[], :key?, :dig, :to_hash, :to => :task_data

def initialize(smart_proxy, data)
Expand Down
1 change: 1 addition & 0 deletions app/services/katello/smart_proxy_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Katello
class SmartProxyHelper
attr_accessor :smart_proxy

def initialize(smart_proxy)
@smart_proxy = smart_proxy
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class AddMirrorOnSyncToRepositories < ActiveRecord::Migration[4.2]
class RepositoryMirrorOnSync < ApplicationRecord
self.table_name = "katello_repositories"
end

def change
add_column :katello_repositories, :mirror_on_sync, :boolean, :default => true, :null => false
RepositoryMirrorOnSync.update_all(:mirror_on_sync => false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class AddDownloadPolicyToKatelloRepositories < ActiveRecord::Migration[4.2]
class DownloadPolicyRepository < ApplicationRecord
self.table_name = "katello_repositories"
end

def change
add_column :katello_repositories, :download_policy, :string, :limit => 255
DownloadPolicyRepository.where(content_type: 'yum').update_all(download_policy: 'immediate')
Expand Down
3 changes: 3 additions & 0 deletions db/migrate/20210119162528_delete_puppet_and_ostree_repos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ class FakeRepositoryPuppetModule < Katello::Model
class FakeContentViewPuppetEnvironment < Katello::Model
self.table_name = 'katello_content_view_puppet_environments'
end

class FakePuppetModule < Katello::Model
self.table_name = 'katello_puppet_modules'
end

class FakeRepositoryOstreeBranch < Katello::Model
self.table_name = 'katello_repository_ostree_branches'
end

class FakeOstreeBranch < Katello::Model
self.table_name = 'katello_ostree_branches'
end
Expand Down
2 changes: 2 additions & 0 deletions lib/monkeys/ar_postgres_evr_t.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ def get_oid_type(oid, fmod, column_name, sql_type = "".freeze)
super
end
end

module ActiveRecord
module ConnectionAdapters
module PostgreSQL
module OID # :nodoc:
class EvrT < Type::String; end # :nodoc:
end
end

class PostgreSQLAdapter < AbstractAdapter
prepend PostgreSQLAdapterExtensions
end
Expand Down
1 change: 1 addition & 0 deletions test/mailers/subscription_mailer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class TestBase < ActiveSupport::TestCase
subscription_id: ActiveRecord::FixtureSet.identify(:other_subscription)) # Setting[:expire_soon_days] || 120
end
end

class SubscriptionMailerTest < TestBase
def setup
@user = User.find(users('admin').id)
Expand Down
1 change: 1 addition & 0 deletions test/support/annotations/annotation_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module Katello
module Annotations
class AnnotationFile
attr_accessor :name, :annotations, :cassette_name

def initialize(hash)
self.name = hash['name']
self.annotations = hash['annotations'].map { |annotation| MatchedAnnotation.new(annotation) }
Expand Down

0 comments on commit 5226e72

Please sign in to comment.