Commit 7c4f0b8d authored by Vitali Tatarintev's avatar Vitali Tatarintev

Fix Layout/EmptyLinesAroundAttributeAccessor offences

Fix and enable `Layout/EmptyLinesAroundAttributeAccessor`
parent 0428d3e6
......@@ -32,13 +32,6 @@ Graphql/IDType:
Layout/ArgumentAlignment:
Enabled: false
# Offense count: 54
# Cop supports --auto-correct.
# Configuration parameters: AllowAliasSyntax, AllowedMethods.
# AllowedMethods: alias_method, public, protected, private
Layout/EmptyLinesAroundAttributeAccessor:
Enabled: false
# Offense count: 771
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
......
......@@ -7,6 +7,7 @@ class ApplicationMailer < ActionMailer::Base
helper MarkupHelper
attr_accessor :current_user
helper_method :current_user, :can?
default from: proc { default_sender_address.format }
......
......@@ -4,6 +4,7 @@ class LfsDownloadObject
include ActiveModel::Validations
attr_accessor :oid, :size, :link, :headers
delegate :sanitized_url, :credentials, to: :sanitized_uri
validates :oid, format: { with: /\A\h{64}\z/ }
......
......@@ -3,6 +3,7 @@
module Storage
class Hashed
attr_accessor :container
delegate :gitlab_shell, :repository_storage, to: :container
REPOSITORY_PATH_PREFIX = '@hashed'
......
......@@ -3,6 +3,7 @@
module Storage
class LegacyProject
attr_accessor :project
delegate :namespace, :gitlab_shell, :repository_storage, to: :project
def initialize(project)
......
......@@ -45,6 +45,7 @@ class WikiPage
# The GitLab Wiki instance.
attr_reader :wiki
delegate :container, to: :wiki
# The raw Gitlab::Git::WikiPage instance.
......
......@@ -17,6 +17,7 @@ module Ci
MAX_TRACKABLE_FAILURES = 200
attr_reader :pipeline
delegate :project, to: :pipeline
def initialize(pipeline)
......
......@@ -57,6 +57,7 @@ module RateLimitedService
prepended do
attr_accessor :rate_limiter_bypassed
cattr_accessor :rate_limiter_scoped_and_keyed
def self.rate_limit(key:, opts:, rate_limiter: ::Gitlab::ApplicationRateLimiter)
......
......@@ -6,6 +6,7 @@ module UpdateRepositoryStorageMethods
Error = Class.new(StandardError)
attr_reader :repository_storage_move
delegate :container, :source_storage_name, :destination_storage_name, to: :repository_storage_move
def initialize(repository_storage_move)
......
......@@ -4,6 +4,7 @@ module NotificationRecipients
module Builder
class MergeRequestUnmergeable < Base
attr_reader :target
def initialize(merge_request)
@target = merge_request
end
......
......@@ -4,6 +4,7 @@ module NotificationRecipients
module Builder
class NewNote < Base
attr_reader :note
def initialize(note)
@note = note
end
......
......@@ -4,6 +4,7 @@ module NotificationRecipients
module Builder
class NewReview < Base
attr_reader :review
def initialize(review)
@review = review
end
......
......@@ -18,6 +18,7 @@
class NotificationService
class Async
attr_reader :parent
delegate :respond_to_missing, to: :parent
def initialize(parent)
......
......@@ -3,6 +3,7 @@
module Projects
class BaseMoveRelationsService < BaseService
attr_reader :source_project
def execute(source_project, remove_remaining_elements: true)
return if source_project.blank?
......
......@@ -11,6 +11,7 @@ module Projects
LARGE_FILE_SIZE = 1.megabytes
attr_reader :lfs_download_object
delegate :oid, :size, :credentials, :sanitized_url, :headers, to: :lfs_download_object, prefix: :lfs
def initialize(project, lfs_download_object)
......
......@@ -34,6 +34,7 @@ end
class Net::HTTP
attr_accessor :hostname_override
SSL_IVNAMES << :@hostname_override
SSL_ATTRIBUTES << :hostname_override
......
......@@ -37,6 +37,7 @@ module Security
private
attr_reader :pipeline, :params
delegate :project, :has_security_findings?, to: :pipeline, private: true
def findings
......
......@@ -22,6 +22,7 @@ module Ci
attr_reader :pipeline
attr_reader :runner_minutes
delegate :project, to: :pipeline
def validate_build_matchers
......
......@@ -34,6 +34,7 @@ module VulnerabilityExternalIssueLinks
private
attr_reader :user, :vulnerability, :link_type, :external_provider, :external_provider_service, :external_issue_link
delegate :project, to: :vulnerability
def create_external_issue
......
......@@ -7,6 +7,7 @@ module Gitlab
include ActiveModel::Model
attr_reader :xml_response, :identity
delegate :name_id, :name_id_format, :xml, to: :xml_response
validate :response_error_passthrough!
......
......@@ -63,6 +63,7 @@ module IncidentManagement
private
attr_reader :rotation
delegate :shift_cycle_duration, to: :rotation
# Starting time of a shift which covers the timestamp.
......
......@@ -12,6 +12,7 @@ module Gitlab
class InsufficientScopeError < AuthenticationError
attr_reader :scopes
def initialize(scopes)
@scopes = scopes.map { |s| s.try(:name) || s }
end
......
......@@ -7,6 +7,7 @@ module Gitlab
module OAuth
class AuthHash
attr_reader :auth_hash
def initialize(auth_hash)
@auth_hash = auth_hash
end
......
......@@ -4,6 +4,7 @@ module Gitlab
module Checks
class BaseBulkChecker < BaseChecker
attr_reader :changes_access
delegate(*ChangesAccess::ATTRIBUTES, to: :changes_access)
def initialize(changes_access)
......
......@@ -4,6 +4,7 @@ module Gitlab
module Checks
class BaseSingleChecker < BaseChecker
attr_reader :change_access
delegate(*SingleChangeAccess::ATTRIBUTES, to: :change_access)
def initialize(change_access)
......
......@@ -94,6 +94,7 @@ module Gitlab
private
attr_reader :project, :destination, :started_at, :log_conditions
delegate :current_monotonic_time, to: :class
def age
......
......@@ -23,6 +23,7 @@ module Gitlab
private
attr_reader :trace_artifact
delegate :aws?, :google?, to: :object_store_config, prefix: :provider
def fetch_md5_checksum
......
......@@ -96,6 +96,7 @@ module Gitlab
attr_reader :instance_variables_builder
attr_reader :project_variables_builder
attr_reader :group_variables_builder
delegate :project, to: :pipeline
def predefined_variables(job)
......
......@@ -12,6 +12,7 @@ module Gitlab
# Note that for very large tables, this may even timeout.
class ExactCountStrategy
attr_reader :models
def initialize(models)
@models = models
end
......
......@@ -14,6 +14,7 @@ module Gitlab
# however is guaranteed to be "fast", because it only looks up statistics.
class ReltuplesCountStrategy
attr_reader :models
def initialize(models)
@models = models
end
......
......@@ -46,6 +46,7 @@ module Gitlab
private
attr_reader :model
delegate :connection, to: :model
def missing_partitions
......
......@@ -31,6 +31,7 @@ module Gitlab
private
attr_reader :connection
delegate :execute, :quote_table_name, :quote_column_name, to: :connection
def default_sequence(table, column)
......
......@@ -8,6 +8,7 @@ module Gitlab
end
attr_reader :raw_body
def initialize(raw_body)
@raw_body = raw_body
end
......
......@@ -63,6 +63,7 @@ module Gitlab
class BlameLine
attr_accessor :lineno, :oldlineno, :commit, :line
def initialize(lineno, oldlineno, commit, line)
@lineno = lineno
@oldlineno = oldlineno
......
......@@ -4,6 +4,7 @@ module Gitlab
module Graphql
class BatchKey
attr_reader :object
delegate :hash, to: :object
def initialize(object, lookahead = nil, object_name: nil)
......
......@@ -10,6 +10,7 @@ module Gitlab
#
class InsecureKeyFingerprint
attr_accessor :key
alias_attribute :fingerprint_md5, :fingerprint
#
......
......@@ -4,6 +4,7 @@ module Gitlab
module Pagination
class GitalyKeysetPager
attr_reader :request_context, :project
delegate :params, to: :request_context
def initialize(request_context, project)
......
......@@ -6,6 +6,7 @@ module Gitlab
class CursorBasedRequestContext
DEFAULT_SORT_DIRECTION = :desc
attr_reader :request_context
delegate :params, to: :request_context
def initialize(request_context)
......
......@@ -5,6 +5,7 @@ module Gitlab
module Keyset
class HeaderBuilder
attr_reader :request_context
delegate :params, :header, :request, to: :request_context
def initialize(request_context)
......
......@@ -4,6 +4,7 @@ module Gitlab
module Pagination
class OffsetPagination < Base
attr_reader :request_context
delegate :params, :header, :request, to: :request_context
def initialize(request_context)
......
......@@ -5,6 +5,7 @@ module Gitlab
module Queries
class BaseQuery
attr_accessor :client
delegate :query_range, :query, :label_values, :series, to: :client, prefix: true
def raw_memory_usage_query(environment_slug)
......
......@@ -15,6 +15,7 @@ module Sidebars
include ::Sidebars::Concerns::HasPartial
attr_reader :context
delegate :current_user, :container, to: :@context
def initialize(context)
......
......@@ -9,6 +9,7 @@ module QA
extend Forwardable
attr_reader :git_uri, :uri
def_delegators :@uri, :user, :host, :path
# See: config/initializers/1_settings.rb
......
......@@ -7,6 +7,7 @@ module QA
module Specs
class Runner < Scenario::Template
attr_accessor :tty, :tags, :options
RegexMismatchError = Class.new(StandardError)
DEFAULT_TEST_PATH_ARGS = ['--', File.expand_path('./features', __dir__)].freeze
......
......@@ -501,6 +501,7 @@ RSpec.describe ApplicationController do
describe '#append_info_to_payload' do
controller(described_class) do
attr_reader :last_payload
urgency :high, [:foo]
def index
......
......@@ -9,6 +9,7 @@ RSpec.describe Mentionable do
include Mentionable
attr_accessor :project, :message
attr_mentionable :message
def author
......
......@@ -26,6 +26,7 @@ module SortingHelper
include Comparable
attr_reader :value
delegate :==, :eql?, :hash, to: :value
def initialize(value)
......
......@@ -12,6 +12,7 @@ RSpec.describe ArrayMembersValidator do
include ActiveModel::Model
include ActiveModel::Validations
attr_accessor :children
validates :children, array_members: { member_class: child_class }
end
end
......
......@@ -10,6 +10,7 @@ RSpec.describe ColorValidator do
include ActiveModel::Model
include ActiveModel::Validations
attr_accessor :color
validates :color, color: true
end.new
end
......
......@@ -8,6 +8,7 @@ RSpec.describe CronValidator do
include ActiveModel::Model
include ActiveModel::Validations
attr_accessor :cron
validates :cron, cron: true
def cron_timezone
......@@ -34,6 +35,7 @@ RSpec.describe CronValidator do
include ActiveModel::Model
include ActiveModel::Validations
attr_accessor :cron_partytime
validates :cron_partytime, cron: true
end.new
end
......
......@@ -8,6 +8,7 @@ RSpec.describe FutureDateValidator do
include ActiveModel::Model
include ActiveModel::Validations
attr_accessor :expires_at
validates :expires_at, future_date: true
end.new
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment